diff options
author | Bass <tudurap.com@gmail.com> | 2019-01-24 13:21:54 +0000 |
---|---|---|
committer | Bass <tudurap.com@gmail.com> | 2019-01-24 13:21:54 +0000 |
commit | 01a7f4d9e5ba8a042b7b019a7b9bb35f9fd3a343 (patch) | |
tree | ca6d3cd201ed95820caa9c828ea03c0f25ecd76a | |
parent | 1b40750ba5059473a99a064faa7342fc60a2de89 (diff) | |
parent | b24709d41d33f1f76f2e6852323d2b5cd90bb4b0 (diff) | |
download | GT5-Unofficial-01a7f4d9e5ba8a042b7b019a7b9bb35f9fd3a343.tar.gz GT5-Unofficial-01a7f4d9e5ba8a042b7b019a7b9bb35f9fd3a343.tar.bz2 GT5-Unofficial-01a7f4d9e5ba8a042b7b019a7b9bb35f9fd3a343.zip |
Merge branch 'master' into bassAdditions
241 files changed, 9532 insertions, 1983 deletions
diff --git a/.gitignore b/.gitignore index 45a1e006b5..0dd8fcec0e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ SetupDevWorkspaces.bat .idea/workspace.xml *.db *.log +.idea/ @@ -1,12 +1,14 @@ -# TecTech [](http://jenkins.usrv.de:8081/job/Tec%20Tech) +# TecTech [](http://jenkins.usrv.eu:8080/job/Tec%20Tech) GT additions EXTREME +# WIKI +https://github.com/JALGATeam/TecTechWiki/wiki + # Jenkins Builds -http://jenkins.usrv.de:8081/job/Tec%20Tech/ -https://jenkins.datamats.com/job/TecTech/ +http://jenkins.usrv.eu:8080/job/Tec%20Tech/ # Runtime Dependencies? -https://github.com/Technus/TecTech/blob/master/src/main/java/com/github/technus/tectech/TecTech.java#L30 +https://github.com/Technus/TecTech/blob/master/src/main/java/com/github/technus/tectech/TecTech.java#L37 - Required After diff --git a/build.gradle b/build.gradle index 414af8c300..6fccbe64e8 100644 --- a/build.gradle +++ b/build.gradle @@ -18,11 +18,12 @@ buildscript { import de.undercouch.gradle.tasks.download.Download apply plugin: 'forge' +apply plugin: 'signing' allprojects { apply plugin: 'java' - sourceCompatibility = 1.7 - targetCompatibility = 1.7 + sourceCompatibility = 1.8 + targetCompatibility = 1.8 } file "build.properties" withReader { @@ -52,20 +53,18 @@ configurations { repositories { maven { name 'UsrvDE' - url "http://jenkins.usrv.de:8082/nexus/content/repositories/releases/" + url "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" } maven { name = "ic2" url = "http://maven.ic2.player.to/" } - ivy { - name 'CoFHLib' - artifactPattern "http://addons-origin.cursecdn.com/files/${config.cofhlib.cf}/[module]-[revision].[ext]" - } - ivy { - name 'CoFHCore' - artifactPattern "http://addons-origin.cursecdn.com/files/${config.cofhcore.cf}/[module]-[revision].[ext]" + + ivy { + name 'gtnh_download_source' + artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]" } + maven { name = "chickenbones" url = "http://chickenbones.net/maven/" @@ -75,7 +74,7 @@ repositories { dependencies { compile "eu.usrv:YAMCore:${config.minecraft.version}-${config.yamcore.version}:deobf" compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" - provided name: 'CoFHLib', version: config.cofhlib.version, ext: 'jar' + //provided name: 'CoFHLib', version: config.cofhlib.version, ext: 'jar' provided name: 'CoFHCore', version: config.cofhcore.version, ext: 'jar' compile "codechicken:CodeChickenLib:${config.minecraft.version}-${config.codechickenlib.version}:dev" compile "codechicken:CodeChickenCore:${config.minecraft.version}-${config.codechickencore.version}:dev" @@ -86,7 +85,7 @@ task getGregTech(type: Download) { onlyIf { !file("libs/gregtech-${config.gregtech.version}-dev.jar").exists() } - src "http://jenkins.usrv.de:8081/job/Gregtech-5-Unofficial/${config.gregtech.jenkinsbuild}/artifact/build/libs/gregtech-${config.gregtech.version}-dev.jar" + 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" @@ -117,3 +116,18 @@ processResources 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 index c49614cadf..ff25af8631 100644 --- a/build.properties +++ b/build.properties @@ -1,16 +1,14 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614-1.7.10 -tectech.version=3.6.2 +tectech.version=3.6.8 ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=884 -gregtech.version=5.09.32.06 -cofhcore.cf=2246/920 -cofhcore.version=[1.7.10]3.0.3-303-dev -cofhlib.cf=2246/918 +gregtech.jenkinsbuild=223 +gregtech.version=5.09.33.06 +cofhcore.version=[1.7.10]3.1.4-329-dev cofhlib.version=[1.7.10]1.0.3-175-dev -yamcore.version=0.5.77 +yamcore.version=0.5.78 diff --git a/draw_io_graph.xml b/draw_io_graph.xml new file mode 100644 index 0000000000..b5eeb2c2fd --- /dev/null +++ b/draw_io_graph.xml @@ -0,0 +1 @@ +<mxfile userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36" version="8.7.3" editor="www.draw.io" type="device"><diagram id="0a0e746e-b74a-e6df-5b0f-cbfcf109565d" name="Page-1">7R1dk5s48rfkwVWTh7tCfPM440wyudrcZjMzu8m9ySDbXDD4MJ6P/fUngWSDJAO2BcbObNVmQDQy9He3Ws3IGC9ePqVwOf+SBCga6VrwMjI+jHQdmLqN/5CR12LEMbRiYJaGAQXaDtyHfyM6yMDWYYBWFcAsSaIsXFYH/SSOkZ9VxmCaJs9VsGkSVX91CWdIGLj3YSSO/hUG2bwYdXVnO36Hwtmc/TKwveLKBPo/Z2myjunvjXRjmv9XXF5ANhd90dUcBslzaci4HRnjNEmy4mjxMkYRwS1DW3Hfxx1XN8+dojhrdYNOnyN7Ze+OAowKepqk2TyZJTGMbrejN/n7ITKDhs/m2SLChwAfopcw+06G/2nRsx/sSpylr6VL5PQHneC/KMteKQ/AdZbgoe3v/pYkSzrHKkuTnxt6GHhEfFuKgFWyTn36PvQNM5jOEIUyiiHypqXbKIY+oWSB8ONhgBRFMAufqkwBKW/NNnBb/OIDimI5us2O0K0PG9/AUo3w/NbrNIWvJYBlEsbZqjTzVzKAAahecqjQUaXkcqLBQYNjoHWzCbwWHh8UL7flqg2WWjEaJcITjNZoowe0r8kzSgUOrPLX8zzM0P0S5uR8xuq9ynPTMIrGSZSk+b1GYCE3MDfMUrri6hPDtuuY5gmlGXqp5Qd61eSQRU+ft6oZsLF5SS0zo3OMxLqdSCwoiWtJQr/TO7biml87TGDJSABX8/w5QFvpNSTSC06lLl2je+Q73WC/tbqUIVw7FcINQW3gSbVxsliuM6I5tDFchfHs/FUIMHvUIaaAVZGt4+Ca+K34LE5iVI8wiNypL0OY7btoMq1DWCNLlfBhSdDBxvYz1E3WcoN5NkMhIPSmGjPq6g0TFWIlTHSARbXeiMgh36saZfdQGoKGidTR0H6jYS0NTVMRDYWJ1NHQeaNhLQ1tTRENhYnU0ZCp/xIRjaqfcbNeCWQdvpOhc1EdcHv0MpibXkKqXkXqn4hS7syx2qfvxmT0/OK/1hEIy86UQxCGzv5DEKuTmG9QGUkpwk+Wk7TNThBe4XC9yuKl8xOi3FaO8oOyklwsZGhurZnm05INeUk+51kFPzrPCDoS1xr9WMrYMObBDh9lHfcoVto/XSbjK8MbBF9xobFBH3UXo3DglteQwDZq4RUwVg9qicv9iYagwhCquOxgxjKVG+WDGIujvEFN1y5O4RmlQWHhuKMOXgFjjXg32czd5DiDYbw4TxfZ5G1In3HHW1alPiJ3bA7Lh0bkwkQKI/K3tEo9Eb2DU9SgYSKFRHTfiFhLRKCpSlKLM6kjI2OQEhn/wKd/rGGcrRf46FMEV9g+azdR4v98d4bmis/o9GqvDEcUigvL6MgWldkq5AkyOnYXCK8vejo8wXAwgtWHfW0RLFm2x5ZAu0uiCCt6lephOp3qvtQiBPbEtrrxZk27T2/W6kQ9sFhTzq3dZDTac7MpcrP6WLM1N4vlEk4eoIXRGfIyb+p6ZWa7I17uRvMeWkDlidxrD7Lg1G5KfRwFDrSGmlOnHv7ozAojRElwrRGXWdGugycYY+46SpLV2xi7z5pSy+1GLAe0xMXQWxZKSx+EUPIJRoffItFQqs3BHy02bOvIRStpGT/Y9jD4gUtQO1o9PxwHDrQGdmu64Wh+Y6QoqWlbUNMfQxSdXknzzlOvWpqpiQvOEzCNXNHSJwtj2dOUGBM/i5ZzWBYu0MnZkfMZnD6ru2z94n0GS+bIn2zviSV6s6T0QntAEVri18a/lsQnZ0leQ/bLk2LFISlC1D5gYY1XIeGKwSHI67N40JbspyHnjxHWZzBDvNkdln7rF1XisjwwalBVBJL+8CJJANouZvA18gehTVx8B2Yd2obp2PWLNKejtNiAbCnL9ZRtqXMyW+r0FeK2xWptKFzNvaskgKuaADtCTi7DAVru5Ng3cja5ULUhX8k/1p7gDKW74Pmn4eCPLxxjlbd9rgwNQW8AbRiF0qa3F/842lHgZkOexrZr4Y9mN0YJroXDQwrj1TRJF5JGDqs5XJJD9IIpdxMk60l+BQhsOMSaEJPviNGjQ+B2ItmDSvUw41+xR/rJHAJJ5DjSx1fGezx4/xxm/vyyubv1HjYV7A30nvZUKa2xYdxZ4diT7ZJiT8NxLB4aV7euXhLXWrwj2S/XdlQ31oW71Y6jJVVjnjMI32qzssKsr93gnLvHwRsN8KZdC3+8dyXtdLMR529ohWBKjJB2vyPTe1GCvdlV2Idge9b5yPWB3pYnsV3eMKIoXtKNho1+llcLf7Qkep3khoble7sSbjiZ7w1AR97gkJpQylAO1DeyU5I2M6z9EmH7wjftuORtrfIdl+YgSqpPt5dXKv/K/b7WkYy4SwzTe0xWjf61jv3Lc3b42Lv1biMlqSWxmv23xz/xwD/w/7/HEXlO0lIxIkt1E7KhK//BFVpM8msL6M/DmFxcpmiKUsmCZ1ZQpYTmKjrpPr8y7ukQjMJZjE99jFwcuxo3BKmhD6NremERBkEujTK6KiAN4JwLWdLPk1DGUkEZccX5P1+/UMpcbykQUfSjlKJfm2IcYsqsoyxkFPMTrGqSKEIpVvzjXGxXWfGA+BfjgnxPYULaWmlZKEkUnDMV+eBRQsbNiq9yARNXwDfyVQrj3mhWTzODiUMTzZSInrjb/PFuJ9H8vOcsIcKVP0cYAbmCJGL5/tejGyMT89UkgXt3ZBM9h8fbnWSDkVj9dcaI57cN2LYoMN3ZKrEY8fGzBPPPYUb+3H6peA5+CqdZ3rZZu1rH4WIZIVINhIJ37y+JQnw1gswKydw8vqvGQTktcbX28UsdgcaEJnlXxl+EOjqXAQZan6rLExccH78z+uSGA06SJyIsN48P+N+v15///e6d2FvhjAnA0gbbmjtZ0teVEEBFfSfLd4lR53jT3AIH4EQgyJy69gH9bzt2SeEon3vvNRz1xHUPRgaXkuIWhz4Y7/AXowpnPVrv01ahnYCmC9i8uCUR6vNXK8tOVpLqiSFIWR/d+zCOL43HhUSY16PmAawX0znw+AGNQBkrV/hb76bid+8VBz7D31DbyCtDDv74FQFNdMfKZsihUojlIAqD3PxcPQDRHe5IGqeuj+SdQSauZVpaN9LY2uIokUZttyNAuq18jqfr1aXpP5vDuNVrORM4o75j7VQekKk8oHxXf3sLc/lelBznrZsudlBMIGrykfExT3FsElD96BAEsBZxZDrEsx0DduRDtW5JoMaH6mgLyqA43JZpFeWOVGucGx2Vq+1XvaBYc8twbCjvEHlYgRqXp2pqg8Vv3NkXHmgNHVz4B+JvULCzTNJC2yjSLT58vSwFyqe/+lWgVifCXOOEgZHghJ3wowJAVhY3ELl3hA8uN8gx/xFJ1f3sgKyfdi6W9xmchFGfSdB+QlJeNlt3E1Hj3Ox2JTerZZekCXlXsl9sd9WVeR9Xsl/lp0uV3+lCJ32XeqmkvQgE++qytl7OUhggycrwWesdk/OwXEsiCXZXkmDs0jt/JelinkS9RbA9IZvrA9u6zY8aZF9+79ONQ1VVNKfLixliDXLB4NdxHM7DqNcNbqfxZDZdNHvicjGgu8rr4WgxI0Y/2el+c/fpwtEONEmVXHdoF8vkRrod5YgMn/DhjBziN4Rk7sJ/HzMIPHsJSHLfOvYxImAYh9nrPvcFMCPFFCEGTIr74IIQK56syJ8Z/ZrLNJykpACJgvuQEH7Hb+zgGR+mwd6c0c/aixCtmRLGkFV/Cc2LDuIMSdPbq7wYnJAC/yDM/DkiVIiT5/cjWkEZxss1CTiL0pdknVVO8btP8+9rbK6cP1U2e3N7ooroeeWIX4YYcXlpNyLfO3p4/PbtllTl3V3/+F1WlXcOmObrixzRHslq7xQhWm/J/qQccpJzeZxkuTOCzRZ5jXUcoVxNPRMdBYMA/4u5Pw9SSI39itbiM401SRVpqy50j8QV6JDJxZX2qiXRvjcaqS3I5VkC2+iXHJ18V7aaAXa623C+f2WStPNTN70IGguJgMORsO339yz+4yX8RIpaGlp8N9eGpoM8PKuVVve1WjFJ9KFwEG9gTHax0c02xYao0WaHQUjecqvYOY7vpVZHUAkSVt2pJYBd3ehkWC0DiQOK1fFpmmBzVyISRsL8SxIgAvF/</diagram></mxfile>
\ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar Binary files differindex b761216703..3baa851b28 100644 --- a/gradle/wrapper/gradle-wrapper.jar +++ b/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 678d9d8de3..e4af87c689 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jul 02 15:54:47 CDT 2014 +#Tue Dec 04 18:55:27 CET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip diff --git a/gregtech-5.09.32.06-dev-.jar b/gregtech-5.09.32.06-dev-.jar Binary files differnew file mode 100644 index 0000000000..e771833469 --- /dev/null +++ b/gregtech-5.09.32.06-dev-.jar diff --git a/gregtech-5.09.32pre3-1428.jar b/gregtech-5.09.32pre3-1428.jar Binary files differnew file mode 100644 index 0000000000..c436de0cd1 --- /dev/null +++ b/gregtech-5.09.32pre3-1428.jar diff --git a/libs/GT-PlusPlus-1.6.05-release-dev.jar b/libs/GT-PlusPlus-1.6.05-release-dev.jar Binary files differdeleted file mode 100644 index e1982f63a3..0000000000 --- a/libs/GT-PlusPlus-1.6.05-release-dev.jar +++ /dev/null diff --git a/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar Binary files differnew file mode 100644 index 0000000000..181475fc38 --- /dev/null +++ b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar diff --git a/libs/GTNewHorizonsCoreMod-1.7.10-1.5.10.jar b/libs/GTNewHorizonsCoreMod-1.7.10-1.5.10.jar Binary files differdeleted file mode 100644 index 45d7dc3183..0000000000 --- a/libs/GTNewHorizonsCoreMod-1.7.10-1.5.10.jar +++ /dev/null diff --git a/src/main/java/com/github/technus/tectech/CommonValues.java b/src/main/java/com/github/technus/tectech/CommonValues.java index 81c7dc3450..8ac6188b63 100644 --- a/src/main/java/com/github/technus/tectech/CommonValues.java +++ b/src/main/java/com/github/technus/tectech/CommonValues.java @@ -28,6 +28,12 @@ public final class CommonValues { // - in case some hatches are not in multiblock structure public static final byte MULTI_CHECK_AT = 12;// multiblock checks it's state public static final byte DISPERSE_AT = 14;// overflow hatches perform disperse + public static final byte TRANSFER_AT = 16; + + public static final long[] AatV = new long[]{268435455,67108863,16777215,4194303,1048575,262143,65535,16383,4095,1023,255,63,15,3,1,1}; + public static final String[] VOLTAGE_NAMES = new String[]{"Ultra Low Voltage", "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"}; + public static final String[] VN = new String[]{"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "UHV", "UEV", "UIV", "UMV", "UXV", "OpV", "MAX"}; + public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE - 7}; private CommonValues() {} } diff --git a/src/main/java/com/github/technus/tectech/auxiliary/Reference.java b/src/main/java/com/github/technus/tectech/Reference.java index 828974af05..6b5db0a519 100644 --- a/src/main/java/com/github/technus/tectech/auxiliary/Reference.java +++ b/src/main/java/com/github/technus/tectech/Reference.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.auxiliary; +package com.github.technus.tectech; public final class Reference { public static final String MODID = "tectech"; @@ -7,8 +7,11 @@ public final class Reference { public static final String COLLECTIONNAME = "TecTech"; public static final String CLIENTSIDE = "com.github.technus.tectech.proxy.ClientProxy"; public static final String SERVERSIDE = "com.github.technus.tectech.proxy.CommonProxy"; + public static final String COFHCORE = "CoFHCore"; public static final String THAUMCRAFT = "Thaumcraft"; + public static final String DREAMCRAFT = "dreamcraft"; + public static final String GTPLUSPLUS = "miscutils"; private Reference() {} } diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 9a4e803f67..6f1c4fc7a0 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -1,33 +1,23 @@ package com.github.technus.tectech; -import com.github.technus.tectech.auxiliary.Reference; -import com.github.technus.tectech.auxiliary.TecTechConfig; -import com.github.technus.tectech.elementalMatter.core.commands.ListEM; -import com.github.technus.tectech.elementalMatter.core.commands.GiveEM; import com.github.technus.tectech.loader.MainLoader; -import com.github.technus.tectech.loader.ModGuiHandler; +import com.github.technus.tectech.loader.TecTechConfig; +import com.github.technus.tectech.mechanics.ConvertFloat; +import com.github.technus.tectech.mechanics.ConvertInteger; +import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; +import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.proxy.CommonProxy; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.*; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameData; -import cpw.mods.fml.common.registry.GameRegistry; +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 eu.usrv.yamcore.auxiliary.IngameErrorLog; import eu.usrv.yamcore.auxiliary.LogHelper; -import gregtech.api.enums.Materials; -import gregtech.api.util.GT_Recipe; -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; - -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, dependencies = "required-after:Forge@[10.13.4.1614,);" + "required-after:YAMCore@[0.5.70,);" + "required-after:gregtech;" + "after:CoFHCore;" + "after:Thaumcraft;" + "after:dreamcraft;") @@ -38,159 +28,69 @@ public class TecTech { @Mod.Instance(Reference.MODID) public static TecTech instance; - public static final XSTR Rnd = XSTR.XSTR_INSTANCE; - public static final LogHelper Logger = new LogHelper(Reference.MODID); - private static IngameErrorLog Module_AdminErrorLogs; - public static MainLoader GTCustomLoader; - public static TecTechConfig ModConfig; - public static CreativeTabs mainTab; + public static final XSTR RANDOM = XSTR.XSTR_INSTANCE; + public static final LogHelper LOGGER = new LogHelper(Reference.MODID); + + private static IngameErrorLog moduleAdminErrorLogs; + public static TecTechConfig configTecTech; - public static boolean hasCOFH = false, hasThaumcraft = false; + /** + * For Loader.isModLoaded checks during the runtime + */ + public static boolean hasCOFH = false; public static final byte tectechTexturePage1=8; public static void AddLoginError(String pMessage) { - if (Module_AdminErrorLogs != null) { - Module_AdminErrorLogs.AddErrorLogOnAdminJoin(pMessage); + if (moduleAdminErrorLogs != null) { + moduleAdminErrorLogs.AddErrorLogOnAdminJoin(pMessage); } } + static { + MainLoader.staticLoad(); + } + @Mod.EventHandler public void PreLoad(FMLPreInitializationEvent PreEvent) { - Logger.setDebugOutput(true); + LOGGER.setDebugOutput(true); - ModConfig = new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME, + configTecTech = new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME, Reference.MODID); - if (!ModConfig.LoadConfig()) { - Logger.error(Reference.MODID + " could not load its config file. Things are going to be weird!"); + if (!configTecTech.LoadConfig()) { + LOGGER.error(Reference.MODID + " could not load its config file. Things are going to be weird!"); } - if (ModConfig.ModAdminErrorLogs_Enabled) { - Logger.debug("Module_AdminErrorLogs is enabled"); - Module_AdminErrorLogs = new IngameErrorLog(); + if (configTecTech.modAdminErrorLogs) { + LOGGER.setDebugOutput(DEBUG_MODE); + LOGGER.debug("moduleAdminErrorLogs is enabled"); + moduleAdminErrorLogs = new IngameErrorLog(); } - GTCustomLoader = new MainLoader(); - - Logger.info("Added Atom Overrider"); + MainLoader.preLoad(); } @Mod.EventHandler public void Load(FMLInitializationEvent event) { hasCOFH = Loader.isModLoaded(Reference.COFHCORE); - hasThaumcraft = Loader.isModLoaded(Reference.THAUMCRAFT); - GTCustomLoader.load(); - - - NetworkRegistry.INSTANCE.registerGuiHandler(instance, new ModGuiHandler()); - proxy.registerRenderInfo(); + MainLoader.load(); + MainLoader.addAfterGregTechPostLoadRunner(); } @Mod.EventHandler public void PostLoad(FMLPostInitializationEvent PostEvent) { - GTCustomLoader.postLoad(); - if (ModConfig.NERF_FUSION) { - FixBrokenFusionRecipes(); - } - fixBlocks(); + MainLoader.postLoad(); } @Mod.EventHandler public void serverLoad(FMLServerStartingEvent pEvent) { + pEvent.registerServerCommand(new ConvertInteger()); + pEvent.registerServerCommand(new ConvertFloat()); + pEvent.registerServerCommand(new ListEM()); if(DEBUG_MODE) { pEvent.registerServerCommand(new GiveEM()); - pEvent.registerServerCommand(new ListEM()); - } - } - - @Mod.EventHandler - public void onServerAboutToStart(FMLServerAboutToStartEvent ev) { - } - - private void FixBrokenFusionRecipes() { - HashMap<Fluid, Fluid> binds = new HashMap<>(); - for (Materials material : Materials.values()) { - FluidStack p = material.getPlasma(1); - if (p != null) { - if (DEBUG_MODE) { - Logger.info("Found Plasma of " + material.mName); - } - if (material.mElement != null && - (material.mElement.mProtons >= Materials.Iron.mElement.mProtons || - -material.mElement.mProtons >= Materials.Iron.mElement.mProtons || - material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons || - -material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons)) { - if (DEBUG_MODE) { - Logger.info("Attempting to bind " + material.mName); - } - if (material.getMolten(1) != null) { - binds.put(p.getFluid(), material.getMolten(1).getFluid()); - } else if (material.getGas(1) != null) { - binds.put(p.getFluid(), material.getGas(1).getFluid()); - } else if (material.getFluid(1) != null) { - binds.put(p.getFluid(), material.getFluid(1).getFluid()); - } else { - binds.put(p.getFluid(), Materials.Iron.getMolten(1).getFluid()); - } - } - } - } - for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList) { - Fluid fluid = binds.get(r.mFluidOutputs[0].getFluid()); - if (fluid != null) { - if (DEBUG_MODE) { - Logger.info("Nerfing Recipe " + r.mFluidOutputs[0].getUnlocalizedName()); - } - r.mFluidOutputs[0] = new FluidStack(fluid, r.mFluidInputs[0].amount); - } - } - } - - private void fixBlocks(){ - HashSet<String> modIDs=new HashSet<>(Arrays.asList( - "minecraft", - "IC2", - "gregtech", - "dreamcraft", - "miscutils", - "GT++DarkWorld", - "TwilightForest", - "GalacticraftCore", - "GalacticraftMars", - "GalaxySpace", - "extracells", - "Avaritia", - "avaritiaddons", - "EnderStorage", - "enhancedportals", - "DraconicEvolution", - "IC2NuclearControl", - "IronChest", - "opensecurity", - "openmodularturrets", - "Railcraft", - "RIO", - "SGCraft", - "appliedenergistics2", - "thaumicenergistics", - "witchery", - "lootgames", - Reference.MODID, - "utilityworlds" - )); - String modId; - for(Block block : GameData.getBlockRegistry().typeSafeIterable()) { - modId = GameRegistry.findUniqueIdentifierFor(block).modId; - if (modIDs.contains(modId)) {//Full Whitelisted Mods - continue; - } else if ("OpenBlocks".equals(modId)) { - if ("grave".equals(GameRegistry.findUniqueIdentifierFor(block).name)) { - continue; - } - } - block.setResistance(6); } } } diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 08e48471fc..1fd479939c 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -1,10 +1,12 @@ package com.github.technus.tectech; import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -19,6 +21,7 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.StringUtils; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; @@ -26,14 +29,15 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static gregtech.api.enums.GT_Values.E; /** * Created by Tec on 21.03.2017. */ public final class Util { - private Util() {} + private Util() { + } public static String intBitsToString(int number) { StringBuilder result = new StringBuilder(16); @@ -67,6 +71,8 @@ public final class Util { return result.toString(); } + //region junk + /* //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller //This only checks for REGULAR BLOCKS! public static boolean StructureChecker(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks @@ -170,13 +176,13 @@ public final class Util { //countable air -> net.minecraft.block.BlockAir if (world.getBlock(x, y, z) != blockType[pointer]) { if (DEBUG_MODE) { - TecTech.Logger.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + TecTech.LOGGER.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); } return false; } if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { if (DEBUG_MODE) { - TecTech.Logger.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]); + TecTech.LOGGER.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]); } return false; } @@ -219,8 +225,7 @@ public final class Util { IMetaTileEntity imt = aBaseMetaTileEntity.getMetaTileEntity(); int x, y, z, a, b, c, pointer; - int - baseX=aBaseMetaTileEntity.getXCoord(), + int baseX=aBaseMetaTileEntity.getXCoord(), baseZ=aBaseMetaTileEntity.getZCoord(), baseY=aBaseMetaTileEntity.getYCoord(); //a,b,c - relative to block face! @@ -305,13 +310,271 @@ public final class Util { //countable air -> net.minecraft.block.BlockAir if (world.getBlock(x, y, z) != blockType[pointer]) { if (DEBUG_MODE) { - TecTech.Logger.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + TecTech.LOGGER.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + } + return false; + } + if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]); + } + return false; + } + } else if ((pointer = block - ' ') >= 0) { + igt = aBaseMetaTileEntity.getIGregTechTileEntity(x, y, z); + try { + if (igt == null || !(boolean) adder.invoke(imt, addingMethods[pointer], igt, casingTextures[pointer])) { + if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); + } + return false; + } + if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]); + } + return false; + } + } + } catch (InvocationTargetException | IllegalAccessException e) { + if (DEBUG_MODE) { + e.printStackTrace(); + } + return false; + } + } + } + } else if (forceCheck) { + return false; + } + a++;//block in horizontal layer + } + } + b--;//horizontal layer + } + c++;//depth + } + return true; + } + */ + //endregion + + //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller + //This only checks for REGULAR BLOCKS! + public static boolean StructureCheckerExtreme( + String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks + Block[] blockType,//use numbers 0-9 for casing types + byte[] blockMeta,//use numbers 0-9 for casing types + Method adder, + String[] addingMethods, + short[] casingTextures, + Block[] blockTypeFallback,//use numbers 0-9 for casing types + byte[] blockMetaFallback,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + IGregTechTileEntity aBaseMetaTileEntity, + IFrontRotation frontRotation, + boolean forceCheck) { + World world = aBaseMetaTileEntity.getWorld(); + if (world.isRemote) { + return false; + } + //TE Rotation + int facingAndRotation = aBaseMetaTileEntity.getFrontFacing() + (frontRotation == null ? 0 : (frontRotation.getFrontRotation() << 3)); + + IGregTechTileEntity igt; + IMetaTileEntity imt = aBaseMetaTileEntity.getMetaTileEntity(); + + int x, y, z, a, b, c, pointer; + int baseX = aBaseMetaTileEntity.getXCoord(), + baseZ = aBaseMetaTileEntity.getZCoord(), + baseY = aBaseMetaTileEntity.getYCoord(); + //a,b,c - relative to block face! + //x,y,z - relative to block position on map! + //yPos - absolute height of checked block + + //perform your duties + c = -depthOffset; + for (String[] _structure : structure) {//front to back + b = verticalOffset; + for (String __structure : _structure) {//top to bottom + a = -horizontalOffset; + for (char block : __structure.toCharArray()) {//left to right + if (block < ' ') {//Control chars allow skipping + b -= block; + break; + } else if (block > '@') //characters allow to skip check A-1 skip, B-2 skips etc. + { + a += block - '@'; + }//else if (block < '+')//used to mark THINGS + // a++; + else if (block == '.') { + a++; + } else { + //get x y z from rotation + switch (facingAndRotation) {//translation + case 4: + x = baseX + c; + z = baseZ + a; + y = baseY + b; + break; + case 12: + x = baseX + c; + y = baseY - a; + z = baseZ + b; + break; + case 20: + x = baseX + c; + z = baseZ - a; + y = baseY - b; + break; + case 28: + x = baseX + c; + y = baseY + a; + z = baseZ - b; + break; + + case 3: + x = baseX + a; + z = baseZ - c; + y = baseY + b; + break; + case 11: + y = baseY - a; + z = baseZ - c; + x = baseX + b; + break; + case 19: + x = baseX - a; + z = baseZ - c; + y = baseY - b; + break; + case 27: + y = baseY + a; + z = baseZ - c; + x = baseX - b; + break; + + case 5: + x = baseX - c; + z = baseZ - a; + y = baseY + b; + break; + case 13: + x = baseX - c; + y = baseY - a; + z = baseZ - b; + break; + case 21: + x = baseX - c; + z = baseZ + a; + y = baseY - b; + break; + case 29: + x = baseX - c; + y = baseY + a; + z = baseZ + b; + break; + + case 2: + x = baseX - a; + z = baseZ + c; + y = baseY + b; + break; + case 10: + y = baseY - a; + z = baseZ + c; + x = baseX - b; + break; + case 18: + x = baseX + a; + z = baseZ + c; + y = baseY - b; + break; + case 26: + y = baseY + a; + z = baseZ + c; + x = baseX + b; + break; + //Things get odd if the block faces up or down... + case 1: + x = baseX + a; + z = baseZ - b; + y = baseY - c; + break;//similar to 3 + case 9: + z = baseZ + a; + x = baseX + b; + y = baseY - c; + break;//similar to 3 + case 17: + x = baseX - a; + z = baseZ + b; + y = baseY - c; + break;//similar to 3 + case 25: + z = baseZ - a; + x = baseX - b; + y = baseY - c; + break;//similar to 3 + + case 0: + x = baseX - a; + z = baseZ - b; + y = baseY + c; + break;//similar to 2 + case 8: + z = baseZ + a; + x = baseX - b; + y = baseY + c; + break; + case 16: + x = baseX + a; + z = baseZ + b; + y = baseY + c; + break; + case 24: + z = baseZ - a; + x = baseX + b; + y = baseY + c; + break; + default: + if (DEBUG_MODE) { + TecTech.LOGGER.info("facing = " + facingAndRotation); + } + return false; + } + + //that must be here since in some cases other axis (b,c) controls y + if (y < 0 || y >= 256) { + return false; + } + + //Check block + if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded at this pos + switch (block) { + case '-'://must be air + if (world.getBlock(x, y, z).getMaterial() != Material.air) { + return false; + } + break; + case '+'://must not be air + if (world.getBlock(x, y, z).getMaterial() == Material.air) { + return false; + } + break; + default://check for block (countable) + if ((pointer = block - '0') >= 0) { + //countable air -> net.minecraft.block.BlockAir + if (world.getBlock(x, y, z) != blockType[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); } return false; } if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { if (DEBUG_MODE) { - TecTech.Logger.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]); + TecTech.LOGGER.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]); } return false; } @@ -321,13 +584,13 @@ public final class Util { if (igt == null || !(boolean) adder.invoke(imt, addingMethods[pointer], igt, casingTextures[pointer])) { if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) { if (DEBUG_MODE) { - TecTech.Logger.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); + TecTech.LOGGER.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); } return false; } if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) { if (DEBUG_MODE) { - TecTech.Logger.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]); + TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]); } return false; } @@ -359,10 +622,22 @@ public final class Util { int horizontalOffset, int verticalOffset, int depthOffset, IGregTechTileEntity aBaseMetaTileEntity, boolean hintsOnly) { byte facing = aBaseMetaTileEntity.getFrontFacing(); - return StructureBuilder(structure,blockType,blockMeta, - horizontalOffset,verticalOffset,depthOffset, - aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()), - facing,hintsOnly); + return StructureBuilderExtreme(structure, blockType, blockMeta, + horizontalOffset, verticalOffset, depthOffset, + aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()), null, + facing, hintsOnly); + } + + public static boolean StructureBuilderExtreme(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks + Block[] blockType,//use numbers 0-9 for casing types + byte[] blockMeta,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + IGregTechTileEntity aBaseMetaTileEntity, IFrontRotation frontRotation, boolean hintsOnly) { + byte facing = aBaseMetaTileEntity.getFrontFacing(); + return StructureBuilderExtreme(structure, blockType, blockMeta, + horizontalOffset, verticalOffset, depthOffset, + aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()), frontRotation, + facing, hintsOnly); } public static boolean StructureBuilder(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks @@ -370,7 +645,15 @@ public final class Util { byte[] blockMeta,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset, TileEntity tileEntity, int facing, boolean hintsOnly) { - if(!tileEntity.hasWorldObj()) { + return StructureBuilderExtreme(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, tileEntity, null, facing, hintsOnly); + } + + public static boolean StructureBuilderExtreme(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks + Block[] blockType,//use numbers 0-9 for casing types + byte[] blockMeta,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + TileEntity tileEntity, IFrontRotation frontRotation, int facing, boolean hintsOnly) { + if (!tileEntity.hasWorldObj()) { return false; } World world = tileEntity.getWorldObj(); @@ -382,11 +665,14 @@ public final class Util { int x, y, z, a, b, c, pointer; int - baseX=tileEntity.xCoord, - baseZ=tileEntity.zCoord, - baseY=tileEntity.yCoord; + baseX = tileEntity.xCoord, + baseZ = tileEntity.zCoord, + baseY = tileEntity.yCoord; //a,b,c - relative to block face! //x,y,z - relative to block position on map! + if (frontRotation != null) { + facing += frontRotation.getFrontRotation() << 3; + } //perform your duties c = -depthOffset; @@ -398,49 +684,147 @@ public final class Util { if (block < ' ') {//Control chars allow skipping b -= block; break; - } if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc. + } + if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc. { a += block - '@'; }//else if (block < '+')//used to mark THINGS - // a++; - else if (block=='.')// this TE + // a++; + else if (block == '.')// this TE { a++; } else { //get x y z from rotation - switch (facing) {//translation + switch (facing) { case 4: x = baseX + c; z = baseZ + a; y = baseY + b; break; + case 12: + x = baseX + c; + y = baseY - a; + z = baseZ + b; + break; + case 20: + x = baseX + c; + z = baseZ - a; + y = baseY - b; + break; + case 28: + x = baseX + c; + y = baseY + a; + z = baseZ - b; + break; + case 3: x = baseX + a; z = baseZ - c; y = baseY + b; break; + case 11: + y = baseY - a; + z = baseZ - c; + x = baseX + b; + break; + case 19: + x = baseX - a; + z = baseZ - c; + y = baseY - b; + break; + case 27: + y = baseY + a; + z = baseZ - c; + x = baseX - b; + break; + case 5: x = baseX - c; z = baseZ - a; y = baseY + b; break; + case 13: + x = baseX - c; + y = baseY - a; + z = baseZ - b; + break; + case 21: + x = baseX - c; + z = baseZ + a; + y = baseY - b; + break; + case 29: + x = baseX - c; + y = baseY + a; + z = baseZ + b; + break; + case 2: x = baseX - a; z = baseZ + c; y = baseY + b; break; + case 10: + y = baseY - a; + z = baseZ + c; + x = baseX - b; + break; + case 18: + x = baseX + a; + z = baseZ + c; + y = baseY - b; + break; + case 26: + y = baseY + a; + z = baseZ + c; + x = baseX + b; + break; //Things get odd if the block faces up or down... case 1: x = baseX + a; + z = baseZ - b; + y = baseY - c; + break;//similar to 3 + case 9: + z = baseZ + a; + x = baseX + b; + y = baseY - c; + break;//similar to 3 + case 17: + x = baseX - a; z = baseZ + b; y = baseY - c; break;//similar to 3 + case 25: + z = baseZ - a; + x = baseX - b; + y = baseY - c; + break;//similar to 3 + case 0: x = baseX - a; z = baseZ - b; y = baseY + c; break;//similar to 2 + case 8: + z = baseZ + a; + x = baseX - b; + y = baseY + c; + break; + case 16: + x = baseX + a; + z = baseZ + b; + y = baseY + c; + break; + case 24: + z = baseZ - a; + x = baseX + b; + y = baseY + c; + break; default: + if (DEBUG_MODE) { + TecTech.LOGGER.info("facing = " + facing); + } return false; } @@ -451,49 +835,49 @@ public final class Util { //Check block if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded - if(hintsOnly){ + if (hintsOnly) { switch (block) { - case '-'://must be air - TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 13); - break; - case '+'://must not be air - TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 14); - break; - default: //check for block - if ((pointer = block - '0') >= 0) { - if(world.getBlock(x,y,z)!=blockType[pointer] || world.getBlockMetadata(x,y,z)!=blockMeta[pointer]) { - TecTech.proxy.hint_particle(world, x, y, z, blockType[pointer], blockMeta[pointer]); - } - } else if ((pointer = block - ' ') >= 0) { - if(pointer>=0 && pointer<12) { - TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); + case '-'://must be air + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 13); + break; + case '+'://must not be air + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 14); + break; + default: //check for block + if ((pointer = block - '0') >= 0) { + if (world.getBlock(x, y, z) != blockType[pointer] || world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { + TecTech.proxy.hint_particle(world, x, y, z, blockType[pointer], blockMeta[pointer]); + } + } else if ((pointer = block - ' ') >= 0) { + if (pointer >= 0 && pointer < 12) { + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); + } else { + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 12); + } } else { - TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 12); + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 15); } - } else { - TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 15); - } } - }else{ + } else { switch (block) { - case '-'://must be air - world.setBlock(x, y, z, Blocks.air, 0, 2); - break; - case '+'://must not be air - world.setBlock(x, y, z, TT_Container_Casings.sBlockCasingsTT, 14, 2); - break; - default: //check for block - if ((pointer = block - '0') >= 0) { - world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2); - } else if (block - ' ' < 0) { - world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15, 2); - } //else { + case '-'://must be air + world.setBlock(x, y, z, Blocks.air, 0, 2); + break; + case '+'://must not be air + world.setBlock(x, y, z, TT_Container_Casings.sBlockCasingsTT, 14, 2); + break; + default: //check for block + if ((pointer = block - '0') >= 0) { + world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2); + } else if (block - ' ' < 0) { + world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15, 2); + } //else { //switch(pointer){ // case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: // world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; // default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); //} - //} + //} } } } @@ -507,6 +891,7 @@ public final class Util { return true; } + public static String[] StructureWriter(IGregTechTileEntity aBaseMetaTileEntity, int horizontalOffset, int verticalOffset, int depthOffset, int horizontalSize, int verticalSize, int depthSize, boolean ignoreAir) { @@ -521,9 +906,9 @@ public final class Util { int x, y, z, a, b, c; int - baseX=aBaseMetaTileEntity.getXCoord(), - baseZ=aBaseMetaTileEntity.getZCoord(), - baseY=aBaseMetaTileEntity.getYCoord(); + baseX = aBaseMetaTileEntity.getXCoord(), + baseZ = aBaseMetaTileEntity.getZCoord(), + baseY = aBaseMetaTileEntity.getYCoord(); //a,b,c - relative to block face! //x,y,z - relative to block position on map! //yPos - absolute height of checked block @@ -702,7 +1087,7 @@ public final class Util { if (ignoreAir) { StringBuilder builder = new StringBuilder(); char temp = '@'; - for (char ch : line.toString().toCharArray()){ + for (char ch : line.toString().toCharArray()) { if (ch == '-') { temp += 1; if (temp == '~') { @@ -717,21 +1102,21 @@ public final class Util { builder.append(ch); } } - while (builder.length()>0 && builder.charAt(builder.length() - 1) == '~') { + while (builder.length() > 0 && builder.charAt(builder.length() - 1) == '~') { builder.deleteCharAt(builder.length() - 1); } - if (builder.length()==0) { + if (builder.length() == 0) { builder.append("E,"); } else { - builder.insert(0,'"'); + builder.insert(0, '"'); builder.append('"').append(','); } addMe.append(builder); } else { - if (line.length()==0) { + if (line.length() == 0) { line.append("E,"); } else { - line.insert(0,'"'); + line.insert(0, '"'); line.append('"').append(','); } addMe.append(line); @@ -740,11 +1125,11 @@ public final class Util { } //region less verbose addMe.append('}').append(','); - String builtStr=addMe.toString().replaceAll("(E,)+(?=})",E/*Remove Empty strings at end*/); + String builtStr = addMe.toString().replaceAll("(E,)+(?=})", E/*Remove Empty strings at end*/); Matcher matcher = matchE_.matcher(builtStr); while (matcher.find()) { - byte lenEE = (byte)(matcher.group(1).length()>>1); - builtStr=builtStr.replaceFirst("E,(E,)+","\"\\\\u00"+String.format("%02X", lenEE-1)+"\","); + byte lenEE = (byte) (matcher.group(1).length() >> 1); + builtStr = builtStr.replaceFirst("E,(E,)+", "\"\\\\u00" + String.format("%02X", lenEE - 1) + "\","); //builtStr=builtStr.replaceFirst("E,(E,)+\"","\"\\\\u00"+String.format("%02X", lenEE)); } //endregion @@ -869,32 +1254,28 @@ public final class Util { return GameRegistry.findUniqueIdentifierFor(is.getItem()).modId + ':' + is.getUnlocalizedName(); } - - public static final String[] VN = new String[]{"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "UHV", "UEV", "UIV", "UMV", "UXV", "OpV", "MAX"}; - public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE-7}; - public static byte getTier(long l) { byte b = -1; do { ++b; - if (b >= V.length) { + if (b >= CommonValues.V.length) { return b; } - } while(l > V[b]); + } while (l > CommonValues.V[b]); return b; } - public static String[] splitButDifferent(String string,String delimiter){ - String[] strings= new String[StringUtils.countMatches(string,delimiter)+1]; - int lastEnd=0; - for(int i=0;i<strings.length-1;i++){ - int nextEnd=string.indexOf(delimiter,lastEnd); - strings[i]=string.substring(lastEnd,nextEnd); - lastEnd=nextEnd+delimiter.length(); + public static String[] splitButDifferent(String string, String delimiter) { + String[] strings = new String[StringUtils.countMatches(string, delimiter) + 1]; + int lastEnd = 0; + for (int i = 0; i < strings.length - 1; i++) { + int nextEnd = string.indexOf(delimiter, lastEnd); + strings[i] = string.substring(lastEnd, nextEnd); + lastEnd = nextEnd + delimiter.length(); } - strings[strings.length-1]=string.substring(lastEnd); + strings[strings.length - 1] = string.substring(lastEnd); return strings; } @@ -906,41 +1287,42 @@ public final class Util { return strings; } - public static boolean areBitsSet(int setBits,int testedValue){ - return (testedValue&setBits)==setBits; + public static boolean areBitsSet(int setBits, int testedValue) { + return (testedValue & setBits) == setBits; } - public static class TT_ItemStack implements Comparable<TT_ItemStack>{ + public static class TT_ItemStack implements Comparable<TT_ItemStack> { public final Item mItem; public final int mStackSize; public final int mMetaData; public TT_ItemStack(Item aItem, long aStackSize, long aMetaData) { this.mItem = aItem; - this.mStackSize = (byte)((int)aStackSize); - this.mMetaData = (short)((int)aMetaData); + this.mStackSize = (byte) ((int) aStackSize); + this.mMetaData = (short) ((int) aMetaData); } public TT_ItemStack(ItemStack aStack) { - if(aStack==null){ - mItem=null; - mStackSize=mMetaData=0; - }else{ - mItem=aStack.getItem(); - mStackSize=aStack.stackSize; - mMetaData=Items.feather.getDamage(aStack); + if (aStack == null) { + mItem = null; + mStackSize = mMetaData = 0; + } else { + mItem = aStack.getItem(); + mStackSize = aStack.stackSize; + mMetaData = Items.feather.getDamage(aStack); } } @Override public int compareTo(TT_ItemStack o) { - if(mMetaData>o.mMetaData) return 1; - if(mMetaData<o.mMetaData) return -1; - if(mStackSize>o.mStackSize) return 1; - if(mStackSize<o.mStackSize) return -1; - if(mItem!=null && o.mItem!=null) return mItem.getUnlocalizedName().compareTo(o.mItem.getUnlocalizedName()); - if(mItem==null && o.mItem==null) return 0; - if(mItem!=null) return 1; + if (mMetaData > o.mMetaData) return 1; + if (mMetaData < o.mMetaData) return -1; + if (mStackSize > o.mStackSize) return 1; + if (mStackSize < o.mStackSize) return -1; + if (mItem != null && o.mItem != null) + return mItem.getUnlocalizedName().compareTo(o.mItem.getUnlocalizedName()); + if (mItem == null && o.mItem == null) return 0; + if (mItem != null) return 1; return -1; } @@ -948,19 +1330,29 @@ public final class Util { public boolean equals(Object aStack) { return aStack == this || (aStack instanceof TT_ItemStack && - ((mItem==((TT_ItemStack) aStack).mItem) || ((TT_ItemStack) aStack).mItem.getUnlocalizedName().equals(this.mItem.getUnlocalizedName())) && + ((mItem == ((TT_ItemStack) aStack).mItem) || ((TT_ItemStack) aStack).mItem.getUnlocalizedName().equals(this.mItem.getUnlocalizedName())) && ((TT_ItemStack) aStack).mStackSize == this.mStackSize && ((TT_ItemStack) aStack).mMetaData == this.mMetaData); } @Override public int hashCode() { - return (mItem!=null?mItem.getUnlocalizedName().hashCode():0) ^ (mMetaData << 16) ^ (mStackSize<<24); + return (mItem != null ? mItem.getUnlocalizedName().hashCode() : 0) ^ (mMetaData << 16) ^ (mStackSize << 24); } @Override public String toString() { - return Integer.toString(hashCode())+' '+(mItem==null?"null":mItem.getUnlocalizedName())+' '+mMetaData+' '+mStackSize; + return Integer.toString(hashCode()) + ' ' + (mItem == null ? "null" : mItem.getUnlocalizedName()) + ' ' + mMetaData + ' ' + mStackSize; + } + } + + public static void setTier(int tier,Object me){ + try{ + Field field=GT_MetaTileEntity_TieredMachineBlock.class.getField("mTier"); + field.setAccessible(true); + field.set(me,(byte)tier); + }catch (Exception e){ + e.printStackTrace(); } } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 6cb1b669e9..168c5ba090 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -3,11 +3,15 @@ package com.github.technus.tectech.compatibility.dreamcraft; import com.github.technus.tectech.recipe.TT_recipeAdder; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.item.ConstructableTriggerItem; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_Centrifuge; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_ElectromagneticSeparator; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; -import gregtech.api.enums.*; +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.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.init.Blocks; @@ -15,33 +19,69 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import java.lang.reflect.Method; + +import static com.github.technus.tectech.loader.recipe.RecipeLoader.getOrDefault; + /** * Created by Tec on 06.08.2017. */ public class DreamCraftRecipeLoader implements Runnable { + //region reflect a bit + private Class CUSTOM_ITEM_LIST; + private Method ADD_ASSEMBLER_RECIPE; + + private IItemContainer getItemContainer(String name) { + return (IItemContainer) Enum.valueOf(CUSTOM_ITEM_LIST, name); + } + + private void addAssemblerRecipeWithCleanroom(ItemStack[] items, FluidStack fluid, ItemStack output, int time, int eut) { + try { + ADD_ASSEMBLER_RECIPE.invoke(GT_Values.RA, items, fluid, output, time, eut, true); + } catch (Exception e) { + throw new Error(e); + } + } + //endregion + @Override public void run() { + //region reflect a bit + try { + CUSTOM_ITEM_LIST = Class.forName("com.dreammaster.gthandler.CustomItemList"); + ADD_ASSEMBLER_RECIPE = GT_Values.RA.getClass().getMethod("addAssemblerRecipe", ItemStack[].class, FluidStack.class, ItemStack.class, int.class, int.class, boolean.class); + } catch (Exception e) { + throw new Error(e); + } + //endregion + //Quantum Glass GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Containment.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L) - }, Materials.Trinium.getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); - - //BLUEprint - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ConstructableTriggerItem.INSTANCE, 1), - GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{Dyes.dyeBlue, OrePrefixes.plate.get(Materials.Paper), Dyes.dyeBlue, Dyes.dyeWhite}); + }, getOrDefault("Trinium",Materials.Osmium).getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); //region pipes //Data - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ ItemList.Circuit_Parts_GlassFiber.get(8), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8) - }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720, true); + }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720); //endregion + //Tunnel + addAssemblerRecipeWithCleanroom(new ItemStack[]{ + CustomItemList.DATApipe.get(1), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmiridium, 4), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 4), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 2), + ItemList.Field_Generator_MV.get(1), + ItemList.Circuit_Quantummainframe.get(1) + }, Materials.Osmium.getMolten(288), CustomItemList.EMpipe.get(1), 400, 500000); + + //endregoin //region casing @@ -69,22 +109,22 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 2), GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.StainlessSteel, 16), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 16), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 1) + GT_OreDictUnificator.get(OrePrefixes.wireGt01, getOrDefault("SuperconductorIV",Materials.Superconductor), 1) }, Materials.SolderingAlloy.getMolten(1296), CustomItemList.eM_Computer_Vent.get(1), 100, 1920); //Advanced Computer Casing - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 4) - }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1), 200, 122880, true); + GT_OreDictUnificator.get(OrePrefixes.wireGt02, getOrDefault("SuperconductorLuV",Materials.Superconductor), 4) + }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1), 200, 122880); //Molecular Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Power.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Trinium, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, getOrDefault("Trinium",Materials.Osmium), 12), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.TungstenSteel, 24), ItemList.Field_Generator_IV.get(1) @@ -97,10 +137,10 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Neutronium, 2), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, Materials.Plutonium, 4), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Lead, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 16), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Quantium, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium",Materials.Americium), 16), + GT_OreDictUnificator.get(OrePrefixes.screw, getOrDefault("Quantium",Materials.Neutronium), 16), }, new FluidStack[]{ - Materials.Trinium.getMolten(1296), + getOrDefault("Trinium",Materials.Osmium).getMolten(1296), Materials.Osmium.getMolten(1296), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), Materials.Argon.getGas(576), @@ -118,7 +158,7 @@ public class DreamCraftRecipeLoader implements Runnable { Materials.Glass.getMolten(2304), Materials.Silicone.getMolten(1872), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - Materials.Trinium.getMolten(1296), + getOrDefault("Trinium",Materials.Osmium).getMolten(1296), }, CustomItemList.eM_Coil.get(4), 800, 2000000); //endregion @@ -126,62 +166,74 @@ public class DreamCraftRecipeLoader implements Runnable { //region hatches - //Dynamo Hatches UV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_dynamomulti4_UV.get(1), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), CustomItemList.eM_dynamomulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_dynamomulti16_UV.get(1), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UHV_UV.get(1), CustomItemList.eM_dynamomulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_dynamomulti64_UV.get(1), 400, 122880); + //Dynamo Hatches IV-UIV + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Tungsten, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2)}, Materials.Silver.getMolten(144), CustomItemList.eM_dynamomulti4_IV.get(1), 100, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_LuV_IV.get(1), CustomItemList.eM_dynamomulti4_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Tungsten, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 4)}, Materials.Electrum.getMolten(144), CustomItemList.eM_dynamomulti16_IV.get(1), 200, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_LuV_IV").get(1), CustomItemList.eM_dynamomulti16_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Tungsten, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6)}, Materials.Tungsten.getMolten(144), CustomItemList.eM_dynamomulti64_IV.get(1), 400, 1920); + + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 2)}, Materials.Silver.getMolten(288), CustomItemList.eM_dynamomulti4_LuV.get(1), 100, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), CustomItemList.eM_dynamomulti4_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 4)}, Materials.Electrum.getMolten(288), CustomItemList.eM_dynamomulti16_LuV.get(1), 200, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_ZPM_LuV").get(1), CustomItemList.eM_dynamomulti16_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 6)}, Materials.Tungsten.getMolten(288), CustomItemList.eM_dynamomulti64_LuV.get(1), 400, 7680); + + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2)}, Materials.Silver.getMolten(576), CustomItemList.eM_dynamomulti4_ZPM.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), CustomItemList.eM_dynamomulti4_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4)}, Materials.Electrum.getMolten(576), CustomItemList.eM_dynamomulti16_ZPM.get(1), 200, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UV_ZPM").get(1), CustomItemList.eM_dynamomulti16_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 6)}, Materials.Tungsten.getMolten(576), CustomItemList.eM_dynamomulti64_ZPM.get(1), 400, 30720); + + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1152), CustomItemList.eM_dynamomulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), CustomItemList.eM_dynamomulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1152), CustomItemList.eM_dynamomulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UHV_UV").get(1), CustomItemList.eM_dynamomulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1152), CustomItemList.eM_dynamomulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_dynamomulti4_UHV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UEV_UHV.get(1), CustomItemList.eM_dynamomulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_dynamomulti16_UHV.get(1), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UEV_UHV.get(1), CustomItemList.eM_dynamomulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_dynamomulti64_UHV.get(1), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2304), CustomItemList.eM_dynamomulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UEV_UHV").get(1), CustomItemList.eM_dynamomulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2304), CustomItemList.eM_dynamomulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UEV_UHV").get(1), CustomItemList.eM_dynamomulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2304), CustomItemList.eM_dynamomulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_dynamomulti4_UEV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UIV_UEV.get(1), CustomItemList.eM_dynamomulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_dynamomulti16_UEV.get(1), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UIV_UEV.get(1), CustomItemList.eM_dynamomulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_dynamomulti64_UEV.get(1), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Dynamo_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 2)}, Materials.Silver.getMolten(4608), CustomItemList.eM_dynamomulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_dynamomulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_dynamomulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_dynamomulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_dynamomulti64_UEV.get(1), 400, 2000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamomulti4_UIV.get(1), 100, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_dynamomulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamomulti16_UIV.get(1), 200, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_dynamomulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_dynamomulti64_UIV.get(1), 400, 8000000); + //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamomulti4_UIV.get(1), 100, 8000000); + //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_dynamomulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamomulti16_UIV.get(1), 200, 8000000); + //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_dynamomulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_dynamomulti64_UIV.get(1), 400, 8000000); //Energy Hatches UV-UIV GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_energymulti4_UV.get(1), 100, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), CustomItemList.eM_energymulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_energymulti16_UV.get(1), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UHV_UV.get(1), CustomItemList.eM_energymulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_energymulti64_UV.get(1), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UHV_UV").get(1), CustomItemList.eM_energymulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_energymulti64_UV.get(1), 400, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_energymulti4_UHV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UEV_UHV.get(1), CustomItemList.eM_energymulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_energymulti16_UHV.get(1), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UEV_UHV.get(1), CustomItemList.eM_energymulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_energymulti64_UHV.get(1), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UEV_UHV").get(1), CustomItemList.eM_energymulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_energymulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UEV_UHV").get(1), CustomItemList.eM_energymulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_energymulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_energymulti4_UEV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UIV_UEV.get(1), CustomItemList.eM_energymulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_energymulti16_UEV.get(1), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UIV_UEV.get(1), CustomItemList.eM_energymulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Energy_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_energymulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_energymulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_energymulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_energymulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium),6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energymulti4_UIV.get(1), 100, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_energymulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energymulti16_UIV.get(1), 200, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_energymulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energymulti64_UIV.get(1), 400, 8000000); + //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energymulti4_UIV.get(1), 100, 8000000); + //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_energymulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energymulti16_UIV.get(1), 200, 8000000); + //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_energymulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energymulti64_UIV.get(1), 400, 8000000); //Data Input - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), ItemList.Hatch_Input_Bus_LuV.get(1), ItemList.Circuit_Crystalcomputer.get(1), CustomItemList.DATApipe.get(2) - }, Materials.Iridium.getMolten(1296), CustomItemList.dataIn_Hatch.get(1), 200, 122880, true); + }, Materials.Iridium.getMolten(1296), CustomItemList.dataIn_Hatch.get(1), 200, 122880); //Data Output - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), ItemList.Hatch_Output_Bus_LuV.get(1), ItemList.Circuit_Crystalcomputer.get(1), CustomItemList.DATApipe.get(2) - }, Materials.Iridium.getMolten(1296), CustomItemList.dataOut_Hatch.get(1), 200, 122880, true); + }, Materials.Iridium.getMolten(1296), CustomItemList.dataOut_Hatch.get(1), 200, 122880); //Rack - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Bus.get(1), ItemList.Hatch_Input_Bus_ZPM.get(1), ItemList.Circuit_Crystalcomputer.get(2), CustomItemList.DATApipe.get(4) - }, Materials.Iridium.getMolten(1296), CustomItemList.rack_Hatch.get(1), 800, 122880, true); + }, Materials.Iridium.getMolten(1296), CustomItemList.rack_Hatch.get(1), 800, 122880); //Object Holder GT_Values.RA.addAssemblylineRecipe(ItemList.Hatch_Input_Bus_ZPM.get(1), 10000, new ItemStack[]{ @@ -209,35 +261,35 @@ public class DreamCraftRecipeLoader implements Runnable { new ItemStack(Blocks.stone_button, 16), }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1), 800, 122880); //Uncertainty - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), ItemList.Circuit_Ultimatecrystalcomputer.get(1), CustomItemList.DATApipe.get(16), ItemList.Cover_Screen.get(1 ), new ItemStack(Blocks.stone_button, 16), - }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880, true); + }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880); //Elemental Input - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Containment.get(1), ItemList.Hatch_Input_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), ItemList.Sensor_UV.get(1) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_in_UV.get(1), 800, 500000, true); + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_in_UV.get(1), 800, 500000); //Elemental Output - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Containment.get(1), ItemList.Hatch_Output_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), ItemList.Emitter_UV.get(1) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_out_UV.get(1), 800, 500000, true); + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_out_UV.get(1), 800, 500000); //Overflow - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Containment.get(1), ItemList.Hatch_Muffler_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Naquadah, 1), ItemList.Field_Generator_UV.get(1) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1), 800, 500000, true); + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1), 800, 500000); //endregion @@ -255,16 +307,16 @@ public class DreamCraftRecipeLoader implements Runnable { //Active Transformer GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - com.dreammaster.gthandler.CustomItemList.WetTransformer_ZPM_LuV.get(1), - com.dreammaster.gthandler.CustomItemList.HighEnergyFlowCircuit.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 16), - ItemList.Circuit_Chip_UHPIC.get(2), + getItemContainer("WetTransformer_ZPM_LuV").get(1), + getItemContainer("HighEnergyFlowCircuit").get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, getOrDefault("SuperconductorLuV",Materials.Superconductor), 16), + ItemList.valueOf("Circuit_Chip_UHPIC").get(2), }, Materials.TungstenSteel.getMolten(576), CustomItemList.Machine_Multi_Transformer.get(1), 400, 30720); //Network Switch GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), - ItemList.Circuit_Ultimatecrystalcomputer.get(1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 4), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 64), CustomItemList.DATApipe.get(4), @@ -276,7 +328,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), ItemList.Tool_DataOrb.get(1), ItemList.Cover_Screen.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUV, 8), CustomItemList.DATApipe.get(8), }, new FluidStack[]{ Materials.UUMatter.getFluid(1000), @@ -286,7 +338,7 @@ public class DreamCraftRecipeLoader implements Runnable { }, CustomItemList.Machine_Multi_Computer.get(1), 12000, 100000); //Research Station - GT_Values.RA.addAssemblylineRecipe(com.dreammaster.gthandler.CustomItemList.ScannerZPM.get(1), 80000, new ItemStack[]{ + GT_Values.RA.addAssemblylineRecipe(getItemContainer("ScannerZPM").get(1), 80000, new ItemStack[]{ CustomItemList.Machine_Multi_Switch.get(1), ItemList.Sensor_ZPM.get(8), ItemList.Circuit_Crystalmainframe.get(4), @@ -385,8 +437,8 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.eM_Computer_Bus.get(4), ItemList.Field_Generator_UV.get(4), ItemList.Sensor_UV.get(4), - com.dreammaster.gthandler.CustomItemList.NanoCircuit.get(4), - com.dreammaster.gthandler.CustomItemList.MysteriousCrystalLens.get(4), + getItemContainer("NanoCircuit").get(4), + getItemContainer("MysteriousCrystalLens").get(4), GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Draconium, 4), }, new FluidStack[]{ Materials.UUMatter.getFluid(2000), @@ -401,12 +453,528 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.Machine_Multi_Transformer.get(1), CustomItemList.eM_Coil.get(8), CustomItemList.eM_Power.get( 8), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neodymium, 16), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.NeodymiumMagnetic, 16), }, new FluidStack[]{ Materials.Electrum.getMolten(2592), Materials.Neutronium.getMolten(1872), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), }, CustomItemList.Machine_Multi_Infuser.get(1), 8000, 2000000); + + //Motor UV-UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Motor_UV.get(1L), + 24000, 32, 100000, 4, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SamariumMagnetic, 4L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 32L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Motor_UHV.get(1L), 1000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Motor_UHV.get(1L), + 48000, 64, 2000000, 8, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SamariumMagnetic, 8L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 16L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 32L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L),//TODO Fusion T4 Material + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Motor_UEV.get(1L), 2000, 800000); + + //Pumps UV-UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Pump_UV.get(1L), + 24000, 32, 100000, 4, new ItemStack[]{ + ItemList.Electric_Motor_UHV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Neutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 4L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.CosmicNeutronium, 16L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnySyntheticRubber, 32L), + GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.CosmicNeutronium, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Pump_UHV.get(1, new Object[]{}), 1000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Pump_UHV.get(1L), + 48000, 64, 200000, 8, new ItemStack[]{ + ItemList.Electric_Motor_UEV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.NetherStar, 2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 4L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Infinity, 16L), + GT_OreDictUnificator.get(OrePrefixes.ring, (Materials.AnySyntheticRubber), 64L), + GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Infinity, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Pump_UEV.get(1, new Object[]{}), 2000, 800000); + + //Conveyor Belt UV-UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UV.get(1L), + 24000, 32, 100000, 4, new ItemStack[]{ + ItemList.Electric_Motor_UHV.get(2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000), + Materials.Silicone.getMolten(5760)}, ItemList.Conveyor_Module_UHV.get(1, new Object[]{}), 1000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UHV.get(1L), + 48000, 64, 200000, 8, new ItemStack[]{ + ItemList.Electric_Motor_UEV.get(2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 2L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000), + Materials.Silicone.getMolten(11520)}, ItemList.Conveyor_Module_UEV.get(1, new Object[]{}), 2000, 800000); + + //Piston UV-UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Piston_UV.get(1L), + 24000, 32, 100000, 4, new ItemStack[]{ + ItemList.Electric_Motor_UHV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 6L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.CosmicNeutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.CosmicNeutronium, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 4L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Piston_UHV.get(1, new Object[]{}), 1000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Piston_UHV.get(1L), + 48000, 64, 200000, 8, new ItemStack[]{ + ItemList.Electric_Motor_UEV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 6L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 64L), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.Infinity, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Infinity, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 4L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Piston_UEV.get(1, new Object[]{}), 2000, 800000); + + //Robot Arm UV-UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Robot_Arm_UV.get(1L), + 24000, 32, 100000, 4, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.CosmicNeutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.CosmicNeutronium, 6L), + ItemList.Electric_Motor_UHV.get(2L), + ItemList.Electric_Piston_UHV.get(1L), + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 2L}, + new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 4L}, + new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 8L}, + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 6L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(4608), + Materials.Lubricant.getFluid(4000)}, ItemList.Robot_Arm_UHV.get(1L), 1000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Robot_Arm_UHV.get(1L), + 48000, 64, 200000, 8, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.Infinity, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Infinity, 6L), + ItemList.Electric_Motor_UEV.get(2L), + ItemList.Electric_Piston_UEV.get(1L), + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 2L}, + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 4L}, + new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 8L}, + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 6L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(9216), + Materials.Lubricant.getFluid(8000)}, ItemList.Robot_Arm_UEV.get(1L), 2000, 800000); + + //Emitter UV-UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Emitter_UV.get(1L), + 24000, 32, 100000, 4, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L), + ItemList.Electric_Motor_UHV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.CosmicNeutronium, 8L), + ItemList.Gravistar.get(8L), + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 4L}, + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 7L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(4608)}, + ItemList.Emitter_UHV.get(1L), 1000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Emitter_UHV.get(1L), + 48000, 64, 200000, 8, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Infinity, 1L), + ItemList.Electric_Motor_UEV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Infinity, 16L), + ItemList.Gravistar.get(16L), + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 4L}, + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 7L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(9216)}, + ItemList.Emitter_UEV.get(1L), 2000, 800000); + + //Sensor UV-UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Sensor_UV.get(1L), + 24000, 32, 100000, 4, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L), + ItemList.Electric_Motor_UHV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 8L), + ItemList.Gravistar.get(8L), + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 4L}, + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.ElectrumFlux, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 7L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(4608)}, + ItemList.Sensor_UHV.get(1L), 1000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Sensor_UHV.get(1L), + 48000, 64, 200000, 8, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Infinity, 1L), + ItemList.Electric_Motor_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 8L), + ItemList.Gravistar.get(16), + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 4L}, + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.InfinityCatalyst, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 7L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(9216)}, + ItemList.Sensor_UEV.get(1L), 2000, 800000); + + //Fieldgen UV and UHV + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Field_Generator_UV.get(1), + 48000, 64, 200000, 8, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 6L), + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 4L}, + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 8L)}, + new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(4608)}, + ItemList.Field_Generator_UHV.get(1L), 2000, 200000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Field_Generator_UHV.get(1L), + 96000, 128, 400000, 16, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Infinity, 1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 6L), + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 8L}, + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 8L)}, + new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(9216)}, + ItemList.Field_Generator_UEV.get(1L), 4000, 800000); + + //UHV Energy Hatch + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Energy_UV.get(1L), + 24000, 16, 50000, 2, new Object[]{ + ItemList.Hull_MAX.get(1L), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUHV, 2L), + ItemList.Circuit_Chip_QPIC.get(2L), + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 2L}, + ItemList.UHV_Coil.get(2L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Electric_Pump_UHV.get(1L)}, + new FluidStack[]{ + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000), + Materials.SolderingAlloy.getMolten(5760), + }, ItemList.Hatch_Energy_MAX.get(1L), 1000, 2000000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Dynamo_UV.get(1L), + 48000, 32, 100000, 4, new Object[]{ + ItemList.Hull_MAX.get(1L), + GT_OreDictUnificator.get(OrePrefixes.spring, Materials.Longasssuperconductornameforuhvwire, 8L), + ItemList.Circuit_Chip_QPIC.get(2L), + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 2L}, + ItemList.UHV_Coil.get(2L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Reactor_Coolant_He_6.get(1L), + ItemList.Electric_Pump_UHV.get(1L)}, + new FluidStack[]{ + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000), + Materials.SolderingAlloy.getMolten(5760)}, + ItemList.Hatch_Dynamo_MAX.get(1L), 1000, 2000000); + + //UHV Circuit + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Wetwaresupercomputer.get(1L), + 24000, 64, 50000, 4, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 2), + ItemList.Circuit_Wetwaresupercomputer.get(2L), + ItemList.ZPM_Coil.get(16L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Chip_Ram.get(48L), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorZPM, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, (Materials.AnySyntheticRubber), 64L), + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(2880L), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 10000), + Materials.Radon.getGas(2500L), + }, ItemList.Circuit_Wetwaremainframe.get(1L), 2000, 300000); + + //Bio Chips + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biowarecomputer.get(1L), + 48000, 128, 500000, 8, new ItemStack[]{ + ItemList.Circuit_Board_Bio_Ultra.get(2L), + ItemList.Circuit_Biowarecomputer.get(2L), + ItemList.Circuit_Parts_DiodeSMD.get(48L), + ItemList.Circuit_Parts_ResistorSMD.get(16L), + ItemList.Circuit_Parts_TransistorSMD.get(16L), + ItemList.Circuit_Parts_DiodeSMD.get(16L), + ItemList.Circuit_Chip_NOR.get(32L), + ItemList.Circuit_Chip_Ram.get(64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 32L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 16L), + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440L), + Materials.BioMediumSterilized.getFluid(1440L), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 10000) + }, + ItemList.Circuit_Biowaresupercomputer.get(1L), 4000, 500000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biowaresupercomputer.get(1L), + 96000, 256, 1000000, 16, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 4L), + ItemList.Circuit_Biowaresupercomputer.get(2L), + ItemList.Circuit_Parts_Coil.get(64L), + ItemList.Circuit_Parts_Coil.get(64L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Chip_Ram.get(64L), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Polybenzimidazole, 64) + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(2880L), + Materials.BioMediumSterilized.getFluid(2880L), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 20000) + }, ItemList.Circuit_Biomainframe.get(1L), 6000, 2000000); + + //GTNH Circuits + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biomainframe.get(1L), + 192000, 512, 2000000, 32, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 8), + ItemList.Circuit_Biomainframe.get(2L), + ItemList.UHV_Coil.get(32L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Chip_Ram.get(64L), + ItemList.Circuit_Chip_NPIC.get(64L), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Polybenzimidazole, 64) + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760L), + Materials.Naquadria.getMolten(4032L), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 20000) + }, getItemContainer("NanoCircuit").get(1L), 8000, 8000000); + + + TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("PicoWafer").get(1), + 384000, 1024, 4000000, 64, new ItemStack[]{ + ItemList.Circuit_Board_Bio_Ultra.get(1L), + getItemContainer("PicoWafer").get(4L), + getItemContainer("NanoCircuit").get(2L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Chip_PPIC.get(64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 16), + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Osmium, 32), + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Neutronium, 16), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Lanthanum, 64) + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760L), + Materials.UUMatter.getFluid(8000L), + Materials.Osmium.getMolten(1152L) + }, getItemContainer("PikoCircuit").get(1L), 10000, 8000000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("PikoCircuit").get(1L), + 720000, 2048, 8000000, 128, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.Neutronium, 16), + getItemContainer("PikoCircuit").get(8L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Chip_QPIC.get(64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 64), + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Indium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 8), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Lanthanum, 64) + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760L), + Materials.UUMatter.getFluid(24000L), + Materials.Osmium.getMolten(2304L) + }, getItemContainer("QuantumCircuit").get(1L), 20000, 32000000); + + //Stargate Stuff + if (Loader.isModLoaded("eternalsingularity")&&Loader.isModLoaded("SGCraft")) { + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Infinity, 1L), + 192000, 512, 2000000, 32, new ItemStack[]{ + GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L), + ItemList.Sensor_UV.get(16L), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 16L), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.CosmicNeutronium, 16L), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.NaquadahAlloy, 64L), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.NaquadahAlloy, 64L), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.NaquadahAlloy, 64L), + getItemContainer("NanoCircuit").get(1L).splitStack(16) + }, + new FluidStack[]{ + Materials.Neutronium.getMolten(36864L), + Materials.Tritanium.getMolten(36864L), + Materials.Tetranaquadahdiindiumhexaplatiumosminid.getMolten(36864L), + Materials.Silver.getPlasma(36864L) + }, + getItemContainer("StargateShieldingFoil").get(1L), 72000, 2000000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("StargateShieldingFoil").get(1L), + 192000, 512, 2000000, 32, new ItemStack[]{ + ItemList.Electric_Piston_UV.get(16L), + ItemList.Electric_Motor_UV.get(64L), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 16L), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.NaquadahAlloy, 64L), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Ardite, 8L), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Ardite, 8L), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Ardite, 8L), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Ardite, 8L), + GT_OreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Ruby, 64L), + GT_OreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Jasper, 64L), + getItemContainer("NanoCircuit").get(1L).splitStack(32) + }, + new FluidStack[]{ + Materials.Neutronium.getMolten(9216L), + Materials.Tritanium.getMolten(9216L), + Materials.Tetranaquadahdiindiumhexaplatiumosminid.getMolten(9216L), + Materials.Silver.getPlasma(9216L) + }, + getItemContainer("StargateChevron").get(1L), 72000, 2000000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 1L), + 192000, 512, 2000000, 32, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 64L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.NaquadahAlloy, 64L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmiridium, 64L) + }, + new FluidStack[]{ + Materials.Neutronium.getMolten(73728L), + Materials.Tritanium.getMolten(73728L), + Materials.Concrete.getMolten(73728L) + }, + getItemContainer("StargateFramePart").get(1L), 72000, 2000000); + + //Batteries + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Energy_Cluster.get(1L),12000,16,100000,3,new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Tritanium, 64L), + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, + ItemList.Energy_Cluster.get(8L, new Object[0]), + ItemList.Field_Generator_UV.get(2), + ItemList.Circuit_Wafer_HPIC.get(64), + ItemList.Circuit_Wafer_HPIC.get(64), + ItemList.Circuit_Parts_DiodeSMD.get(64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 32), + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(2880), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000) + }, ItemList.ZPM2.get(1), 3000, 400000); + + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.ZPM2.get(1L),24000,64,200000,6,new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 64L), + new Object[]{OrePrefixes.circuit, Materials.Bio, 1L}, + new Object[]{OrePrefixes.circuit, Materials.Bio, 1L}, + new Object[]{OrePrefixes.circuit, Materials.Bio, 1L}, + new Object[]{OrePrefixes.circuit, Materials.Bio, 1L}, + ItemList.ZPM2.get(8), + ItemList.Field_Generator_UHV.get(4), + ItemList.Circuit_Wafer_UHPIC.get(64), + ItemList.Circuit_Wafer_UHPIC.get(64), + ItemList.Circuit_Wafer_SoC2.get(32), + ItemList.Circuit_Parts_DiodeSMD.get(64), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Neutronium, 64), + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760), + Materials.Naquadria.getMolten(9000), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 32000) + }, ItemList.ZPM3.get(1), 4000, 1600000); + } //endregion register_machine_EM_behaviours(); @@ -414,21 +982,21 @@ public class DreamCraftRecipeLoader implements Runnable { private void register_machine_EM_behaviours(){ GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(6),com.dreammaster.gthandler.CustomItemList.CentrifugeLuV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(7),com.dreammaster.gthandler.CustomItemList.CentrifugeZPM.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(8),com.dreammaster.gthandler.CustomItemList.CentrifugeUV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(9),com.dreammaster.gthandler.CustomItemList.CentrifugeUHV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(10),com.dreammaster.gthandler.CustomItemList.CentrifugeUEV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(11),com.dreammaster.gthandler.CustomItemList.CentrifugeUIV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(12),com.dreammaster.gthandler.CustomItemList.CentrifugeUMV.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(6),getItemContainer("CentrifugeLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(7),getItemContainer("CentrifugeZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(8),getItemContainer("CentrifugeUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(9),getItemContainer("CentrifugeUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(10),getItemContainer("CentrifugeUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(11),getItemContainer("CentrifugeUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(12),getItemContainer("CentrifugeUMV").get(1)); GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(6),com.dreammaster.gthandler.CustomItemList.ElectromagneticSeparatorLuV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(7),com.dreammaster.gthandler.CustomItemList.ElectromagneticSeparatorZPM.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(8),com.dreammaster.gthandler.CustomItemList.ElectromagneticSeparatorUV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(9),com.dreammaster.gthandler.CustomItemList.ElectromagneticSeparatorUHV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(10),com.dreammaster.gthandler.CustomItemList.ElectromagneticSeparatorUEV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(11),com.dreammaster.gthandler.CustomItemList.ElectromagneticSeparatorUIV.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(12),com.dreammaster.gthandler.CustomItemList.ElectromagneticSeparatorUMV.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(6),getItemContainer("ElectromagneticSeparatorLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(7),getItemContainer("ElectromagneticSeparatorZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(8),getItemContainer("ElectromagneticSeparatorUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(9),getItemContainer("ElectromagneticSeparatorUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(10),getItemContainer("ElectromagneticSeparatorUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(11),getItemContainer("ElectromagneticSeparatorUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(12),getItemContainer("ElectromagneticSeparatorUMV").get(1)); } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java new file mode 100644 index 0000000000..53a64a52ae --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java @@ -0,0 +1,283 @@ +package com.github.technus.tectech.compatibility.dreamcraft; + +import com.github.technus.tectech.Reference; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.CustomItemList; +import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_WetTransformer; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; +import net.minecraft.util.EnumChatFormatting; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +import static gregtech.api.GregTech_API.METATILEENTITIES; + +public class NoDreamCraftMachineLoader implements Runnable { + public final static String imagination=EnumChatFormatting.RESET + + "You just need " + EnumChatFormatting.DARK_PURPLE + + "I" + EnumChatFormatting.LIGHT_PURPLE + + "m" + EnumChatFormatting.DARK_RED + + "a" + EnumChatFormatting.RED + + "g" + EnumChatFormatting.YELLOW + + "i" + EnumChatFormatting.GREEN + + "n" + EnumChatFormatting.AQUA + + "a" + EnumChatFormatting.DARK_AQUA + + "t" + EnumChatFormatting.BLUE + + "i" + EnumChatFormatting.DARK_BLUE + + "o" + EnumChatFormatting.DARK_PURPLE + + "n" + EnumChatFormatting.RESET + + " to use this."; + + @Override + public void run() { + try { + CustomItemList.WetTransformer_LV_ULV.set(new GT_MetaTileEntity_WetTransformer( + 12000, "wettransformer.tier.00", "Ultra Low Voltage Power Transformer", 0, + "LV -> ULV (Use Soft Mallet to invert)").getStackForm(1L)); + }catch (IllegalArgumentException e){ + System.out.println(METATILEENTITIES[12000].getClass().getCanonicalName()); + TecTech.LOGGER.error(e); + e.printStackTrace(); + throw new Error(METATILEENTITIES[12000].getClass().getCanonicalName(),e); + } + + CustomItemList.WetTransformer_MV_LV.set(new GT_MetaTileEntity_WetTransformer( + 12001, "wetransformer.tier.01", "Low Voltage Power Transformer", 1, + "MV -> LV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_HV_MV.set(new GT_MetaTileEntity_WetTransformer( + 12002, "wettransformer.tier.02", "Medium Voltage Power Transformer", 2, + "HV -> MV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_EV_HV.set(new GT_MetaTileEntity_WetTransformer( + 12003, "wettransformer.tier.03", "High Voltage Power Transformer", 3, + "EV -> HV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_IV_EV.set(new GT_MetaTileEntity_WetTransformer( + 12004, "wettransformer.tier.04", "Extreme Power Transformer", 4, + "IV -> EV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_LuV_IV.set(new GT_MetaTileEntity_WetTransformer( + 12005, "wettransformer.tier.05", "Insane Power Transformer", 5, + "LuV -> IV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_ZPM_LuV.set(new GT_MetaTileEntity_WetTransformer( + 12006, "wettransformer.tier.06", "Ludicrous Power Transformer", 6, + "ZPM -> LuV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_UV_ZPM.set(new GT_MetaTileEntity_WetTransformer( + 12007, "wettransformer.tier.07", "ZPM Voltage Power Transformer", 7, + "UV -> ZPM (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_UHV_UV.set(new GT_MetaTileEntity_WetTransformer( + 12008, "wettransformer.tier.08", "Ultimate Power Transformer", 8, + "UHV -> UV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_UEV_UHV.set(new GT_MetaTileEntity_WetTransformer( + 12009, "wettransformer.tier.09", "Highly Ultimate Power Transformer", 9, + "UEV -> UHV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_UIV_UEV.set(new GT_MetaTileEntity_WetTransformer( + 12010, "wettransformer.tier.10", "Extremely Ultimate Power Transformer", 10, + "UIV -> UEV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_UMV_UIV.set(new GT_MetaTileEntity_WetTransformer( + 12011, "wettransformer.tier.11", "Insanely Ultimate Power Transformer", 11, + "UMV -> UIV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_UXV_UMV.set(new GT_MetaTileEntity_WetTransformer( + 12012, "wettransformer.tier.12", "Mega Ultimate Power Transformer", 12, + "UXV -> UMV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_OPV_UXV.set(new GT_MetaTileEntity_WetTransformer( + 12013, "wettransformer.tier.13", "Extended Mega Ultimate Power Transformer", 13, + "OPV -> UXV (Use Soft Mallet to invert)").getStackForm(1L)); + + CustomItemList.WetTransformer_MAXV_OPV.set(new GT_MetaTileEntity_WetTransformer( + 12014, "wettransformer.tier.14", "Overpowered Power Transformer", 14, + "MAX -> OPV (Use Soft Mallet to invert)").getStackForm(1L)); + + try { + MetaTileEntity temp; + Method method = null; + Field field = null; + Object iTexture = new ITexture[0]; + if (GT_Values.GT.isClientSide()) { + method = GT_MetaTileEntity_TieredMachineBlock.class.getMethod("getTextureSet", ITexture[].class); + field = GT_MetaTileEntity_TieredMachineBlock.class.getField("mTextures"); + field.setAccessible(true); + } + + temp = new GT_MetaTileEntity_BasicHull( + 11230, "hull.tier.10", "UEV Machine Hull",10, + imagination); + Util.setTier(10, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Hull_UEV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_BasicHull( + 11231, "hull.tier.11", "UIV Machine Hull",11, + imagination); + Util.setTier(11, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Hull_UIV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_BasicHull( + 11232, "hull.tier.12", "UMV Machine Hull",12, + imagination); + Util.setTier(12, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Hull_UMV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_BasicHull( + 11233, "hull.tier.13", "UXV Machine Hull",13, + imagination); + Util.setTier(13, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Hull_UXV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_BasicHull( + 11234, "hull.tier.14", "OPV Machine Hull",14, + imagination); + Util.setTier(14, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Hull_OPV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_BasicHull( + 11235, "hull.tier.15", "MAX Machine Hull",15, + imagination); + Util.setTier(15, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Hull_MAXV.set(temp.getStackForm(1L)); + + + temp = new GT_MetaTileEntity_Transformer( + 11220, "transformer.tier.09", "Highly Ultimate Transformer", 9, + "UEV -> UHV (Use Soft Mallet to invert)"); + CustomItemList.Transformer_UEV_UHV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_Transformer( + 11221, "transformer.tier.10", "Extremely Ultimate Transformer", 10, + "UIV -> UEV (Use Soft Mallet to invert)"); + Util.setTier(10, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_UIV_UEV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_Transformer( + 11222, "transformer.tier.11", "Insanely Ultimate Transformer", 11, + "UMV -> UIV (Use Soft Mallet to invert)"); + Util.setTier(11, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_UMV_UIV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_Transformer( + 11223, "transformer.tier.12", "Mega Ultimate Transformer", 12, + "UXV -> UMV (Use Soft Mallet to invert)"); + Util.setTier(12, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_UXV_UMV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_Transformer( + 11224, "transformer.tier.13", "Extended Mega Ultimate Transformer", 13, + "OPV -> UXV (Use Soft Mallet to invert)"); + Util.setTier(13, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_OPV_UXV.set(temp.getStackForm(1L)); + + temp = new GT_MetaTileEntity_Transformer( + 11225, "transformer.tier.14", "Overpowered Transformer", 14, + "MAX -> OPV (Use Soft Mallet to invert)"); + Util.setTier(14, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_MAXV_OPV.set(temp.getStackForm(1L)); + + + if (Loader.isModLoaded(Reference.GTPLUSPLUS)) { + Class clazz = Class.forName("gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTransformerHiAmp"); + Constructor<MetaTileEntity> constructor = clazz.getConstructor(int.class, String.class, String.class, int.class, String.class); + + temp = constructor.newInstance( + 11989, "transformer.ha.tier.09", "Highly Ultimate Hi-Amp Transformer", 9, + "UEV -> UHV (Use Soft Mallet to invert)"); + CustomItemList.Transformer_HA_UEV_UHV.set(temp.getStackForm(1)); + + temp = constructor.newInstance( + 11910, "transformer.ha.tier.10", "Extremely Ultimate Hi-Amp Transformer", 10, + "UIV -> UEV (Use Soft Mallet to invert)"); + Util.setTier(10, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_HA_UIV_UEV.set(temp.getStackForm(1)); + + temp = constructor.newInstance( + 11911, "transformer.ha.tier.11", "Insanely Ultimate Hi-Amp Transformer", 11, + "UMV -> UIV (Use Soft Mallet to invert)"); + Util.setTier(11, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_HA_UMV_UIV.set(temp.getStackForm(1)); + + temp = constructor.newInstance( + 11912, "transformer.ha.tier.12", "Mega Ultimate Hi-Amp Transformer", 12, + "UXV -> UMV (Use Soft Mallet to invert)"); + Util.setTier(12, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_HA_UXV_UMV.set(temp.getStackForm(1)); + + temp = constructor.newInstance( + 11913, "transformer.ha.tier.13", "Extended Mega Ultimate Hi-Amp Transformer", 13, + "OPV -> UXV (Use Soft Mallet to invert)"); + Util.setTier(13, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_HA_OPV_UXV.set(temp.getStackForm(1)); + + temp = constructor.newInstance( + 11914, "transformer.ha.tier.14", "Overpowered Hi-Amp Transformer", 14, + "MAX -> OPV (Use Soft Mallet to invert)"); + Util.setTier(14, temp); + if (GT_Values.GT.isClientSide()) { + field.set(temp, method.invoke(temp, iTexture)); + } + CustomItemList.Transformer_HA_MAXV_OPV.set(temp.getStackForm(1)); + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java index aa6590c8ea..a7cb8bb8a0 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java @@ -1,43 +1,90 @@ package com.github.technus.tectech.compatibility.gtpp; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; import gregtech.api.enums.OrePrefixes; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.MaterialGenerator; +import net.minecraftforge.fluids.FluidStack; -import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.*; +import java.lang.reflect.Method; + +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition.*; public class GtppAtomLoader implements Runnable{ + //region reflect a bit + private Class ELEMENT; + private Object ELEMENT_INSTANCE; + private Method getUnlocalizedName,getFluid,generate; + + private String getUnlocalizedName(String elementName){ + try { + return (String) getUnlocalizedName.invoke(ELEMENT.getField(elementName).get(ELEMENT_INSTANCE)); + }catch (Exception e){ + throw new Error(e); + } + } + + private FluidStack getFluid(String elementName, int fluidAmount){ + try { + return (FluidStack) getFluid.invoke(ELEMENT.getField(elementName).get(ELEMENT_INSTANCE),fluidAmount); + }catch (Exception e){ + throw new Error(e); + } + } + + private void generate(String elementName,boolean generateAll, boolean generateBlastRecipes){ + try { + generate.invoke(null,ELEMENT.getField(elementName).get(ELEMENT_INSTANCE),generateAll,generateBlastRecipes); + }catch (Exception e){ + throw new Error(e); + } + } + //endregion + @Override public void run() { - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), 144), ELEMENT.getInstance().NEON.getFluid(144)); - MaterialGenerator.generate(ELEMENT.getInstance().GERMANIUM); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(32), 144), OrePrefixes.dust, ELEMENT.getInstance().GERMANIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(34), 144), OrePrefixes.dust, ELEMENT.getInstance().SELENIUM.getUnlocalizedName(),1); - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(35), 144), ELEMENT.getInstance().BROMINE.getFluid(144)); - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(36), 144), ELEMENT.getInstance().KRYPTON.getFluid(144)); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(40), 144),OrePrefixes.dust, ELEMENT.getInstance().ZIRCONIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(43), 144),OrePrefixes.dust, ELEMENT.getInstance().TECHNETIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(44), 144),OrePrefixes.dust, ELEMENT.getInstance().RUTHENIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(45), 144),OrePrefixes.dust, ELEMENT.getInstance().RHODIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(53), 144),OrePrefixes.dust, ELEMENT.getInstance().IODINE.getUnlocalizedName(),1); - transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(54), 144),ELEMENT.getInstance().XENON.getFluid(144)); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(72), 144),OrePrefixes.dust, ELEMENT.getInstance().HAFNIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(75), 144),OrePrefixes.dust, ELEMENT.getInstance().RHENIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(81), 144),OrePrefixes.dust, ELEMENT.getInstance().THALLIUM.getUnlocalizedName(),1); - - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(84),144),OrePrefixes.dust, ELEMENT.getInstance().POLONIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(85),144),OrePrefixes.dust, ELEMENT.getInstance().ASTATINE.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(87),144),OrePrefixes.dust, ELEMENT.getInstance().FRANCIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(88),144),OrePrefixes.dust, ELEMENT.getInstance().RADIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(89),144),OrePrefixes.dust, ELEMENT.getInstance().ACTINIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(91),144),OrePrefixes.dust, ELEMENT.getInstance().PROTACTINIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(93),144),OrePrefixes.dust, ELEMENT.getInstance().NEPTUNIUM.getUnlocalizedName(),1); - - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(96),144),OrePrefixes.dust, ELEMENT.getInstance().CURIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(97),144),OrePrefixes.dust, ELEMENT.getInstance().BERKELIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(98),144),OrePrefixes.dust, ELEMENT.getInstance().CALIFORNIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(99),144),OrePrefixes.dust, ELEMENT.getInstance().EINSTEINIUM.getUnlocalizedName(),1); - transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(100),144),OrePrefixes.dust, ELEMENT.getInstance().FERMIUM.getUnlocalizedName(),1); + //region reflect a bit + try{ + ELEMENT=Class.forName("gtPlusPlus.core.material.ELEMENT"); + ELEMENT_INSTANCE=ELEMENT.getMethod("getInstance").invoke(null); + + Class clazz=Class.forName("gtPlusPlus.core.material.Material"); + getUnlocalizedName=clazz.getMethod("getUnlocalizedName"); + getFluid=clazz.getMethod("getFluid", int.class); + + clazz=Class.forName("gtPlusPlus.core.material.MaterialGenerator"); + generate=clazz.getMethod("generate", Class.forName("gtPlusPlus.core.material.Material"), boolean.class, boolean.class); + }catch (Exception e){ + throw new Error(e); + } + //endregion + + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), 144), getFluid("NEON",144)); + generate("GERMANIUM",true,true); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(32), 144), OrePrefixes.dust, getUnlocalizedName("GERMANIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(34), 144), OrePrefixes.dust, getUnlocalizedName("SELENIUM"),1); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(35), 144), getFluid("BROMINE",144)); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(36), 144), getFluid("KRYPTON",144)); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(40), 144),OrePrefixes.dust, getUnlocalizedName("ZIRCONIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(43), 144),OrePrefixes.dust, getUnlocalizedName("TECHNETIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(44), 144),OrePrefixes.dust, getUnlocalizedName("RUTHENIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(45), 144),OrePrefixes.dust, getUnlocalizedName("RHODIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(53), 144),OrePrefixes.dust, getUnlocalizedName("IODINE"),1); + transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(54), 144),getFluid("XENON",144)); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(72), 144),OrePrefixes.dust, getUnlocalizedName("HAFNIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(75), 144),OrePrefixes.dust, getUnlocalizedName("RHENIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(81), 144),OrePrefixes.dust, getUnlocalizedName("THALLIUM"),1); + + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(84),144),OrePrefixes.dust, getUnlocalizedName("POLONIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(85),144),OrePrefixes.dust, getUnlocalizedName("ASTATINE"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(87),144),OrePrefixes.dust, getUnlocalizedName("FRANCIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(88),144),OrePrefixes.dust, getUnlocalizedName("RADIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(89),144),OrePrefixes.dust, getUnlocalizedName("ACTINIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(91),144),OrePrefixes.dust, getUnlocalizedName("PROTACTINIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(93),144),OrePrefixes.dust, getUnlocalizedName("NEPTUNIUM"),1); + + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(96),144),OrePrefixes.dust, getUnlocalizedName("CURIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(97),144),OrePrefixes.dust, getUnlocalizedName("BERKELIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(98),144),OrePrefixes.dust, getUnlocalizedName("CALIFORNIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(99),144),OrePrefixes.dust, getUnlocalizedName("EINSTEINIUM"),1); + transformation.addOredict(new cElementalDefinitionStack(getBestUnstableIsotope(100),144),OrePrefixes.dust, getUnlocalizedName("FERMIUM"),1); } } diff --git a/src/main/java/openmodularturrets/TT_turret_loader.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/TT_turret_loader.java index 57470f54f6..d03f1bd1c6 100644 --- a/src/main/java/openmodularturrets/TT_turret_loader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/TT_turret_loader.java @@ -1,15 +1,15 @@ -package openmodularturrets; +package com.github.technus.tectech.compatibility.openmodularturrets; +import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads.TurretHeadEM; +import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads.TurretHeadItemRenderEM; +import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads.TurretHeadRenderEM; +import com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles.projectileEM; +import com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles.projectileRenderEM; +import com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turret.TileTurretHeadEM; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.item.Item; import net.minecraftforge.client.MinecraftForgeClient; -import openmodularturrets.blocks.turretheads.TurretHeadEM; -import openmodularturrets.blocks.turretheads.TurretHeadItemRenderEM; -import openmodularturrets.blocks.turretheads.TurretHeadRenderEM; -import openmodularturrets.entity.projectiles.projectileEM; -import openmodularturrets.entity.projectiles.projectileRenderEM; -import openmodularturrets.tileentity.turret.TileTurretHeadEM; public class TT_turret_loader implements Runnable { @Override diff --git a/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseEM.java index d79ab16f12..9da3b82b40 100644 --- a/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseEM.java @@ -1,17 +1,19 @@ -package openmodularturrets.blocks.turretbases; +package com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretbases; -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.Reference; +import com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turretbase.TileTurretBaseEM; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import openmodularturrets.blocks.turretbases.BlockAbstractTurretBase; import openmodularturrets.handler.ConfigHandler; -import openmodularturrets.tileentity.turretbase.TileTurretBaseEM; + +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; /** - * Created by Bass on 27/07/2017. + * Created by Tec on 27/07/2017. */ public class TurretBaseEM extends BlockAbstractTurretBase { private final int MaxCharge = ConfigHandler.getBaseTierFiveMaxCharge(); @@ -19,7 +21,7 @@ public class TurretBaseEM extends BlockAbstractTurretBase { public static TurretBaseEM INSTANCE; public TurretBaseEM(){ - setCreativeTab(TecTech.mainTab); + setCreativeTab(creativeTabTecTech); setResistance(16); setBlockName("turretBaseEM"); setStepSound(Block.soundTypeMetal); diff --git a/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java index 61f877e81b..af0be0e1f5 100644 --- a/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java @@ -1,4 +1,4 @@ -package openmodularturrets.blocks.turretbases; +package com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretbases; import com.github.technus.tectech.CommonValues; import net.minecraft.block.Block; @@ -11,7 +11,7 @@ import net.minecraft.util.StatCollector; import java.util.List; /** - * Created by Bass on 28/07/2017. + * Created by Tec on 28/07/2017. */ public class TurretBaseItemEM extends ItemBlock { public TurretBaseItemEM(Block block) { diff --git a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadEM.java index e7746a8291..7b7167b915 100644 --- a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadEM.java @@ -1,6 +1,6 @@ -package openmodularturrets.blocks.turretheads; +package com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads; -import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turret.TileTurretHeadEM; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; @@ -9,18 +9,19 @@ import net.minecraft.entity.EnumCreatureType; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import openmodularturrets.tileentity.turret.TileTurretHeadEM; import openmodularturrets.tileentity.turretbase.TurretBase; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; + /** - * Created by Bass on 27/07/2017. + * Created by Tec on 27/07/2017. */ public class TurretHeadEM extends Block implements ITileEntityProvider { public static TurretHeadEM INSTANCE; public TurretHeadEM(){ super(Material.glass); - setCreativeTab(TecTech.mainTab); + setCreativeTab(creativeTabTecTech); setBlockUnbreakable(); setResistance(6000000.0F); setStepSound(Block.soundTypeMetal); diff --git a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java index db3c089e47..8aa598c440 100644 --- a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java @@ -1,4 +1,4 @@ -package openmodularturrets.blocks.turretheads; +package com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -14,7 +14,7 @@ import java.util.List; import static com.github.technus.tectech.CommonValues.TEC_MARK_EM; /** - * Created by Bass on 28/07/2017. + * Created by Tec on 28/07/2017. */ public class TurretHeadItemEM extends ItemBlock { private static final DecimalFormat df = new DecimalFormat("0.0"); diff --git a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemRenderEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemRenderEM.java index 4760e2b16e..b44a939df3 100644 --- a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemRenderEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemRenderEM.java @@ -1,9 +1,9 @@ -package openmodularturrets.blocks.turretheads; +package com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads; +import com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turret.TileTurretHeadEM; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; import openmodularturrets.client.render.models.ModelLaserTurret; -import openmodularturrets.tileentity.turret.TileTurretHeadEM; import org.lwjgl.opengl.GL11; /** diff --git a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java index 23379b9585..f407257eab 100644 --- a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java @@ -1,8 +1,8 @@ -package openmodularturrets.blocks.turretheads; +package com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads; import openmodularturrets.client.render.renderers.blockitem.LaserTurretRenderer; /** - * Created by Bass on 28/07/2017. + * Created by Tec on 28/07/2017. */ public class TurretHeadRenderEM extends LaserTurretRenderer {} diff --git a/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java index 53e6186a25..c22c6c4b95 100644 --- a/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileEM.java @@ -1,29 +1,34 @@ -package openmodularturrets.entity.projectiles; +package com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.definitions.complex.hadron.dHadronDefinition; -import com.github.technus.tectech.elementalMatter.definitions.primitive.eQuarkDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import gregtech.api.GregTech_API; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import openmodularturrets.entity.projectiles.LaserProjectile; import openmodularturrets.entity.projectiles.damagesources.NormalDamageSource; import openmodularturrets.handler.ConfigHandler; import openmodularturrets.tileentity.turretbase.TurretBase; +import openmodularturrets.util.PlayerUtil; +import openmodularturrets.util.TurretHeadUtil; /** * Created by Bass on 27/07/2017. */ -public class projectileEM extends TurretProjectile { +public class projectileEM extends LaserProjectile { public float gravity=0; private TurretBase turretBase; - private boolean exotic, antiMatter; + private boolean exotic, antiMatter,isAmped; + + private int ampLevel; private float massFactor; @@ -33,6 +38,11 @@ public class projectileEM extends TurretProjectile { public projectileEM(World par1World, TurretBase turretBase) { super(par1World, turretBase); + int amp=TurretHeadUtil.getAmpLevel(turretBase); + if (amp > 0) { + this.isAmped = true; + this.ampLevel = amp; + } } public projectileEM(World par1World, TurretBase turretBase, cElementalInstanceStackMap avalableEM) { @@ -48,7 +58,7 @@ public class projectileEM extends TurretProjectile { if (onlyQuarks) { avalableEM.clear(); } else { - cElementalInstanceStack consumeFromThis=avalableEM.get(TecTech.Rnd.nextInt(avalableEM.size())); + cElementalInstanceStack consumeFromThis=avalableEM.get(TecTech.RANDOM.nextInt(avalableEM.size())); massFactor =consumeFromThis.definition.getMass()/ dHadronDefinition.hadron_n_.getMass(); if(consumeFromThis.definition.getType()>1 || consumeFromThis.definition.getType()<-1) { @@ -78,8 +88,8 @@ public class projectileEM extends TurretProjectile { if(movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { Block hitBlock = worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); if(hitBlock != null){ - if (hitBlock.getMaterial().isSolid() && TecTech.ModConfig.ENABLE_TURRET_EXPLOSIONS && antiMatter) { - worldObj.playSoundEffect(posX, posY, posZ, "openmodularturrets:laserHit", ConfigHandler.getTurretSoundVolume(), TecTech.Rnd.nextFloat() + 0.5F); + if (hitBlock.getMaterial().isSolid() && TecTech.configTecTech.ENABLE_TURRET_EXPLOSIONS && antiMatter) { + worldObj.playSoundEffect(posX, posY, posZ, "openmodularturrets:laserHit", ConfigHandler.getTurretSoundVolume(), TecTech.RANDOM.nextFloat() + 0.5F); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1.0F, movingobjectposition.blockX, movingobjectposition.blockY, @@ -87,7 +97,7 @@ public class projectileEM extends TurretProjectile { worldObj.createExplosion(null, movingobjectposition.blockX + 0.5D, movingobjectposition.blockY + 0.5D, - movingobjectposition.blockZ + 0.5D, (exotic?10:1) * TecTech.ModConfig.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? amp_level*.1f +1:1) * (ticksExisted/250f), true); + movingobjectposition.blockZ + 0.5D, (exotic?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); } else { return; } @@ -95,9 +105,9 @@ public class projectileEM extends TurretProjectile { } if(movingobjectposition.entityHit != null && !worldObj.isRemote) { - worldObj.playSoundEffect(posX, posY, posZ, "openmodularturrets:laserHit", ConfigHandler.getTurretSoundVolume(), TecTech.Rnd.nextFloat() + 0.5F); + worldObj.playSoundEffect(posX, posY, posZ, "openmodularturrets:laserHit", ConfigHandler.getTurretSoundVolume(), TecTech.RANDOM.nextFloat() + 0.5F); if(movingobjectposition.entityHit != null && !worldObj.isRemote) { - float damage = (exotic?10:1) * TecTech.ModConfig.TURRET_DAMAGE_FACTOR * massFactor * (isAmped? amp_level*.1f +1:1); + float damage = (exotic?10:1) * TecTech.configTecTech.TURRET_DAMAGE_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1); if(movingobjectposition.entityHit instanceof EntityPlayer) { if(canDamagePlayer((EntityPlayer)movingobjectposition.entityHit)) { @@ -115,7 +125,7 @@ public class projectileEM extends TurretProjectile { } } - if (TecTech.ModConfig.ENABLE_TURRET_EXPLOSIONS && antiMatter) { + if (TecTech.configTecTech.ENABLE_TURRET_EXPLOSIONS && antiMatter) { GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1.0F, (int)movingobjectposition.entityHit.posX, (int)movingobjectposition.entityHit.posY, @@ -123,7 +133,7 @@ public class projectileEM extends TurretProjectile { worldObj.createExplosion(null, movingobjectposition.entityHit.posX, movingobjectposition.entityHit.posY, - movingobjectposition.entityHit.posZ, (exotic?10:1) * TecTech.ModConfig.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? amp_level*.1f +1:1) * (ticksExisted/250f), true); + movingobjectposition.entityHit.posZ, (exotic?10:1) * TecTech.configTecTech.TURRET_EXPLOSION_FACTOR * massFactor * (isAmped? ampLevel*.1f +1:1) * (ticksExisted/250f), true); } } } @@ -131,10 +141,19 @@ public class projectileEM extends TurretProjectile { } } + public boolean canDamagePlayer(EntityPlayer entityPlayer) { + return ConfigHandler.turretDamageTrustedPlayers || this.turretBase.getTrustedPlayer(entityPlayer.getUniqueID()) == null && !PlayerUtil.getPlayerUIDUnstable(this.turretBase.getOwner()).equals(entityPlayer.getUniqueID()); + } + @Override public void onEntityUpdate() { if(ticksExisted >= 75) { setDead(); } } + + @Override + protected float getGravityVelocity() { + return gravity; + } } diff --git a/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileRenderEM.java index 9faeb02da6..812a752562 100644 --- a/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/entity/projectiles/projectileRenderEM.java @@ -1,6 +1,6 @@ -package openmodularturrets.entity.projectiles; +package com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles; -import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.OpenGlHelper; diff --git a/src/main/java/openmodularturrets/tileentity/turret/TileTurretHeadEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turret/TileTurretHeadEM.java index 286f12d853..2de6b39c4c 100644 --- a/src/main/java/openmodularturrets/tileentity/turret/TileTurretHeadEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turret/TileTurretHeadEM.java @@ -1,15 +1,15 @@ -package openmodularturrets.tileentity.turret; +package com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turret; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles.projectileEM; +import com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turretbase.TileTurretBaseEM; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import openmodularturrets.entity.projectiles.TurretProjectile; -import openmodularturrets.entity.projectiles.projectileEM; import openmodularturrets.handler.ConfigHandler; -import openmodularturrets.tileentity.turretbase.TileTurretBaseEM; import openmodularturrets.tileentity.turrets.TurretHead; import openmodularturrets.util.TurretHeadUtil; diff --git a/src/main/java/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java index 7bb87c8826..a31ba4ef2c 100644 --- a/src/main/java/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java @@ -1,11 +1,12 @@ -package openmodularturrets.tileentity.turretbase; +package com.github.technus.tectech.compatibility.openmodularturrets.tileentity.turretbase; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import cpw.mods.fml.common.Optional; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import openmodularturrets.tileentity.turretbase.TurretBaseTierFiveTileEntity; /** * Created by Bass on 27/07/2017. diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java deleted file mode 100644 index 9038e4fe26..0000000000 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.github.technus.tectech.compatibility.thaumcraft.definitions; - -import com.github.technus.tectech.elementalMatter.core.tElementalException; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; -import thaumcraft.api.aspects.Aspect; - -import java.util.ArrayList; - -import static com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition.*; - -/** - * Created by Tec on 21.05.2017. - */ -public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat { - @Override - public void run(){ - AspectDefinitionCompat.defToAspect.put(magic_air,"aer"); - AspectDefinitionCompat.defToAspect.put(magic_earth,"terra"); - AspectDefinitionCompat.defToAspect.put(magic_fire,"ignis"); - AspectDefinitionCompat.defToAspect.put(magic_water,"aqua"); - AspectDefinitionCompat.defToAspect.put(magic_order,"ordo"); - AspectDefinitionCompat.defToAspect.put(magic_entropy,"perditio"); - - AspectDefinitionCompat.aspectToDef.put("aer",magic_air); - AspectDefinitionCompat.aspectToDef.put("terra",magic_earth); - AspectDefinitionCompat.aspectToDef.put("ignis",magic_fire); - AspectDefinitionCompat.aspectToDef.put("aqua",magic_water); - AspectDefinitionCompat.aspectToDef.put("ordo",magic_order); - AspectDefinitionCompat.aspectToDef.put("perditio",magic_entropy); - - ArrayList<Aspect> list=Aspect.getCompoundAspects(); - Aspect[] array= list.toArray(new Aspect[list.size()]); - while (!list.isEmpty()) { - for (Aspect aspect : array) { - if (list.contains(aspect)) { - Aspect[] content = aspect.getComponents(); - if (content.length != 2) { - list.remove(aspect); - }else if(AspectDefinitionCompat.aspectToDef.containsKey(content[0].getTag()) && AspectDefinitionCompat.aspectToDef.containsKey(content[1].getTag())){ - try { - dComplexAspectDefinition newAspect; - if(content[0].getTag().equals(content[1].getTag())){ - newAspect = new dComplexAspectDefinition(AspectDefinitionCompat.aspectToDef.get(content[0].getTag()).getStackForm(2) - ); - }else{ - newAspect = new dComplexAspectDefinition(AspectDefinitionCompat.aspectToDef.get(content[0].getTag()).getStackForm(1), AspectDefinitionCompat.aspectToDef.get(content[1].getTag()).getStackForm(1) - ); - } - AspectDefinitionCompat.aspectToDef.put(aspect.getTag(),newAspect); - AspectDefinitionCompat.defToAspect.put(newAspect,aspect.getTag()); - }catch (tElementalException e) { - /**/ - }finally { - list.remove(aspect); - } - } - } - } - } - } - - @Override - Aspect getAspect(cElementalDefinition definition) { - return Aspect.getAspect(AspectDefinitionCompat.defToAspect.get(definition)); - } - - @Override - String getAspectTag(cElementalDefinition definition) { - return AspectDefinitionCompat.defToAspect.get(definition); - } - - @Override - iElementalDefinition getDefinition(String aspect) { - return AspectDefinitionCompat.aspectToDef.get(aspect); - } - -} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompat.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java index 8715e33dd8..2d531858d0 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompat.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompat.java @@ -1,8 +1,8 @@ -package com.github.technus.tectech.compatibility.thaumcraft.definitions; +package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import java.util.HashMap; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java new file mode 100644 index 0000000000..91523326db --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java @@ -0,0 +1,78 @@ +package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions; + +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; +import thaumcraft.api.aspects.Aspect; + +import java.util.ArrayList; + +import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition.*; + +/** + * Created by Tec on 21.05.2017. + */ +public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat { + @Override + public void run(){ + defToAspect.put(magic_air,"aer"); + defToAspect.put(magic_earth,"terra"); + defToAspect.put(magic_fire,"ignis"); + defToAspect.put(magic_water,"aqua"); + defToAspect.put(magic_order,"ordo"); + defToAspect.put(magic_entropy,"perditio"); + + aspectToDef.put("aer",magic_air); + aspectToDef.put("terra",magic_earth); + aspectToDef.put("ignis",magic_fire); + aspectToDef.put("aqua",magic_water); + aspectToDef.put("ordo",magic_order); + aspectToDef.put("perditio",magic_entropy); + + ArrayList<Aspect> list=Aspect.getCompoundAspects(); + Aspect[] array= list.toArray(new Aspect[list.size()]); + while (!list.isEmpty()) { + for (Aspect aspect : array) { + if (list.contains(aspect)) { + Aspect[] content = aspect.getComponents(); + if (content.length != 2) { + list.remove(aspect); + }else if(aspectToDef.containsKey(content[0].getTag()) && aspectToDef.containsKey(content[1].getTag())){ + try { + dComplexAspectDefinition newAspect; + if(content[0].getTag().equals(content[1].getTag())){ + newAspect = new dComplexAspectDefinition(aspectToDef.get(content[0].getTag()).getStackForm(2) + ); + }else{ + newAspect = new dComplexAspectDefinition(aspectToDef.get(content[0].getTag()).getStackForm(1), aspectToDef.get(content[1].getTag()).getStackForm(1) + ); + } + aspectToDef.put(aspect.getTag(),newAspect); + defToAspect.put(newAspect,aspect.getTag()); + }catch (tElementalException e) { + /**/ + }finally { + list.remove(aspect); + } + } + } + } + } + } + + @Override + Aspect getAspect(cElementalDefinition definition) { + return Aspect.getAspect(defToAspect.get(definition)); + } + + @Override + String getAspectTag(cElementalDefinition definition) { + return defToAspect.get(definition); + } + + @Override + iElementalDefinition getDefinition(String aspect) { + return aspectToDef.get(aspect); + } + +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java index 3d29927a6c..77dffad225 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java @@ -1,24 +1,23 @@ -package com.github.technus.tectech.compatibility.thaumcraft.definitions; +package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.tElementalException; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.transformations.aFluidDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aItemDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aOredictDequantizationInfo; -import com.github.technus.tectech.elementalMatter.definitions.primitive.eBosonDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aFluidDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition; import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectDefinitionCompat; -import static com.github.technus.tectech.elementalMatter.core.cElementalDecay.noDecay; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay.noDecay; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; /** @@ -81,7 +80,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme @Override public String getName() { - String name= aspectDefinitionCompat.getAspectTag(this); + String name= AspectDefinitionCompat.aspectDefinitionCompat.getAspectTag(this); if(name!=null){ name=name.substring(0,1).toUpperCase()+name.substring(1); }else{ @@ -111,6 +110,10 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme @Override public NBTTagCompound toNBT() { + return getNbtTagCompound(nbtType, aspectStacks); + } + + public static NBTTagCompound getNbtTagCompound(byte nbtType, cElementalDefinitionStackMap aspectStacks) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setByte("t", nbtType); cElementalDefinitionStack[] quarkStacksValues = aspectStacks.values(); @@ -182,6 +185,21 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme } @Override + public boolean usesMultipleDecayCalls(long energyLevel) { + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return false; + } + + @Override + public boolean fusionMakesEnergy(long energyLevel) { + return false; + } + + @Override public cElementalDecay[] getNaturalDecayInstant() { return noDecay; } @@ -213,7 +231,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme @Override public Object materializeIntoAspect() { - return aspectDefinitionCompat.getAspect(this); + return AspectDefinitionCompat.aspectDefinitionCompat.getAspect(this); } @Override @@ -230,7 +248,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme } } if(DEBUG_MODE) { - TecTech.Logger.info("Registered Elemental Matter Class: ComplexAspect " + nbtType + ' ' + -96); + TecTech.LOGGER.info("Registered Elemental Matter Class: ComplexAspect " + nbtType + ' ' + -96); } } @@ -239,6 +257,10 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme return -96; } + public static byte getClassTypeStatic(){ + return -96; + } + @Override public int hashCode() { return hash; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/ePrimalAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java index 64c1b7ea19..5f3f01d4cb 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/ePrimalAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java @@ -1,9 +1,8 @@ -package com.github.technus.tectech.compatibility.thaumcraft.definitions; +package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; -import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectDefinitionCompat; -import static com.github.technus.tectech.elementalMatter.core.cElementalDecay.noDecay; +import static com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay.noDecay; /** * Created by Tec on 06.05.2017. @@ -37,7 +36,7 @@ public final class ePrimalAspectDefinition extends cElementalPrimitive implement @Override public Object materializeIntoAspect() { - return aspectDefinitionCompat.getAspect(this); + return AspectDefinitionCompat.aspectDefinitionCompat.getAspect(this); } @Override diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/iElementalAspect.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/iElementalAspect.java index 0f96d3d4be..3cb2d8e5e8 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/iElementalAspect.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/iElementalAspect.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.compatibility.thaumcraft.definitions; +package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions; /** * Created by Tec on 21.05.2017. diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompat.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/EssentiaCompat.java index fba6f1e6e9..e77cab2734 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompat.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/EssentiaCompat.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.compatibility.thaumcraft; +package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import net.minecraft.tileentity.TileEntity; @@ -10,8 +10,6 @@ import net.minecraft.tileentity.TileEntity; public class EssentiaCompat { public static EssentiaCompat essentiaContainerCompat; - public void run(){} - public boolean check(GT_MetaTileEntity_MultiblockBase_EM meta){ return false; } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/EssentiaCompatEnabled.java index 15efa593eb..484377b179 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/EssentiaCompatEnabled.java @@ -1,8 +1,8 @@ -package com.github.technus.tectech.compatibility.thaumcraft; +package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.compatibility.thaumcraft.definitions.iElementalAspect; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.iElementalAspect; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import net.minecraft.tileentity.TileEntity; import thaumcraft.api.aspects.Aspect; @@ -11,18 +11,13 @@ import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.common.tiles.TileEssentiaReservoir; import thaumcraft.common.tiles.TileJarFillable; -import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectToDef; +import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.AspectDefinitionCompat.aspectToDef; /** * Created by Tec on 21.05.2017. */ public class EssentiaCompatEnabled extends EssentiaCompat { @Override - public void run() { - - } - - @Override public boolean check(GT_MetaTileEntity_MultiblockBase_EM meta) { TileEntity tile =meta.getBaseMetaTileEntity().getTileEntityAtSide(meta.getBaseMetaTileEntity().getBackFacing()); return tile instanceof TileEssentiaReservoir || tile instanceof TileJarFillable; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 9c0008ab07..84cd28b7c9 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -2,9 +2,9 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; @@ -22,9 +22,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.V; -import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.enums.GT_Values.E; @@ -99,7 +99,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); } } - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,this,hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 085884b80a..d45060c758 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -2,9 +2,9 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; @@ -22,9 +22,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.V; -import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.enums.GT_Values.E; @@ -99,7 +99,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); } } - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,this,hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/dataFramework/QuantumDataPacket.java b/src/main/java/com/github/technus/tectech/dataFramework/QuantumDataPacket.java deleted file mode 100644 index 56733d0b1d..0000000000 --- a/src/main/java/com/github/technus/tectech/dataFramework/QuantumDataPacket.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.github.technus.tectech.dataFramework; - -import com.github.technus.tectech.Vec3pos; -import net.minecraft.nbt.NBTTagCompound; - -import java.util.LinkedHashSet; -import java.util.Set; - -/** - * Created by Tec on 05.04.2017. - */ -public class QuantumDataPacket { - public static byte maxHistory = 64; - - public long computation = 0; - public Set<Vec3pos> trace = new LinkedHashSet<>(); - - public QuantumDataPacket(Vec3pos pos, long computation) { - this.computation = computation; - trace.add(pos); - } - - public QuantumDataPacket(QuantumDataPacket q, long computation) { - this.computation = computation; - trace.addAll(q.trace); - } - - public QuantumDataPacket(NBTTagCompound nbt) { - computation = nbt.getLong("qComputation"); - for (int i = 0; i < nbt.getByte("qHistory"); i++) { - trace.add(new Vec3pos( - nbt.getInteger("qX" + i), - nbt.getShort("qY" + i), - nbt.getInteger("qZ" + i) - )); - } - } - - public NBTTagCompound toNbt() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setLong("qComputation", computation); - nbt.setByte("qHistory", (byte) trace.size()); - int i = 0; - for (Vec3pos v : trace) { - nbt.setInteger("qX" + i, v.x); - nbt.setShort("qY" + i, v.y); - nbt.setInteger("qZ" + i, v.z); - i++; - } - return nbt; - } - - public boolean contains(Vec3pos v) { - return trace.contains(v); - } - - public boolean check() { - return trace.size() <= maxHistory; - } - - public QuantumDataPacket unifyTraceWith(QuantumDataPacket p) { - trace.addAll(p.trace); - return check() ? this : null; - } - - public QuantumDataPacket unifyPacketWith(QuantumDataPacket p) { - computation += p.computation; - trace.addAll(p.trace); - return check() ? this : null; - } - - public long computationIfNotContained(Vec3pos pos) { - if (trace.contains(pos)) { - return 0; - } - return computation; - } -} diff --git a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java index 29533c5a0a..ab075f7ffd 100644 --- a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java +++ b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java @@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; import net.minecraft.util.IIcon; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; @@ -14,6 +15,10 @@ import org.lwjgl.opengl.GL11; public class BlockHint extends EntityFX { private IIcon[] icons = new IIcon[6]; + public BlockHint(World world){ + this(world,0,0,0, Blocks.stone,0); + } + public BlockHint(World world, int x, int y, int z, Block block, int meta) { super(world, x+.25, y+.5, z+.25); particleGravity = 0; @@ -21,7 +26,7 @@ public class BlockHint extends EntityFX { prevPosY = posY; prevPosZ = posZ; noClip = true; - particleMaxAge = 2000 + TecTech.Rnd.nextInt(200); + particleMaxAge = 2000 + TecTech.RANDOM.nextInt(200); for (int i = 0; i < 6; i++) { icons[i] = block.getIcon(i, meta); } diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index 2e715d7b9c..de53fb225f 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -1,79 +1,141 @@ package com.github.technus.tectech.loader; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat; -import com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompatEnabled; -import com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat; -import com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompatEnabled; -import com.github.technus.tectech.thing.CustomItemList; -import com.github.technus.tectech.thing.block.QuantumGlassBlock; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.AspectDefinitionCompat; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.AspectDefinitionCompatEnabled; +import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat; +import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompatEnabled; +import com.github.technus.tectech.loader.entity.EntityLoader; +import com.github.technus.tectech.loader.gui.CreativeTabTecTech; +import com.github.technus.tectech.loader.gui.ModGuiHandler; +import com.github.technus.tectech.loader.mechanics.ElementalLoader; +import com.github.technus.tectech.loader.recipe.RecipeLoader; +import com.github.technus.tectech.loader.thing.ComponentLoader; +import com.github.technus.tectech.loader.thing.MachineLoader; +import com.github.technus.tectech.loader.thing.ThingsLoader; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.item.ConstructableTriggerItem; -import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; -import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; -import com.github.technus.tectech.thing.item.ParametrizerMemoryCard; +import com.github.technus.tectech.thing.metaTileEntity.Textures; +import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_collider; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationPacketDispatcher; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ProgressManager; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.GameData; +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.util.GT_ModHandler; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; - -import java.util.List; - -import static com.github.technus.tectech.TecTech.hasThaumcraft; -import static com.github.technus.tectech.TecTech.mainTab; -import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; -import static com.github.technus.tectech.compatibility.thaumcraft.definitions.AspectDefinitionCompat.aspectDefinitionCompat; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; + +import static com.github.technus.tectech.CommonValues.*; +import static com.github.technus.tectech.TecTech.*; +import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.AspectDefinitionCompat.aspectDefinitionCompat; +import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; +import static gregtech.api.enums.Dyes.*; import static gregtech.api.enums.GT_Values.W; public final class MainLoader { public static DamageSource microwaving, elementalPollution; - public void load() { - ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 6); + private MainLoader(){} + + public static void staticLoad(){ + for(int i=0;i<16;i++){ + GT_Values.V[i]=V[i]; + GT_Values.VN[i]=VN[i]; + GT_Values.VOLTAGE_NAMES[i]=VOLTAGE_NAMES[i]; + } + new ComponentLoader(); + } + + public static void preLoad(){ + + //set expanded texture arrays for tiers + try { + new Textures(); + }catch (Throwable t){ + LOGGER.error("Loading textures...",t); + } + } + + public static void load() { + ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 8); progressBarLoad.step("Elemental Things"); new ElementalLoader().run(); - TecTech.Logger.info("Elemental Init Done"); + LOGGER.info("Elemental Init Done"); progressBarLoad.step("Thaumcraft Compatibility"); - if (hasThaumcraft) { + if (Loader.isModLoaded(Reference.THAUMCRAFT)) { essentiaContainerCompat = new EssentiaCompatEnabled(); - essentiaContainerCompat.run(); } else { essentiaContainerCompat = new EssentiaCompat(); } - TecTech.Logger.info("Thaumcraft Compatibility Done"); + LOGGER.info("Thaumcraft Compatibility Done"); progressBarLoad.step("Regular Things"); new ThingsLoader().run(); - TecTech.Logger.info("Block/Item Init Done"); + LOGGER.info("Block/Item Init Done"); progressBarLoad.step("Machine Things"); new MachineLoader().run(); - TecTech.Logger.info("Machine Init Done"); + LOGGER.info("Machine Init Done"); progressBarLoad.step("Register entities"); new EntityLoader().run(); - TecTech.Logger.info("Entities registered"); + LOGGER.info("Entities registered"); progressBarLoad.step("Add damage types"); microwaving =new DamageSource("microwaving").setDamageBypassesArmor(); elementalPollution =new DamageSource("elementalPollution").setDamageBypassesArmor(); - TecTech.Logger.info("Damage types addition Done"); + LOGGER.info("Damage types addition Done"); + + progressBarLoad.step("Register Packet Dispatcher"); + new RotationPacketDispatcher(); + LOGGER.info("Packet Dispatcher registered"); + + progressBarLoad.step("Register GUI Handler"); + NetworkRegistry.INSTANCE.registerGuiHandler(instance, new ModGuiHandler()); + proxy.registerRenderInfo(); + LOGGER.info("GUI Handler registered"); ProgressManager.pop(progressBarLoad); } - public void postLoad() { - ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 5); + public static void postLoad() { + ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 6); + + progressBarPostLoad.step("Dreamcraft Compatibility"); + if(Loader.isModLoaded(Reference.DREAMCRAFT)){ + try { + Class clazz = Class.forName("com.dreammaster.gthandler.casings.GT_Container_CasingsNH"); + TT_Container_Casings.sBlockCasingsNH = (Block)clazz.getField("sBlockCasingsNH").get(null); + + if(TT_Container_Casings.sBlockCasingsNH==null){ + throw new NullPointerException("sBlockCasingsNH Is not set at this time"); + } + }catch (Exception e){ + throw new Error("Unable to get NH casings",e); + } + } progressBarPostLoad.step("Thaumcraft Compatibility"); - if (hasThaumcraft) { + if (Loader.isModLoaded(Reference.THAUMCRAFT)) { aspectDefinitionCompat = new AspectDefinitionCompatEnabled(); aspectDefinitionCompat.run(); } else { @@ -83,32 +145,24 @@ public final class MainLoader { progressBarPostLoad.step("Recipes"); new RecipeLoader().run(); - TecTech.Logger.info("Recipe Init Done"); + TecTech.LOGGER.info("Recipe Init Done"); - progressBarPostLoad.step("Creative Tab part1"); - mainTab = new MyCreativeTab(); - progressBarPostLoad.step("Creative Tab part2"); - registerThingsInTabs(); - TecTech.Logger.info("CreativeTab initiation complete"); + progressBarPostLoad.step("Creative Tab"); + creativeTabTecTech =new CreativeTabTecTech("TecTech"); + TecTech.LOGGER.info("CreativeTab initiation complete"); progressBarPostLoad.step("Register Extra Hazmat Suits"); registerExtraHazmats(); - TecTech.Logger.info("Hazmat additions done"); + TecTech.LOGGER.info("Hazmat additions done"); - ProgressManager.pop(progressBarPostLoad); - } + progressBarPostLoad.step("Nerf blocks blast resistance"); + fixBlocks(); + TecTech.LOGGER.info("Blocks nerf done"); - private void registerThingsInTabs() { - QuantumGlassBlock.INSTANCE.setCreativeTab(mainTab); - TT_Container_Casings.sBlockCasingsTT.setCreativeTab(mainTab); - TT_Container_Casings.sHintCasingsTT.setCreativeTab(mainTab); - DebugElementalInstanceContainer_EM.INSTANCE.setCreativeTab(mainTab); - ConstructableTriggerItem.INSTANCE.setCreativeTab(mainTab); - ParametrizerMemoryCard.INSTANCE.setCreativeTab(mainTab); - ElementalDefinitionScanStorage_EM.INSTANCE.setCreativeTab(mainTab); + ProgressManager.pop(progressBarPostLoad); } - private void registerExtraHazmats() { + private static void registerExtraHazmats() { ItemStack EMT_iqC=GT_ModHandler.getModItem("EMT","itemArmorQuantumChestplate",1,W); ItemStack GRAVI_gC=GT_ModHandler.getModItem("GraviSuite","graviChestPlate",1,W); ItemStack GRAVI_anC=GT_ModHandler.getModItem("GraviSuite", "advNanoChestPlate", 1, W); @@ -180,23 +234,140 @@ public final class MainLoader { //todo add GC GS stuff } - private static final class MyCreativeTab extends CreativeTabs { - private MyCreativeTab() {super("TecTech");} + public static void addAfterGregTechPostLoadRunner() { + GregTech_API.sAfterGTPostload.add(new Runnable() { + @Override + public void run() { + if(TecTech.configTecTech.NERF_FUSION) { + FixBrokenFusionRecipes(); + } + GT_MetaTileEntity_EM_collider.setValues(getFuelValue(Materials.Helium.getPlasma(125))); + } + }); + } - @SideOnly(Side.CLIENT) - @Override - public Item getTabIconItem() { - return DebugElementalInstanceContainer_EM.INSTANCE; + private static void FixBrokenFusionRecipes() { + HashMap<Fluid, Fluid> binds = new HashMap<>(); + for (Materials material : Materials.values()) { + FluidStack p = material.getPlasma(1); + if (p != null) { + if (DEBUG_MODE) { + LOGGER.info("Found Plasma of " + material.mName); + } + if (material.mElement != null && + (material.mElement.mProtons >= Materials.Iron.mElement.mProtons || + -material.mElement.mProtons >= Materials.Iron.mElement.mProtons || + material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons || + -material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons)) { + if (DEBUG_MODE) { + LOGGER.info("Attempting to bind " + material.mName); + } + if (material.getMolten(1) != null) { + binds.put(p.getFluid(), material.getMolten(1).getFluid()); + } else if (material.getGas(1) != null) { + binds.put(p.getFluid(), material.getGas(1).getFluid()); + } else if (material.getFluid(1) != null) { + binds.put(p.getFluid(), material.getFluid(1).getFluid()); + } else { + binds.put(p.getFluid(), Materials.Iron.getMolten(1).getFluid()); + } + } + } + } + for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList) { + Fluid fluid = binds.get(r.mFluidOutputs[0].getFluid()); + if (fluid != null) { + if (DEBUG_MODE) { + LOGGER.info("Nerfing Recipe " + r.mFluidOutputs[0].getUnlocalizedName()); + } + r.mFluidOutputs[0] = new FluidStack(fluid, r.mFluidOutputs[0].amount); + } + fluid = binds.get(r.mFluidInputs[0].getFluid()); + if (fluid != null) { + if (DEBUG_MODE) { + LOGGER.info("Fixing plasma use in Recipe " + r.mFluidInputs[0].getUnlocalizedName()); + } + r.mFluidInputs[0] = new FluidStack(fluid, r.mFluidInputs[0].amount); + } + fluid = binds.get(r.mFluidInputs[1].getFluid()); + if (fluid != null) { + if (DEBUG_MODE) { + LOGGER.info("Fixing plasma use in Recipe " + r.mFluidInputs[1].getUnlocalizedName()); + } + r.mFluidInputs[1] = new FluidStack(fluid, r.mFluidInputs[1].amount); + } } + } + + public static int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null || GT_Recipe.GT_Recipe_Map.sTurbineFuels == null) return 0; + FluidStack tLiquid; + Collection<GT_Recipe> tRecipeList = GT_Recipe.GT_Recipe_Map.sPlasmaFuels.mRecipeList; + if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) + if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) + if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue; + return 0; + } - @Override - public void displayAllReleventItems(List stuffToShow) { - for(CustomItemList item: CustomItemList.values()){ - if (item.hasBeenSet() && item.getBlock() == GregTech_API.sBlockMachines) { - stuffToShow.add(item.get(1)); + private static void fixBlocks(){ + HashSet<String> modIDs=new HashSet<>(Arrays.asList( + "minecraft", + "IC2", + "gregtech", + Reference.DREAMCRAFT, + Reference.GTPLUSPLUS, + "GT++DarkWorld", + "GalacticraftCore", + "GalacticraftMars", + "GalaxySpace", + "extracells", + "Avaritia", + "avaritiaddons", + "EnderStorage", + "enhancedportals", + "DraconicEvolution", + "IC2NuclearControl", + "IronChest", + "opensecurity", + "openmodularturrets", + "Railcraft", + "RIO", + "SGCraft", + "appliedenergistics2", + "thaumicenergistics", + "witchery", + "lootgames", + "utilityworlds", + Reference.MODID + )); + for(Block block : GameData.getBlockRegistry().typeSafeIterable()) { + GameRegistry.UniqueIdentifier uniqueIdentifier=GameRegistry.findUniqueIdentifierFor(block); + if (uniqueIdentifier != null) { + if (modIDs.contains(uniqueIdentifier.modId)) {//Full Whitelisted Mods + continue; + } else if ("OpenBlocks".equals(uniqueIdentifier.modId)) { + if ("grave".equals(uniqueIdentifier.name)) { + continue; + } + } else if ("TwilightForest".equals(uniqueIdentifier.modId)){ + if ("tile.TFShield".equals(uniqueIdentifier.name)){ + block.setResistance(30); + continue; + }else if ("tile.TFThorns".equals(uniqueIdentifier.name)){ + block.setResistance(10); + continue; + }else if ("tile.TFTowerTranslucent".equals(uniqueIdentifier.name)){ + block.setResistance(30); + continue; + }else if ("tile.TFDeadrock".equals(uniqueIdentifier.name)) { + block.setResistance(5); + continue; + } else { + continue; + } } } - super.displayAllReleventItems(stuffToShow); + block.setResistance(5); } } } diff --git a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java deleted file mode 100644 index db323ee038..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.github.technus.tectech.loader; - -import com.github.technus.tectech.compatibility.dreamcraft.DreamCraftRecipeLoader; -import com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.elementalMatter.definitions.complex.hadron.dHadronDefinition; -import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import cpw.mods.fml.common.Loader; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; - -import static gregtech.api.enums.GT_Values.RA; - -/** - * Created by danie_000 on 16.11.2016. - */ -public class RecipeLoader implements Runnable { - @Override - public void run() { - dAtomDefinition.setTransformation(); - dHadronDefinition.setTransformations(); - - // =================================================================================================== - // Recipes init - common goes here rest goes into methods below - // =================================================================================================== - - for(int i=0;i<=15;i++) { - RA.addAssemblerRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(i), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cobalt, 1)}, Materials.Aluminium.getMolten(864), new ItemStack(TT_Container_Casings.sHintCasingsTT, 1, i), 32, 120); - } - - if (Loader.isModLoaded("dreamcraft")) { - new DreamCraftRecipeLoader().run();//init recipes for GTNH version - } else { - new BloodyRecipeLoader().run();//init recipes for NON-GTNH version - } - - - } -} diff --git a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java index f5963a070c..468a0c909a 100644 --- a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.auxiliary; +package com.github.technus.tectech.loader; import eu.usrv.yamcore.config.ConfigManager; @@ -9,7 +9,7 @@ public class TecTechConfig extends ConfigManager { super(pConfigBaseDirectory, pModCollectionDirectory, pModID); } - public boolean ModAdminErrorLogs_Enabled; + public boolean modAdminErrorLogs; //final static to allow compiler to remove the debug code when this is false public static boolean DEBUG_MODE = false; @@ -20,9 +20,12 @@ public class TecTechConfig extends ConfigManager { public float TURRET_DAMAGE_FACTOR; public float TURRET_EXPLOSION_FACTOR; + /** + * This loading phases do not correspond to mod loading phases! + */ @Override protected void PreInit() { - ModAdminErrorLogs_Enabled = false; + modAdminErrorLogs = false; EASY_SCAN = false; BOOM_ENABLE = true; NERF_FUSION = false; @@ -31,9 +34,13 @@ public class TecTechConfig extends ConfigManager { TURRET_EXPLOSION_FACTOR = 1; } + + /** + * This loading phases do not correspond to mod loading phases! + */ @Override protected void Init() { - ModAdminErrorLogs_Enabled = _mainConfig.getBoolean("AdminErrorLog", "Modules", ModAdminErrorLogs_Enabled, + modAdminErrorLogs = _mainConfig.getBoolean("AdminErrorLog", "Modules", modAdminErrorLogs, "If set to true, every op/admin will receive all errors occurred during the startup phase as in game message on join"); DEBUG_MODE = _mainConfig.getBoolean("DebugMode", "Debug", DEBUG_MODE, "Enables logging and other purely debug features"); @@ -51,6 +58,9 @@ public class TecTechConfig extends ConfigManager { "Explosion strength is multiplied by this number"); } + /** + * This loading phases do not correspond to mod loading phases! + */ @Override protected void PostInit() { diff --git a/src/main/java/com/github/technus/tectech/loader/EntityLoader.java b/src/main/java/com/github/technus/tectech/loader/entity/EntityLoader.java index 5769a5d5d2..209d7ccd39 100644 --- a/src/main/java/com/github/technus/tectech/loader/EntityLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/entity/EntityLoader.java @@ -1,9 +1,9 @@ -package com.github.technus.tectech.loader; +package com.github.technus.tectech.loader.entity; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles.projectileEM; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.EntityRegistry; -import openmodularturrets.entity.projectiles.projectileEM; /** * Created by Tec on 30.07.2017. diff --git a/src/main/java/com/github/technus/tectech/loader/gui/CreativeTabTecTech.java b/src/main/java/com/github/technus/tectech/loader/gui/CreativeTabTecTech.java new file mode 100644 index 0000000000..295e1aeb7d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/gui/CreativeTabTecTech.java @@ -0,0 +1,51 @@ +package com.github.technus.tectech.loader.gui; + +import com.github.technus.tectech.thing.CustomItemList; +import com.github.technus.tectech.thing.block.QuantumGlassBlock; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.item.ConstructableTriggerItem; +import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; +import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; +import com.github.technus.tectech.thing.item.ParametrizerMemoryCard; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +import java.util.List; + +public class CreativeTabTecTech extends CreativeTabs { + public static CreativeTabTecTech creativeTabTecTech; + + public CreativeTabTecTech(String name) { + super(name); + registerThingsInTabs(); + } + + @SideOnly(Side.CLIENT) + @Override + public Item getTabIconItem() { + return DebugElementalInstanceContainer_EM.INSTANCE; + } + + @Override + public void displayAllReleventItems(List stuffToShow) { + for(CustomItemList item: CustomItemList.values()){ + if (item.hasBeenSet() && item.getBlock() == GregTech_API.sBlockMachines) { + stuffToShow.add(item.get(1)); + } + } + super.displayAllReleventItems(stuffToShow); + } + + private static void registerThingsInTabs() { + QuantumGlassBlock.INSTANCE.setCreativeTab(creativeTabTecTech); + TT_Container_Casings.sBlockCasingsTT.setCreativeTab(creativeTabTecTech); + TT_Container_Casings.sHintCasingsTT.setCreativeTab(creativeTabTecTech); + DebugElementalInstanceContainer_EM.INSTANCE.setCreativeTab(creativeTabTecTech); + ConstructableTriggerItem.INSTANCE.setCreativeTab(creativeTabTecTech); + ParametrizerMemoryCard.INSTANCE.setCreativeTab(creativeTabTecTech); + ElementalDefinitionScanStorage_EM.INSTANCE.setCreativeTab(creativeTabTecTech); + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/ModGuiHandler.java b/src/main/java/com/github/technus/tectech/loader/gui/ModGuiHandler.java index 5a3ca7a877..e3314fccd9 100644 --- a/src/main/java/com/github/technus/tectech/loader/ModGuiHandler.java +++ b/src/main/java/com/github/technus/tectech/loader/gui/ModGuiHandler.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.loader; +package com.github.technus.tectech.loader.gui; import com.github.technus.tectech.thing.item.gui.ScanDisplayScreen; import cpw.mods.fml.common.network.IGuiHandler; diff --git a/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java b/src/main/java/com/github/technus/tectech/loader/mechanics/ElementalLoader.java index ec321fd3b8..a2ea8c60de 100644 --- a/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/mechanics/ElementalLoader.java @@ -1,12 +1,12 @@ -package com.github.technus.tectech.loader; - -import com.github.technus.tectech.compatibility.thaumcraft.definitions.dComplexAspectDefinition; -import com.github.technus.tectech.compatibility.thaumcraft.definitions.ePrimalAspectDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; -import com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.elementalMatter.definitions.complex.atom.iaeaNuclide; -import com.github.technus.tectech.elementalMatter.definitions.complex.hadron.dHadronDefinition; -import com.github.technus.tectech.elementalMatter.definitions.primitive.*; +package com.github.technus.tectech.loader.mechanics; + +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.iaeaNuclide; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.*; /** * Created by danie_000 on 16.11.2016. diff --git a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index e24b9cbf42..6e3a95aaad 100644 --- a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -1,13 +1,15 @@ -package com.github.technus.tectech.loader; +package com.github.technus.tectech.loader.recipe; import com.github.technus.tectech.recipe.TT_recipeAdder; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.item.ConstructableTriggerItem; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_Centrifuge; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_ElectromagneticSeparator; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; -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 net.minecraft.init.Blocks; @@ -21,28 +23,33 @@ import net.minecraftforge.fluids.FluidStack; public class BloodyRecipeLoader implements Runnable { @Override public void run() { - //todo fix recipes (of assembler) - //Quantum Glass GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Containment.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L) }, Materials.Osmium.getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); - //BLUEprint - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ConstructableTriggerItem.INSTANCE, 1), - GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{Dyes.dyeBlue, OrePrefixes.plate.get(Materials.Paper), Dyes.dyeBlue, Dyes.dyeWhite}); - //region pipes //Data GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ ItemList.Circuit_Parts_GlassFiber.get(8), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8) + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Silver, 6) }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720); //endregion + + //Tunnel + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.DATApipe.get(1), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmiridium, 4), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 4), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 2), + ItemList.Field_Generator_MV.get(1), + ItemList.Circuit_Quantummainframe.get(1) + }, Materials.Osmium.getMolten(288), CustomItemList.EMpipe.get(1), 400, 491520); + + //endregoin //region casing @@ -52,7 +59,7 @@ public class BloodyRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 6), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 1), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 16), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Cobalt, 16), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 16), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) }, Materials.TungstenSteel.getMolten(576), CustomItemList.eM_Power.get(1), 100, 30720); @@ -77,7 +84,7 @@ public class BloodyRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Cobalt, 32), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 64), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 4) }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1), 200, 122880); @@ -85,55 +92,221 @@ public class BloodyRecipeLoader implements Runnable { //Molecular Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Power.get(1), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmiridium, 16), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 12), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.TungstenSteel, 24), ItemList.Field_Generator_IV.get(1) }, Materials.Osmium.getMolten(1296), CustomItemList.eM_Containment.get(1), 800, 500000); + //Hollow Casing + TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Containment.get(1), + 12000,32, 500000, 6, new ItemStack[]{ + CustomItemList.eM_Containment.get(1), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Plutonium, 2), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Lead, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Americium, 16), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 16), + }, new FluidStack[]{ + Materials.Americium.getMolten(1296), + Materials.Osmium.getMolten(1296), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + Materials.Argon.getGas(576), + }, CustomItemList.eM_Hollow.get(2), 200, 2000000); + + //EM Coil + TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Hollow.get(1), + 48000,128, 1000000, 16, new ItemStack[]{ + CustomItemList.eM_Hollow.get(1), + ItemList.Casing_Fusion_Coil.get(4), + ItemList.Casing_Coil_NaquadahAlloy.get( 4), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Americium, 16), + }, new FluidStack[]{ + Materials.Glass.getMolten(2304), + Materials.Silicone.getMolten(1872), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + Materials.Americium.getMolten(1296), + }, CustomItemList.eM_Coil.get(4), 800, 2000000); + //endregion //region hatches //Dynamo Hatches IV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Tungsten, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2)}, Materials.Silver.getMolten(144), CustomItemList.eM_dynamomulti4_IV.get(1), 100, 1920); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Tungsten, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 4)}, Materials.Electrum.getMolten(144), CustomItemList.eM_dynamomulti16_IV.get(1), 200, 1920); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Tungsten, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6)}, Materials.Tungsten.getMolten(144), CustomItemList.eM_dynamomulti64_IV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Dynamo_IV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Tungsten, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2)}, + Materials.Silver.getMolten(144), + CustomItemList.eM_dynamomulti4_IV.get(1), 100, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti4_IV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Tungsten, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 4)}, + Materials.Electrum.getMolten(144), + CustomItemList.eM_dynamomulti16_IV.get(1), 200, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti16_IV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Tungsten, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6)}, + Materials.Tungsten.getMolten(144), + CustomItemList.eM_dynamomulti64_IV.get(1), 400, 1920); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 2)}, Materials.Silver.getMolten(288), CustomItemList.eM_dynamomulti4_LuV.get(1), 100, 7860); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 4)}, Materials.Electrum.getMolten(288), CustomItemList.eM_dynamomulti16_LuV.get(1), 200, 7860); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 6)}, Materials.Tungsten.getMolten(288), CustomItemList.eM_dynamomulti64_LuV.get(1), 400, 7860); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Dynamo_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 2)}, + Materials.Silver.getMolten(288), + CustomItemList.eM_dynamomulti4_LuV.get(1), 100, 7860); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti4_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 4)}, + Materials.Electrum.getMolten(288), + CustomItemList.eM_dynamomulti16_LuV.get(1), 200, 7860); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti16_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 6)}, + Materials.Tungsten.getMolten(288), + CustomItemList.eM_dynamomulti64_LuV.get(1), 400, 7860); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2)}, Materials.Silver.getMolten(576), CustomItemList.eM_dynamomulti4_ZPM.get(1), 100, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4)}, Materials.Electrum.getMolten(576), CustomItemList.eM_dynamomulti16_ZPM.get(1), 200, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 6)}, Materials.Tungsten.getMolten(576), CustomItemList.eM_dynamomulti64_ZPM.get(1), 400, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Dynamo_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2)}, + Materials.Silver.getMolten(576), + CustomItemList.eM_dynamomulti4_ZPM.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti4_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4)}, + Materials.Electrum.getMolten(576), + CustomItemList.eM_dynamomulti16_ZPM.get(1), 200, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti16_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 6)}, + Materials.Tungsten.getMolten(576), + CustomItemList.eM_dynamomulti64_ZPM.get(1), 400, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1152), CustomItemList.eM_dynamomulti4_UV.get(1), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1152), CustomItemList.eM_dynamomulti16_UV.get(1), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1152), CustomItemList.eM_dynamomulti64_UV.get(1), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Dynamo_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, + Materials.Silver.getMolten(1152), + CustomItemList.eM_dynamomulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti4_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, + Materials.Electrum.getMolten(1152), + CustomItemList.eM_dynamomulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti16_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, + Materials.Tungsten.getMolten(1152), + CustomItemList.eM_dynamomulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2304), CustomItemList.eM_dynamomulti4_UHV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2304), CustomItemList.eM_dynamomulti16_UHV.get(1), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2304), CustomItemList.eM_dynamomulti64_UHV.get(1), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Dynamo_MAX.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, + Materials.Silver.getMolten(2304), + CustomItemList.eM_dynamomulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti4_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, + Materials.Electrum.getMolten(2304), + CustomItemList.eM_dynamomulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti16_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, + Materials.Tungsten.getMolten(2304), + CustomItemList.eM_dynamomulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, Materials.Silver.getMolten(4608), CustomItemList.eM_dynamomulti4_UEV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_dynamomulti16_UEV.get(1), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_dynamomulti64_UEV.get(1), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Dynamo_MAX.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, + Materials.Silver.getMolten(4608), + CustomItemList.eM_dynamomulti4_UEV.get(1), 500, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti4_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, + Materials.Electrum.getMolten(4608), + CustomItemList.eM_dynamomulti16_UEV.get(1), 1000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_dynamomulti16_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, + Materials.Tungsten.getMolten(4608), + CustomItemList.eM_dynamomulti64_UEV.get(1), 2000, 500000); //Energy Hatches UV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1152), CustomItemList.eM_energymulti4_UV.get(1), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1152), CustomItemList.eM_energymulti16_UV.get(1), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1152), CustomItemList.eM_energymulti64_UV.get(1), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Energy_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, + Materials.Silver.getMolten(1152), + CustomItemList.eM_energymulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_energymulti4_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, + Materials.Electrum.getMolten(1152), + CustomItemList.eM_energymulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_energymulti16_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, + Materials.Tungsten.getMolten(1152), + CustomItemList.eM_energymulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2304), CustomItemList.eM_energymulti4_UHV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2304), CustomItemList.eM_energymulti16_UHV.get(1), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2304), CustomItemList.eM_energymulti64_UHV.get(1), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Energy_MAX.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, + Materials.Silver.getMolten(2304), + CustomItemList.eM_energymulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_energymulti4_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, + Materials.Electrum.getMolten(2304), + CustomItemList.eM_energymulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_energymulti16_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, + Materials.Tungsten.getMolten(2304), + CustomItemList.eM_energymulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, Materials.Silver.getMolten(4608), CustomItemList.eM_energymulti4_UEV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_energymulti16_UEV.get(1), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Energy_MAX.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, + Materials.Silver.getMolten(4608), + CustomItemList.eM_energymulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_energymulti4_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, + Materials.Electrum.getMolten(4608), + CustomItemList.eM_energymulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_energymulti16_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, + Materials.Tungsten.getMolten(4608), + CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); //Data Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ @@ -167,7 +340,7 @@ public class BloodyRecipeLoader implements Runnable { ItemList.Electric_Motor_ZPM.get(2), ItemList.Circuit_Crystalmainframe.get(1), GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 2), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Naquadah, 16), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 16), CustomItemList.DATApipe.get(2), }, new FluidStack[]{ Materials.UUMatter.getFluid(500), @@ -196,21 +369,21 @@ public class BloodyRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Containment.get(1), ItemList.Hatch_Input_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Naquadah, 8), ItemList.Sensor_UV.get(1) }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_in_UV.get(1), 800, 500000); //Elemental Output GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Containment.get(1), ItemList.Hatch_Output_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Naquadah, 8), ItemList.Emitter_UV.get(1) }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_out_UV.get(1), 800, 500000); //Overflow GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Containment.get(1), ItemList.Hatch_Muffler_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Naquadah, 1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Naquadah, 4), ItemList.Field_Generator_UV.get(1) }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1), 800, 500000); @@ -240,8 +413,8 @@ public class BloodyRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), ItemList.Circuit_Ultimatecrystalcomputer.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Cobalt, 32), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Copper, 32), CustomItemList.DATApipe.get(4), }, Materials.Iridium.getMolten(1296), CustomItemList.Machine_Multi_Switch.get(1), 800, 122880); @@ -268,7 +441,7 @@ public class BloodyRecipeLoader implements Runnable { ItemList.Field_Generator_ZPM.get(1), ItemList.Electric_Motor_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 4), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Naquadah, 32), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 32), CustomItemList.DATApipe.get(16), }, new FluidStack[]{ Materials.UUMatter.getFluid(1000), @@ -281,7 +454,7 @@ public class BloodyRecipeLoader implements Runnable { TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Switch.get(1), 8000,32, 500000, 4, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Naquadah, 16), ItemList.Robot_Arm_LuV.get(2), ItemList.Electric_Piston_LuV.get(2), ItemList.Circuit_Wetwaresupercomputer.get(2), @@ -297,7 +470,7 @@ public class BloodyRecipeLoader implements Runnable { TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Input_UV.get(1), 12000,32, 500000, 6, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Naquadah, 16), ItemList.Emitter_UV.get(2), ItemList.Circuit_Wetwaresupercomputer.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 2), @@ -312,7 +485,7 @@ public class BloodyRecipeLoader implements Runnable { TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Output_UV.get(1), 12000,32, 500000, 6, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Naquadah, 16), ItemList.Sensor_UV.get(2), ItemList.Circuit_Wetwaresupercomputer.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 2), @@ -327,10 +500,10 @@ public class BloodyRecipeLoader implements Runnable { TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_MatterToEM.get(1), 15000,32, 500000, 8, new ItemStack[]{ CustomItemList.Machine_Multi_MatterToEM.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Neutronium, 4), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), ItemList.Emitter_UV.get(2), ItemList.Circuit_Wetwaresupercomputer.get(1), - GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), }, new FluidStack[]{ Materials.UUMatter.getFluid(2000), Materials.Void.getMolten(2592), @@ -342,10 +515,10 @@ public class BloodyRecipeLoader implements Runnable { TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_EMToMatter.get(1), 15000,32, 500000, 8, new ItemStack[]{ CustomItemList.Machine_Multi_EMToMatter.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Neutronium, 4), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), ItemList.Sensor_UV.get(2), ItemList.Circuit_Wetwaresupercomputer.get(1), - GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), }, new FluidStack[]{ Materials.UUMatter.getFluid(2000), Materials.Void.getMolten(2592), @@ -362,15 +535,37 @@ public class BloodyRecipeLoader implements Runnable { ItemList.Sensor_UV.get(4), ItemList.Circuit_Wetwaresupercomputer.get(4),//? GT_OreDictUnificator.get(OrePrefixes.lens,Materials.Diamond,32), - GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Superconductor, 16), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 16), }, new FluidStack[]{ Materials.UUMatter.getFluid(2000), Materials.Neutronium.getMolten(2592), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 4000), Materials.Osmiridium.getMolten(1296), }, CustomItemList.Machine_Multi_Scanner.get(1), 24000, 500000); + + //Multi Infuser + TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Transformer.get(1), + 192000,512, 2000000, 32, new ItemStack[]{ + CustomItemList.Machine_Multi_Transformer.get(1), + CustomItemList.eM_Coil.get(8), + CustomItemList.eM_Power.get( 8), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.NeodymiumMagnetic, 16), + }, new FluidStack[]{ + Materials.Electrum.getMolten(2592), + Materials.Neutronium.getMolten(1872), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + }, CustomItemList.Machine_Multi_Infuser.get(1), 8000, 2000000); + //endregion + //ha trafos + //if(Loader.isModLoaded(Reference.GTPLUSPLUS)){ + // GT_Values.RA.addAssemblerRecipe(CustomItemList.HA) + //} + + //power trafos + //GT_Values.RA.addAssemblerRecipe() + register_machine_EM_behaviours(); } diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java new file mode 100644 index 0000000000..56f461eeb5 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java @@ -0,0 +1,117 @@ +package com.github.technus.tectech.loader.recipe; + +import com.github.technus.tectech.Reference; +import com.github.technus.tectech.compatibility.dreamcraft.DreamCraftRecipeLoader; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.thing.CustomItemList; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.item.ConstructableTriggerItem; +import com.github.technus.tectech.thing.item.EuMeterGT; +import com.github.technus.tectech.thing.item.FrontRotationTriggerItem; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +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.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import static gregtech.api.enums.GT_Values.RA; + +/** + * Created by danie_000 on 16.11.2016. + */ +public class RecipeLoader implements Runnable { + public static Materials getOrDefault(String name,Materials def){ + Materials mat=Materials.get(name); + return mat == Materials._NULL || mat == null ? def : mat; + } + + @Override + public void run() { + dAtomDefinition.setTransformation(); + dHadronDefinition.setTransformations(); + + // =================================================================================================== + // Recipes init - common goes here rest goes into methods below + // =================================================================================================== + + for(int i=0;i<=15;i++) { + RA.addAssemblerRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(i), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cobalt, 1)}, Materials.Aluminium.getMolten(864), new ItemStack(TT_Container_Casings.sHintCasingsTT, 1, i), 32, 120); + } + + //Scrench + GT_ModHandler.addCraftingRecipe(new ItemStack(FrontRotationTriggerItem.INSTANCE,1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"fPR", " RP", "S h", + 'P', OrePrefixes.plate.get(Materials.Cobalt), + 'R', OrePrefixes.stick.get(Materials.Cobalt), + 'S', OrePrefixes.stick.get(Materials.Wood),}); + + //BLUEprint + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ConstructableTriggerItem.INSTANCE, 1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{Dyes.dyeBlue, OrePrefixes.plate.get(Materials.Paper), Dyes.dyeBlue, Dyes.dyeWhite}); + + //GT EU reader + GT_ModHandler.addCraftingRecipe(new ItemStack(EuMeterGT.INSTANCE,1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"PGW", "SCW", "BRN", + 'P', OrePrefixes.plateDouble.get(Materials.Steel), + 'G', OrePrefixes.plate.get(Materials.Glass), + 'W', OrePrefixes.cableGt01.get(Materials.Copper), + 'S', OrePrefixes.stick.get(Materials.Brass), + 'C', ItemList.Casing_Coil_Cupronickel.get(1), + 'B', Dyes.dyeBlue, + 'R', Dyes.dyeRed, + 'N', Dyes.dyeBlack,}); + + //Owner detector + GT_ModHandler.addCraftingRecipe(CustomItemList.Machine_OwnerDetector.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"PPP","GEG","PPP", + 'P', OrePrefixes.plate.get(Materials.IronMagnetic), + 'G', OrePrefixes.plate.get(Materials.Glass), + 'E', OrePrefixes.gem.get(Materials.EnderPearl)}); + + //Data reader + GT_ModHandler.addCraftingRecipe(CustomItemList.Machine_DataReader.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"BdB","GES","PwP", + 'B', OrePrefixes.screw.get(Materials.Iridium), + 'P', OrePrefixes.plate.get(Materials.Iridium), + 'G', ItemList.Cover_Screen, + 'S', OrePrefixes.circuit.get(Materials.Elite), + 'E', ItemList.Hull_IV}); + + //Data Bank + RA.addAssemblylineRecipe(ItemList.Hatch_DataAccess_EV.get(1), 20000, new ItemStack[]{ + CustomItemList.Machine_Multi_Switch.get(1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), + ItemList.Tool_DataOrb.get(1), + ItemList.Cover_Screen.get(1), + }, new FluidStack[]{ + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + Materials.Hydrogen.getGas(1000), + }, CustomItemList.Machine_Multi_DataBank.get(1), 12000, 14000); + //CustomItemList.Machine_Multi_DataBank + + //Bucks + //RA.addAssemblerRecipe(CustomItemList.) + + //recipe for ass line data hatches + RA.addAssemblerRecipe(ItemList.Hatch_DataAccess_EV.get(1), CustomItemList.dataIn_Hatch.get(1), CustomItemList.dataInAss_Hatch.get(1), 2048, 12000); + RA.addAssemblerRecipe(ItemList.Hatch_DataAccess_EV.get(1), CustomItemList.dataOut_Hatch.get(1), CustomItemList.dataOutAss_Hatch.get(1), 2048, 12000); + + if (Loader.isModLoaded(Reference.DREAMCRAFT)) { + new DreamCraftRecipeLoader().run();//init recipes for GTNH version + } else { + new BloodyRecipeLoader().run();//init recipes for NON-GTNH version + } + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/thing/ComponentLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/ComponentLoader.java new file mode 100644 index 0000000000..39b42c1249 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/thing/ComponentLoader.java @@ -0,0 +1,26 @@ +package com.github.technus.tectech.loader.thing; + +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.IMaterialHandler; + +public class ComponentLoader implements IMaterialHandler { + public ComponentLoader(){ + Materials.add(this); + } + + @Override + public void onComponentInit() { + //example + //OrePrefixes.ring.enableComponent(Materials.RedAlloy); + } + + @Override + public void onComponentIteration(Materials materials) { + + } + + @Override + public void onMaterialsInit() { + + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index c42332730f..c1b78523c5 100644 --- a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -1,5 +1,7 @@ -package com.github.technus.tectech.loader; +package com.github.technus.tectech.loader.thing; +import com.github.technus.tectech.Reference; +import com.github.technus.tectech.compatibility.dreamcraft.NoDreamCraftMachineLoader; import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_essentiaDequantizer; import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_essentiaQuantizer; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; @@ -8,8 +10,8 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEnt import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM; -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPowerGenerator; -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugStructureWriter; +import com.github.technus.tectech.thing.metaTileEntity.single.*; +import cpw.mods.fml.common.Loader; import static com.github.technus.tectech.thing.CustomItemList.*; @@ -229,7 +231,8 @@ public class MachineLoader implements Runnable { Machine_Multi_Switch.set(new GT_MetaTileEntity_EM_switch(15310, "multimachine.em.switch", "Network Switch With QoS").getStackForm(1L)); Machine_Multi_Computer.set(new GT_MetaTileEntity_EM_computer(15311, "multimachine.em.computer", "Quantum Computer").getStackForm(1L)); Machine_Multi_Microwave.set(new GT_MetaTileEntity_TM_microwave(15312, "multimachine.tm.microwave", "Microwave Grinder").getStackForm(1L)); - Machine_Multi_teslaCoil.set(new GT_MetaTileEntity_TM_teslaCoil(15313, "multimachine.tm.teslaCoil", "Tesla Coil").getStackForm(1L)); + Machine_Multi_DataBank.set(new GT_MetaTileEntity_EM_dataBank(15313, "multimachine.em.databank", "Data Bank").getStackForm(1L)); + Machine_Multi_teslaCoil.set(new GT_MetaTileEntity_TM_teslaCoil(15314, "multimachine.tm.teslaCoil", "Tesla Coil").getStackForm(1L)); Machine_Multi_EMjunction.set(new GT_MetaTileEntity_EM_junction(15320, "multimachine.em.junction", "Matter Junction").getStackForm(1L)); Machine_Multi_MatterToEM.set(new GT_MetaTileEntity_EM_quantizer(15321, "multimachine.em.mattertoem", "Matter Quantizer").getStackForm(1L)); @@ -270,6 +273,8 @@ public class MachineLoader implements Runnable { dataIn_Hatch.set(new GT_MetaTileEntity_Hatch_InputData(15440, "hatch.datain.tier.07", "Optical Slave Connector", 7).getStackForm(1L)); dataOut_Hatch.set(new GT_MetaTileEntity_Hatch_OutputData(15441, "hatch.dataout.tier.07", "Optical Master Connector", 7).getStackForm(1L)); + dataInAss_Hatch.set(new GT_MetaTileEntity_Hatch_InputDataItems(15442, "hatch.datainass.tier.07", "Assembly line Slave Connector", 7).getStackForm(1L)); + dataOutAss_Hatch.set(new GT_MetaTileEntity_Hatch_OutputDataItems(15443, "hatch.dataoutass.tier.07", "Data Bank Master Connector", 7).getStackForm(1L)); rack_Hatch.set(new GT_MetaTileEntity_Hatch_Rack(15450, "hatch.rack.tier.08", "Computer Rack", 8, "4 Slot Rack").getStackForm(1L)); holder_Hatch.set(new GT_MetaTileEntity_Hatch_Holder(15451, "hatch.holder.tier.09", "Object Holder", 8, "For Research Station").getStackForm(1L)); @@ -285,6 +290,23 @@ public class MachineLoader implements Runnable { DATApipe.set(new GT_MetaTileEntity_Pipe_Data(15470, "pipe.datastream", "Optical Fiber Cable").getStackForm(1L)); // =================================================================================================== + // Single Blocks + // =================================================================================================== + + Machine_OwnerDetector.set(new GT_MetaTileEntity_OwnerDetector(15480, "machine.tt.ownerdetector", "Owner detector", 3).getStackForm(1L)); + Machine_DataReader.set(new GT_MetaTileEntity_DataReader(15481, "machine.tt.datareader", "Data Reader", 5).getStackForm(1L)); + + Machine_BuckConverter_IV.set(new GT_MetaTileEntity_BuckConverter(15485, "machine.tt.buck.05", "Insane Buck Converter", 5).getStackForm(1L)); + Machine_BuckConverter_LuV.set(new GT_MetaTileEntity_BuckConverter(15486, "machine.tt.buck.06", "Ludicrous Buck Converter", 6).getStackForm(1L)); + Machine_BuckConverter_ZPM.set(new GT_MetaTileEntity_BuckConverter(15487, "machine.tt.buck.07", "ZPM Voltage Buck Converter", 7).getStackForm(1L)); + Machine_BuckConverter_UV.set(new GT_MetaTileEntity_BuckConverter(15488, "machine.tt.buck.08", "Ultimate Power Buck Converter", 8).getStackForm(1L)); + Machine_BuckConverter_UHV.set(new GT_MetaTileEntity_BuckConverter(15489, "machine.tt.buck.09", "Highly Ultimate Buck Converter", 9).getStackForm(1L)); + Machine_BuckConverter_UEV.set(new GT_MetaTileEntity_BuckConverter(15490, "machine.tt.buck.10", "Extremely Ultimate Buck Converter", 10).getStackForm(1L)); + Machine_BuckConverter_UIV.set(new GT_MetaTileEntity_BuckConverter(15491, "machine.tt.buck.11", "Insanely Ultimate Buck Converter", 11).getStackForm(1L)); + Machine_BuckConverter_UMV.set(new GT_MetaTileEntity_BuckConverter(15492, "machine.tt.buck.12", "Mega Ultimate Buck Converter", 12).getStackForm(1L)); + Machine_BuckConverter_UXV.set(new GT_MetaTileEntity_BuckConverter(15493, "machine.tt.buck.13", "Extended Mega Ultimate Buck Converter", 13).getStackForm(1L)); + + // =================================================================================================== // Debug Stuff // =================================================================================================== hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance Hatch", 15).getStackForm(1L)); @@ -299,6 +321,13 @@ public class MachineLoader implements Runnable { GT_MetaTileEntity_Hatch_Rack.run(); GT_MetaTileEntity_EM_computer.run(); GT_MetaTileEntity_EM_research.run(); + GT_MetaTileEntity_EM_dataBank.run(); GT_MetaTileEntity_TM_teslaCoil.run(); + + GT_MetaTileEntity_DataReader.run(); + + if (!Loader.isModLoaded(Reference.DREAMCRAFT)) { + new NoDreamCraftMachineLoader().run(); + } } } diff --git a/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java index 5906f3d3de..b422688a70 100644 --- a/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java @@ -1,9 +1,13 @@ -package com.github.technus.tectech.loader; +package com.github.technus.tectech.loader.thing; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretbases.TurretBaseEM; +import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretheads.TurretHeadEM; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.block.ReactorSimBlock; +import com.github.technus.tectech.thing.casing.GT_Block_CasingsNH; import com.github.technus.tectech.thing.casing.GT_Block_CasingsTT; import com.github.technus.tectech.thing.casing.GT_Block_HintTT; import com.github.technus.tectech.thing.casing.TT_Container_Casings; @@ -11,8 +15,6 @@ import com.github.technus.tectech.thing.item.*; import cpw.mods.fml.common.Loader; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; -import openmodularturrets.blocks.turretbases.TurretBaseEM; -import openmodularturrets.blocks.turretheads.TurretHeadEM; import static com.github.technus.tectech.TecTech.tectechTexturePage1; @@ -25,35 +27,41 @@ public class ThingsLoader implements Runnable { if(Textures.BlockIcons.casingTexturePages[tectechTexturePage1]==null) { Textures.BlockIcons.casingTexturePages[tectechTexturePage1] = new ITexture[128]; } - TecTech.Logger.info("Added texture page if was null"); + if(!Loader.isModLoaded(Reference.DREAMCRAFT)){ + TecTech.LOGGER.info("Adding basic casings"); + TT_Container_Casings.sBlockCasingsNH = new GT_Block_CasingsNH(); + } + TecTech.LOGGER.info("Added texture page if was null"); TT_Container_Casings.sBlockCasingsTT = new GT_Block_CasingsTT(); - TecTech.Logger.info("Elemental Casing registered"); + TecTech.LOGGER.info("Elemental Casing registered"); TT_Container_Casings.sHintCasingsTT = new GT_Block_HintTT(); - TecTech.Logger.info("Hint Blocks registered"); + TecTech.LOGGER.info("Hint Blocks registered"); QuantumGlassBlock.run(); - TecTech.Logger.info("Quantum Glass registered"); + TecTech.LOGGER.info("Quantum Glass registered"); QuantumStuffBlock.run(); - TecTech.Logger.info("Quantum Stuff registered"); + TecTech.LOGGER.info("Quantum Stuff registered"); if(Loader.isModLoaded("openmodularturrets")) { TurretHeadEM.run(); - TecTech.Logger.info("TurretHeadEM registered"); + TecTech.LOGGER.info("TurretHeadEM registered"); TurretBaseEM.run(); - TecTech.Logger.info("TurretBaseEM registered"); + TecTech.LOGGER.info("TurretBaseEM registered"); } ReactorSimBlock.run(); - TecTech.Logger.info("Reactor Simulator registered"); + TecTech.LOGGER.info("Reactor Simulator registered"); ConstructableTriggerItem.run(); + FrontRotationTriggerItem.run(); ParametrizerMemoryCard.run(); ElementalDefinitionScanStorage_EM.run(); - TecTech.Logger.info("Useful Items registered"); + EuMeterGT.run(); + TecTech.LOGGER.info("Useful Items registered"); ElementalDefinitionContainer_EM.run(); DebugElementalInstanceContainer_EM.run(); - TecTech.Logger.info("Debug Items registered"); + TecTech.LOGGER.info("Debug Items registered"); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/ConvertFloat.java b/src/main/java/com/github/technus/tectech/mechanics/ConvertFloat.java new file mode 100644 index 0000000000..8e25b8908a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/ConvertFloat.java @@ -0,0 +1,76 @@ +package com.github.technus.tectech.mechanics; + +import com.github.technus.tectech.Util; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.util.ArrayList; +import java.util.List; + +public class ConvertFloat implements ICommand { + ArrayList<String> aliases=new ArrayList<>(); + + public ConvertFloat(){ + aliases.add("convert_float"); + aliases.add("c_f"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!sender.getEntityWorld().isRemote) { + if(args.length == 1) { + try{ + float value=Float.parseFloat(args[0]); + sender.addChatMessage(new ChatComponentText( + EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + + Util.intBitsToShortString(Float.floatToIntBits(value))+" "+ + EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); + }catch (Exception e){ + sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Float "+args[0])); + } + }else{ + sender.addChatMessage(new ChatComponentText(getCommandUsage(sender))); + } + } + } + + @Override + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + @Override + public List<String> getCommandAliases() { + return aliases; + } + + @Override + public String getCommandName() { + return aliases.get(0); + } + + @Override + public List<String> addTabCompletionOptions(ICommandSender sender, String[] args) { + return null; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "c_f Float"; + } + + @Override + public int compareTo(Object o) { + if(o instanceof ICommand){ + return getCommandName().compareTo(((ICommand) o).getCommandName()); + } + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/ConvertInteger.java b/src/main/java/com/github/technus/tectech/mechanics/ConvertInteger.java new file mode 100644 index 0000000000..c381f34939 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/ConvertInteger.java @@ -0,0 +1,76 @@ +package com.github.technus.tectech.mechanics; + +import com.github.technus.tectech.Util; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.util.ArrayList; +import java.util.List; + +public class ConvertInteger implements ICommand { + ArrayList<String> aliases=new ArrayList<>(); + + public ConvertInteger(){ + aliases.add("convert_integer"); + aliases.add("c_i"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!sender.getEntityWorld().isRemote) { + if(args.length == 1) { + try{ + int value=Integer.parseInt(args[0]); + sender.addChatMessage(new ChatComponentText( + EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + + Util.intBitsToShortString(value)+" "+ + EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); + }catch (Exception e){ + sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Integer "+args[0])); + } + }else{ + sender.addChatMessage(new ChatComponentText(getCommandUsage(sender))); + } + } + } + + @Override + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + @Override + public List<String> getCommandAliases() { + return aliases; + } + + @Override + public String getCommandName() { + return aliases.get(0); + } + + @Override + public List<String> addTabCompletionOptions(ICommandSender sender, String[] args) { + return null; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "c_i Integer"; + } + + @Override + public int compareTo(Object o) { + if(o instanceof ICommand){ + return getCommandName().compareTo(((ICommand) o).getCommandName()); + } + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java new file mode 100644 index 0000000000..82234e4c75 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java @@ -0,0 +1,106 @@ +package com.github.technus.tectech.mechanics.dataTransport; + +import com.github.technus.tectech.Vec3pos; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; + +/** + * Created by Tec on 05.04.2017. + */ +public abstract class DataPacket<T>{ + private static final byte MAX_HISTORY = 64; + private Set<Vec3pos> trace = new LinkedHashSet<>(); + + protected T content; + + protected DataPacket(T content){ + this.content=content; + } + + protected DataPacket(NBTTagCompound nbt) { + content = contentFromNBT(nbt.getCompoundTag("qContent")); + for (int i = 0; i < nbt.getByte("qHistory"); i++) { + trace.add(new Vec3pos( + nbt.getInteger("qX" + i), + nbt.getShort("qY" + i), + nbt.getInteger("qZ" + i) + )); + } + } + + public final NBTTagCompound toNbt() { + NBTTagCompound nbt = new NBTTagCompound(); + NBTTagCompound contentTag=contentToNBT(); + if(contentTag!=null) { + nbt.setTag("qContent", contentTag); + } + nbt.setByte("qHistory", (byte) trace.size()); + int i = 0; + for (Vec3pos v : trace) { + nbt.setInteger("qX" + i, v.x); + nbt.setShort("qY" + i, v.y); + nbt.setInteger("qZ" + i, v.z); + i++; + } + return nbt; + } + + protected abstract NBTTagCompound contentToNBT(); + + protected abstract T contentFromNBT(NBTTagCompound nbt); + + protected abstract T unifyContentWith(T content); + + public final boolean contains(Vec3pos v) { + return trace.contains(v); + } + + public final boolean check() { + return trace.size() <= MAX_HISTORY; + } + + public abstract boolean extraCheck(); + + protected final DataPacket<T> unifyTrace(Vec3pos... positions) { + Collections.addAll(trace,positions); + return (check() && extraCheck()) ? this : null; + } + + protected final DataPacket<T> unifyTrace(DataPacket<T> p) { + if(p==null) return this; + trace.addAll(p.trace); + return (check() && extraCheck()) ? this : null; + } + + protected final DataPacket<T> unifyWith(DataPacket<T> p) { + if(p==null) return this; + trace.addAll(p.trace); + if(check() && extraCheck()){ + content=unifyContentWith(p.content); + return this; + } + return null; + } + + public final T contentIfNotInTrace(Vec3pos pos) { + if (trace.contains(pos)) { + return null; + } + return getContent(); + } + + public T getContent(){ + return content; + } + + public String getContentString(){ + return content.toString(); + } + + public final int getTraceSize(){ + return trace.size(); + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/dataTransport/InventoryDataPacket.java b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/InventoryDataPacket.java new file mode 100644 index 0000000000..9fb2fed082 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/InventoryDataPacket.java @@ -0,0 +1,59 @@ +package com.github.technus.tectech.mechanics.dataTransport; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.ArrayList; + +public class InventoryDataPacket extends DataPacket<ItemStack[]> { + public InventoryDataPacket(ItemStack[] content){ + super(content); + } + + public InventoryDataPacket(NBTTagCompound compound){ + super(compound); + } + + @Override + protected ItemStack[] contentFromNBT(NBTTagCompound nbt) { + int count=nbt.getInteger("count"); + if(count>0){ + ArrayList<ItemStack> stacks=new ArrayList<>(); + for(int i=0;i<count;i++){ + ItemStack stack=ItemStack.loadItemStackFromNBT(nbt.getCompoundTag(Integer.toString(i))); + if(stack!=null){ + stacks.add(stack); + } + } + return stacks.size()>0?stacks.toArray(new ItemStack[0]):null; + } + return null; + } + + @Override + protected NBTTagCompound contentToNBT() { + NBTTagCompound compound=new NBTTagCompound(); + if(content!=null && content.length>0){ + compound.setInteger("count",content.length); + for(int i=0;i<content.length;i++){ + compound.setTag(Integer.toString(i),content[i].writeToNBT(new NBTTagCompound())); + } + } + return compound; + } + + @Override + public boolean extraCheck() { + return true; + } + + @Override + protected ItemStack[] unifyContentWith(ItemStack[] content) { + throw new NoSuchMethodError("Unavailable to unify item stack data packet"); + } + + @Override + public String getContentString() { + return "Stack Count: "+(content==null?0:content.length); + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java new file mode 100644 index 0000000000..9661d8d315 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java @@ -0,0 +1,48 @@ +package com.github.technus.tectech.mechanics.dataTransport; + +import com.github.technus.tectech.Vec3pos; +import net.minecraft.nbt.NBTTagCompound; + +public class QuantumDataPacket extends DataPacket<Long> { + public QuantumDataPacket(Long content){ + super(content); + } + + public QuantumDataPacket(NBTTagCompound compound){ + super(compound); + } + + @Override + protected Long contentFromNBT(NBTTagCompound nbt) { + return nbt.getLong("computation"); + } + + @Override + protected NBTTagCompound contentToNBT() { + NBTTagCompound compound=new NBTTagCompound(); + compound.setLong("computation",content); + return compound; + } + + @Override + public boolean extraCheck() { + return true; + } + + @Override + protected Long unifyContentWith(Long content) { + return this.content+content; + } + + public QuantumDataPacket unifyTraceWith(Vec3pos... positions) { + return (QuantumDataPacket) super.unifyTrace(positions); + } + + public QuantumDataPacket unifyTraceWith(QuantumDataPacket p) { + return (QuantumDataPacket) super.unifyTrace(p); + } + + public QuantumDataPacket unifyPacketWith(QuantumDataPacket p) { + return (QuantumDataPacket) super.unifyWith(p); + } +} diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/README b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/README index f6c0b35e5f..f6c0b35e5f 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/README +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/README diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDecay.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java index 609f92b1a1..7f56ee8e5b 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDecay.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java @@ -1,8 +1,8 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; /** * Created by danie_000 on 22.10.2016. @@ -48,7 +48,7 @@ public final class cElementalDecay { this.probability = probability; } - public cElementalInstanceStackMap getResults(float lifeMult, long age, long energy, long amountDecaying) { + public cElementalInstanceStackMap getResults(float lifeMult, long age, long energyTotalForProducts, long amountDecaying) { cElementalInstanceStackMap decayResult = new cElementalInstanceStackMap(); if (outputStacks == null) { return decayResult;//This is to prevent null pointer exceptions. @@ -61,12 +61,12 @@ public final class cElementalDecay { if (qtty <= 0) { return decayResult; } - //energy /= qtty; + //energyTotalForProducts /= qtty; //lifeMult /= (float) qtty; for (cElementalDefinitionStack stack : outputStacks.values()) { decayResult.putUnify(new cElementalInstanceStack(stack.definition, amountDecaying * stack.amount, - lifeMult, age/*new products*/, energy / Math.max(1, stack.amount)));//get instances from stack + lifeMult, age/*new products*/, energyTotalForProducts / Math.max(1, Math.abs(stack.amount))));//get instances from stack } return decayResult; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDefinitionStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDefinitionStackMap.java index e6ba0e6be8..294acfc479 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDefinitionStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDefinitionStackMap.java @@ -1,12 +1,12 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; import java.util.TreeMap; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; /** * Created by Tec on 12.05.2017. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalInstanceStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalInstanceStackMap.java index b360a5a997..bfbe93bb4f 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalInstanceStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalInstanceStackMap.java @@ -1,19 +1,15 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; +import java.util.*; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; /** * Created by danie_000 on 22.01.2017. @@ -317,7 +313,7 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn public cElementalInstanceStack get(int i){ Collection<cElementalInstanceStack> var = map.values(); - return var.toArray(new cElementalInstanceStack[var.size()])[i]; + return var.toArray(new cElementalInstanceStack[0])[i]; } public String[] getElementalInfo() { @@ -343,12 +339,12 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn public cElementalInstanceStack[] values() { Collection<cElementalInstanceStack> var = map.values(); - return var.toArray(new cElementalInstanceStack[var.size()]); + return var.toArray(new cElementalInstanceStack[0]); } public iElementalDefinition[] keys() { Set<iElementalDefinition> var = map.keySet(); - return var.toArray(new iElementalDefinition[var.size()]); + return var.toArray(new iElementalDefinition[0]); } public float getMass() { @@ -407,10 +403,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn if (newInstances == null) { instance.nextColor(); } else { - map.remove(instance.definition); + removeAmount(false,instance); for (cElementalInstanceStack newInstance : newInstances.values()) { putUnify(newInstance); - newInstance.nextColor(); } } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalMutableDefinitionStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalMutableDefinitionStackMap.java index 9f7e14a154..829af20ca6 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalMutableDefinitionStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalMutableDefinitionStackMap.java @@ -1,15 +1,15 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; import java.util.Map; import java.util.TreeMap; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; /** * Created by danie_000 on 22.01.2017. @@ -53,7 +53,7 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa public cElementalDefinitionStackMap toImmutable() { return new cElementalDefinitionStackMap(map); } - public cElementalDefinitionStackMap toImmutable_unsafeMightLeaveExposedElementalTree() { + public cElementalDefinitionStackMap toImmutable_optimized_unsafeLeavesExposedElementalTree() { return new cElementalDefinitionStackMap(this); } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java index 676bdeff02..19f5789804 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java @@ -1,8 +1,7 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/commands/GiveEM.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java index 36a41ca323..ad8d1ad8c8 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/commands/GiveEM.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java @@ -1,17 +1,16 @@ -package com.github.technus.tectech.elementalMatter.core.commands; +package com.github.technus.tectech.mechanics.elementalMatter.core.commands; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.cElementalMutableDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalMutableDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -23,8 +22,8 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; /** * Created by danie_000 on 30.12.2017. @@ -35,6 +34,7 @@ public class GiveEM implements ICommand { public GiveEM(){ aliases.add("em_give"); aliases.add("give_em"); + aliases.add("gib_em"); } @Override @@ -43,7 +43,7 @@ public class GiveEM implements ICommand { if(args.length < 3) { sender.addChatMessage(new ChatComponentText(getCommandUsage(sender))); }else{ - TecTech.Logger.info("Spawninig EM for "+((EntityPlayerMP) sender).getDisplayName()+" - "+Arrays.toString(args)); + TecTech.LOGGER.info("Spawninig EM for "+((EntityPlayerMP) sender).getDisplayName()+" - "+Arrays.toString(args)); ArrayList<String> list=new ArrayList<>(); list.addAll(Arrays.asList(args)); @@ -141,7 +141,7 @@ public class GiveEM implements ICommand { @Override public String getCommandUsage(ICommandSender p_71518_1_) { - return "em_give energy count classOrId (count classOrId , ... <) if complex"; + return "em_give Energy Count ClassOrId (Count ClassOrId ... <)"; } @Override diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/commands/ListEM.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java index 2d296c1c9c..9e034f4655 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/commands/ListEM.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java @@ -1,8 +1,7 @@ -package com.github.technus.tectech.elementalMatter.core.commands; +package com.github.technus.tectech.mechanics.elementalMatter.core.commands; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/iElementalInstanceContainer.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/iElementalInstanceContainer.java index 74d371272b..5244676643 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/iElementalInstanceContainer.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/iElementalInstanceContainer.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; /** * Created by danie_000 on 25.01.2017. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipe.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java index 29fea2fa4c..c2fd9a81d4 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipe.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipeMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipeMap.java index 9a8ad52252..c289fc94ae 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipeMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipeMap.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalDefinitionStack.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalDefinitionStack.java index 4e74650786..6b6fe35b41 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalDefinitionStack.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalDefinitionStack.java @@ -1,10 +1,10 @@ -package com.github.technus.tectech.elementalMatter.core.stacks; +package com.github.technus.tectech.mechanics.elementalMatter.core.stacks; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; /** * Created by danie_000 on 20.11.2016. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java index 4193153d57..d97ec5d1f6 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java @@ -1,23 +1,26 @@ -package com.github.technus.tectech.elementalMatter.core.stacks; +package com.github.technus.tectech.mechanics.elementalMatter.core.stacks; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition.deadEnd; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; /** * Created by danie_000 on 22.10.2016. */ public final class cElementalInstanceStack implements iHasElementalDefinition { + public static int MIN_MULTIPLE_DECAY_CALLS=4,MAX_MULTIPLE_DECAY_CALLS=16,DECAY_CALL_PER=144; + public final iElementalDefinition definition; //energy - if positive then particle should try to decay private long energy; @@ -46,11 +49,11 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { if (bColor < 0 || bColor > 2) {//transforms colorable??? into proper color this.color = bColor; } else { - this.color = (byte) TecTech.Rnd.nextInt(3); + this.color = (byte) TecTech.RANDOM.nextInt(3); } this.lifeTimeMult = lifeTimeMult; - this.energy = energy; lifeTime = definition.getRawTimeSpan(energy) * this.lifeTimeMult; + setEnergy(energy); this.age = age; this.amount = amount; } @@ -58,12 +61,12 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { //Clone proxy private cElementalInstanceStack(cElementalInstanceStack stack) { definition = stack.definition; - energy = stack.energy; color = stack.color; age = stack.age; amount = stack.amount; lifeTime = stack.lifeTime; lifeTimeMult = stack.lifeTimeMult; + energy = stack.energy; } @Override @@ -92,17 +95,15 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { public void setEnergy(long newEnergyLevel){ energy=newEnergyLevel; - setLifeTimeMultipleOfBaseValue(getLifeTimeMult()); + setLifeTimeMultiplier(getLifeTimeMultiplier()); } - @Deprecated //can be done from definition public float getEnergySettingCost(long currentEnergyLevel, long newEnergyLevel){ - return definition.getEnergyDiffBetweenStates(currentEnergyLevel,newEnergyLevel); + return definition.getEnergyDiffBetweenStates(currentEnergyLevel,newEnergyLevel)*amount; } - @Deprecated //can be done from definition public float getEnergySettingCost(long newEnergyLevel){ - return definition.getEnergyDiffBetweenStates(energy,newEnergyLevel); + return definition.getEnergyDiffBetweenStates(energy,newEnergyLevel)*amount; } public cElementalDefinitionStack getDefinitionStack() { @@ -129,17 +130,17 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { if (color < 0 || color > 2) { return color; } - return color = (byte) TecTech.Rnd.nextInt(3); + return color = (byte) TecTech.RANDOM.nextInt(3); } public float getLifeTime() { return lifeTime; } - public float setLifeTimeMultipleOfBaseValue(float mult) { + public float setLifeTimeMultiplier(float mult) { if(mult<=0) //since infinity*0=nan { - throw new IllegalArgumentException("mult must be >0"); + throw new IllegalArgumentException("multiplier must be >0"); } lifeTimeMult = mult; if (definition.getRawTimeSpan(energy) <= 0) { @@ -149,10 +150,26 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { return lifeTime; } - public float getLifeTimeMult() { + public float getLifeTimeMultiplier() { return lifeTimeMult; } + public cElementalInstanceStackMap tickStackByOneSecond(float lifeTimeMult, int postEnergize){ + return tickStack(lifeTimeMult,postEnergize,1); + } + + public cElementalInstanceStackMap tickStack(float lifeTimeMult, int postEnergize, int seconds){ + cElementalInstanceStackMap newInstances = decay(lifeTimeMult, age += seconds, postEnergize); + if (newInstances == null) { + nextColor(); + } else { + for (cElementalInstanceStack newInstance : newInstances.values()) { + newInstance.nextColor(); + } + } + return newInstances; + } + public cElementalInstanceStackMap decay() { return decay(1F, age, 0);//try to decay without changes } @@ -162,43 +179,80 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } public cElementalInstanceStackMap decay(float lifeTimeMult, long apparentAge, long postEnergize) { - long newEnergyLevel=postEnergize+ energy; - if(newEnergyLevel>0) { + long newEnergyLevel = postEnergize + energy; + if (newEnergyLevel > 0) { newEnergyLevel -= 1; - } else if(newEnergyLevel<0) { + } else if (newEnergyLevel < 0) { newEnergyLevel += 1; } + if(definition.usesMultipleDecayCalls(energy)){ + long amountTemp=amount; + long decayCnt=Math.min(Math.max(amount/DECAY_CALL_PER,MIN_MULTIPLE_DECAY_CALLS),MAX_MULTIPLE_DECAY_CALLS); + long amountPer=amount/decayCnt; + amount-=amountPer*(--decayCnt); + cElementalInstanceStackMap output=decayMechanics(lifeTimeMult,apparentAge,newEnergyLevel); + if(output==null){ + amount=amountTemp; + return null; + } + if(amountPer>0){ + amount=amountPer; + for(int i=0;i<decayCnt;i++){ + cElementalInstanceStackMap map=decayMechanics(lifeTimeMult,apparentAge,newEnergyLevel); + if(map!=null){ + output.putUnifyAll(map); + } + } + } + amount=amountTemp; + return output; + }else{ + return decayMechanics(lifeTimeMult,apparentAge,newEnergyLevel); + } + } + + private cElementalInstanceStackMap decayMechanics(float lifeTimeMult, long apparentAge, long newEnergyLevel) { if (energy > 0 && !definition.usesSpecialEnergeticDecayHandling()) { - setLifeTimeMultipleOfBaseValue(getLifeTimeMult()); + setLifeTimeMultiplier(getLifeTimeMultiplier()); return decayCompute(definition.getEnergyInducedDecay(energy), lifeTimeMult, -1, newEnergyLevel); - }else if (definition.getRawTimeSpan(energy) < 0) { + } else if (definition.getRawTimeSpan(energy) < 0) { return null;//return null, decay cannot be achieved - } else if(definition.isTimeSpanHalfLife()){ - return exponentialDecayCompute(energy>0?definition.getEnergyInducedDecay(energy):definition.getDecayArray(), lifeTimeMult, -1, newEnergyLevel); - } else{ + } else if (definition.isTimeSpanHalfLife()) { + return exponentialDecayCompute(energy > 0 ? definition.getEnergyInducedDecay(energy) : definition.getDecayArray(), lifeTimeMult, -1, newEnergyLevel); + } else { if (1F > lifeTime) { - return decayCompute(energy>0?definition.getEnergyInducedDecay(energy):definition.getNaturalDecayInstant(), lifeTimeMult, 0, newEnergyLevel); + return decayCompute(energy > 0 ? definition.getEnergyInducedDecay(energy) : definition.getNaturalDecayInstant(), lifeTimeMult, 0, newEnergyLevel); } else if ((float) apparentAge > lifeTime) { - return decayCompute(energy>0?definition.getEnergyInducedDecay(energy):definition.getDecayArray(), lifeTimeMult, 0, newEnergyLevel); + return decayCompute(energy > 0 ? definition.getEnergyInducedDecay(energy) : definition.getDecayArray(), lifeTimeMult, 0, newEnergyLevel); } } return null;//return null since decay cannot be achieved } //Use to get direct decay output providing correct decay array - private cElementalInstanceStackMap exponentialDecayCompute(cElementalDecay[] decays, float lifeTimeMult, long newProductsAge, long energy) { + private cElementalInstanceStackMap exponentialDecayCompute(cElementalDecay[] decays, float lifeTimeMult, long newProductsAge, long newEnergyLevel) { double decayInverseRatio=Math.pow(2d,1d/* 1 second *//(double)lifeTime); double newAmount=(double)amount/decayInverseRatio; - long amountRemaining= (long)Math.floor(newAmount) +(TecTech.Rnd.nextDouble()<=newAmount-Math.floor(newAmount)?1:0); + long amountRemaining= (long)Math.floor(newAmount) +(TecTech.RANDOM.nextDouble()<=newAmount-Math.floor(newAmount)?1:0); + //if(definition.getSymbol().startsWith("U ")) { + // System.out.println("newAmount = " + newAmount); + // System.out.println("amountRemaining = " + amountRemaining); + // for(cElementalDecay decay:decays){ + // System.out.println("prob = "+decay.probability); + // for(cElementalDefinitionStack stack:decay.outputStacks.values()){ + // System.out.println("stack = " + stack.getDefinition().getSymbol() + " " + stack.amount); + // } + // } + //} if(amountRemaining==amount) { return null;//nothing decayed } else if(amountRemaining<=0) { - return decayCompute(decays, lifeTimeMult, newProductsAge, energy); + return decayCompute(decays, lifeTimeMult, newProductsAge, newEnergyLevel); } //split to non decaying and decaying part long amount=this.amount; this.amount-=amountRemaining; - cElementalInstanceStackMap products=decayCompute(decays,lifeTimeMult,newProductsAge,energy); + cElementalInstanceStackMap products=decayCompute(decays,lifeTimeMult,newProductsAge,newEnergyLevel); this.amount=amountRemaining; products.putUnify(clone()); this.amount=amount; @@ -206,27 +260,37 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } //Use to get direct decay output providing correct decay array - public cElementalInstanceStackMap decayCompute(cElementalDecay[] decays, float lifeTimeMult, long newProductsAge, long energy) { + private cElementalInstanceStackMap decayCompute(cElementalDecay[] decays, float lifeTimeMult, long newProductsAge, long newEnergyLevel) { if (decays == null) { return null;//Can not decay so it wont - } else if (decays.length == 0) { + } + if (decays.length == 0) { + if(definition.decayMakesEnergy(this.energy)) { + return null; + } return new cElementalInstanceStackMap();//provide non null 0 length array for annihilation } else if (decays.length == 1) {//only one type of decay :D, doesn't need dead end - cElementalInstanceStackMap products=decays[0].getResults(lifeTimeMult, newProductsAge, energy, amount); + if(decays[0]==deadEnd && definition.decayMakesEnergy(this.energy)) { + return null;//no extra photons + } + cElementalInstanceStackMap products=decays[0].getResults(lifeTimeMult, newProductsAge, newEnergyLevel, amount); if(newProductsAge<0){ for(cElementalInstanceStack stack:products.values()){ if(stack.definition.equals(definition)){ stack.age= age; - stack.energy=this.energy; + stack.setEnergy(energy); } } }else{ for(cElementalInstanceStack stack:products.values()){ if(stack.definition.equals(definition)){ - stack.energy=this.energy; + stack.setEnergy(energy); } } } + if(this.energy <= 0 && products.getMass() > getMass()){ + return null;//no energy usage to decay + } return products; } else { cElementalInstanceStackMap output = new cElementalInstanceStackMap(); @@ -236,25 +300,22 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { float remainingProbability = 1F; for (int i = 0; i < differentDecays; i++) { - if (decays[i].probability > 1F) { + if (decays[i].probability >= 1F) { long thisDecayAmount = (long) Math.floor(remainingProbability * (double) amount); - if (thisDecayAmount == 0) { - //remainingProbability=something; - break; - } else if (thisDecayAmount <= amountRemaining) { - amountRemaining -= thisDecayAmount; - qttyOfDecay[i] += thisDecayAmount; - break; + if (thisDecayAmount > 0) { + if (thisDecayAmount <= amountRemaining) { + amountRemaining -= thisDecayAmount; + qttyOfDecay[i] += thisDecayAmount; + }else {//in case too much was made + qttyOfDecay[i] += amountRemaining; + amountRemaining = 0; + //remainingProbability=0; + } } - //in case too much was made - qttyOfDecay[i] += amountRemaining; - amountRemaining = 0; - //remainingProbability=0; break; } long thisDecayAmount = (long) Math.floor(decays[i].probability * (double) amount); if (thisDecayAmount <= amountRemaining && thisDecayAmount > 0) {//some was made - remainingProbability -= decays[i].probability; amountRemaining -= thisDecayAmount; qttyOfDecay[i] += thisDecayAmount; } else if (thisDecayAmount > amountRemaining) {//too much was made @@ -262,11 +323,15 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { amountRemaining = 0; //remainingProbability=0; break; - }//if 0 + } + remainingProbability -= decays[i].probability; + if(remainingProbability<=0) { + break; + } } for (int i = 0; i < amountRemaining; i++) { - double rand = TecTech.Rnd.nextDouble(); + double rand = TecTech.RANDOM.nextDouble(); for (int j = 0; j < differentDecays; j++) {//looking for the thing it decayed into rand -= decays[j].probability; if (rand <= 0D) { @@ -276,9 +341,23 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } } - for (int i = 0; i < differentDecays; i++) { - if (qttyOfDecay[i] > 0) { - output.putUnifyAll(decays[i].getResults(lifeTimeMult, newProductsAge, energy, qttyOfDecay[i])); + if(definition.decayMakesEnergy(this.energy)){ + for (int i = 0; i < differentDecays; i++) { + if (qttyOfDecay[i] > 0) { + if(decays[i]==deadEnd){ + cElementalInstanceStack clone=this.clone(); + clone.amount=qttyOfDecay[i]; + output.putUnify(clone); + }else { + output.putUnifyAll(decays[i].getResults(lifeTimeMult, newProductsAge, newEnergyLevel, qttyOfDecay[i])); + } + } + } + }else{ + for (int i = 0; i < differentDecays; i++) { + if (qttyOfDecay[i] > 0) { + output.putUnifyAll(decays[i].getResults(lifeTimeMult, newProductsAge, newEnergyLevel, qttyOfDecay[i])); + } } } @@ -286,16 +365,19 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { for(cElementalInstanceStack stack:output.values()){ if(stack.definition.equals(definition)){ stack.age= age; - stack.energy=this.energy; + stack.setEnergy(energy); } } }else{ for(cElementalInstanceStack stack:output.values()){ if(stack.definition.equals(definition)){ - stack.energy=this.energy; + stack.setEnergy(energy); } } } + if(this.energy <= 0 && output.getMass() > getMass()){ + return null;//no energy usage to decay + } return output; } } @@ -305,13 +387,17 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { return this; } //returns with the definition from the first object passed - long energy = this.energy * amount; + double energy = this.energy * amount; + long maxEnergy=this.energy; float lifeTimeMul = lifeTimeMult; for (cElementalInstanceStack instance : instances) { if (instance != null && compareTo(instance) == 0) { amount += instance.amount; energy += instance.energy * instance.amount; + if(instance.energy>maxEnergy){ + maxEnergy=instance.energy; + } lifeTimeMul = Math.min(lifeTimeMul, instance.lifeTimeMult); age = Math.max(age, instance.age); } @@ -321,8 +407,9 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { energy /= Math.abs(amount); } - this.energy = energy; - setLifeTimeMultipleOfBaseValue(lifeTimeMul); + double wholeParts=Math.floor(energy); + energy=Math.min(energy-wholeParts,1)+(wholeParts>=0?-0.11709966304863834:0.11709966304863834); + setEnergy(Math.min(maxEnergy,(long)wholeParts+(energy>TecTech.RANDOM.nextDouble()?1:0))); return this; } @@ -409,7 +496,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { return false; } - //Amount shouldn't be hashed if this is just indicating amount and not structure, DOES NOT CARE ABOUT INSTANCE INFO + //Amount shouldn't be hashed if this is just indicating amount and not structure, DOES NOT CARE ABOUT creativeTabTecTech INFO @Override public int hashCode() { return definition.hashCode(); diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/iHasElementalDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/iHasElementalDefinition.java index 68ca71f33c..480707d570 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/iHasElementalDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/iHasElementalDefinition.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.elementalMatter.core.stacks; +package com.github.technus.tectech.mechanics.elementalMatter.core.stacks; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; /** * Created by danie_000 on 30.01.2017. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/tElementalException.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/tElementalException.java index 4bb3b4020f..2adadfd062 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/tElementalException.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/tElementalException.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.elementalMatter.core; +package com.github.technus.tectech.mechanics.elementalMatter.core; /** * Created by danie_000 on 19.11.2016. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalDefinition.java index 505bb5ab48..de8ccb7b2b 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalDefinition.java @@ -1,7 +1,7 @@ -package com.github.technus.tectech.elementalMatter.core.templates; +package com.github.technus.tectech.mechanics.elementalMatter.core.templates; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import net.minecraft.nbt.NBTTagCompound; import java.lang.reflect.Method; @@ -9,8 +9,8 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; /** * Created by danie_000 on 23.01.2017. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java index ab571e9d4c..738301d50c 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java @@ -1,13 +1,13 @@ -package com.github.technus.tectech.elementalMatter.core.templates; +package com.github.technus.tectech.mechanics.elementalMatter.core.templates; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.tElementalException; -import com.github.technus.tectech.elementalMatter.core.transformations.aFluidDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aItemDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aOredictDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aFluidDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; import net.minecraft.client.Minecraft; import net.minecraft.crash.CrashReport; import net.minecraft.nbt.NBTTagCompound; @@ -16,8 +16,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; /** @@ -112,6 +112,8 @@ public abstract class cElementalPrimitive extends cElementalDefinition { public cElementalDecay[] getNaturalDecayInstant() { if (naturalDecayInstant < 0) { return elementalDecays; + }else if (naturalDecayInstant>=elementalDecays.length){ + return cElementalDecay.noProduct; } return new cElementalDecay[]{elementalDecays[naturalDecayInstant]}; } @@ -120,6 +122,8 @@ public abstract class cElementalPrimitive extends cElementalDefinition { public cElementalDecay[] getEnergyInducedDecay(long energyLevel) { if (energeticDecayInstant < 0) { return elementalDecays; + }else if (energeticDecayInstant>=elementalDecays.length){ + return cElementalDecay.noProduct; } return new cElementalDecay[]{elementalDecays[energeticDecayInstant]}; } @@ -135,6 +139,21 @@ public abstract class cElementalPrimitive extends cElementalDefinition { } @Override + public boolean usesMultipleDecayCalls(long energyLevel) { + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return false; + } + + @Override + public boolean fusionMakesEnergy(long energyLevel) { + return false; + } + + @Override public cElementalDecay[] getDecayArray() { return elementalDecays; } @@ -187,6 +206,10 @@ public abstract class cElementalPrimitive extends cElementalDefinition { return -128; } + public static byte getClassTypeStatic(){ + return -128; + } + @Override public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) { if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { @@ -220,7 +243,7 @@ public abstract class cElementalPrimitive extends cElementalDefinition { } } if(DEBUG_MODE) { - TecTech.Logger.info("Registered Elemental Matter Class: Primitive " + nbtType + ' ' + -128); + TecTech.LOGGER.info("Registered Elemental Matter Class: Primitive " + nbtType + ' ' + -128); } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/iElementalDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/iElementalDefinition.java index 23d2df06a8..6293e9ccf2 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/iElementalDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/iElementalDefinition.java @@ -1,11 +1,11 @@ -package com.github.technus.tectech.elementalMatter.core.templates; - -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.transformations.aFluidDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aItemDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aOredictDequantizationInfo; +package com.github.technus.tectech.mechanics.elementalMatter.core.templates; + +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aFluidDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; @@ -17,7 +17,7 @@ public abstract class iElementalDefinition implements Comparable<iElementalDefin public static final float STABLE_RAW_LIFE_TIME =1.5e36f; public static final float NO_DECAY_RAW_LIFE_TIME=-1; public static final long DEFAULT_ENERGY_LEVEL=0; - public static final float DEFAULT_ENERGY_REQUIREMENT=25000f; + public static final float DEFAULT_ENERGY_REQUIREMENT=25000;//legit cuz normal atoms should only emit a gamma if they don't have defined energy levels //Nomenclature public abstract String getName(); @@ -41,6 +41,12 @@ public abstract class iElementalDefinition implements Comparable<iElementalDefin public abstract boolean usesSpecialEnergeticDecayHandling(); + public abstract boolean usesMultipleDecayCalls(long energyLevel); + + public abstract boolean decayMakesEnergy(long energyLevel); + + public abstract boolean fusionMakesEnergy(long energyLevel); + public abstract float getEnergyDiffBetweenStates(long currentEnergy, long newEnergyLevel);//positive or negative public abstract float getMass();//mass... MeV/c^2 diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aFluidDequantizationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aFluidDequantizationInfo.java index 6f66830f83..101163e78d 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aFluidDequantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aFluidDequantizationInfo.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aFluidQuantizationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aFluidQuantizationInfo.java index 714b991c55..287fefbe14 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aFluidQuantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aFluidQuantizationInfo.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemDequantizationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aItemDequantizationInfo.java index d7ab4cc9f7..b764f59863 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemDequantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aItemDequantizationInfo.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemQuantizationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aItemQuantizationInfo.java index cc240e1246..80179e1eb8 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemQuantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aItemQuantizationInfo.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aOredictDequantizationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aOredictDequantizationInfo.java index 0d0e75e5af..51b1a6806d 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aOredictDequantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aOredictDequantizationInfo.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import net.minecraftforge.oredict.OreDictionary; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aOredictQuantizationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aOredictQuantizationInfo.java index 3d9a873520..99e8589060 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aOredictQuantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/aOredictQuantizationInfo.java @@ -1,6 +1,6 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import net.minecraftforge.oredict.OreDictionary; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/bTransformationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/bTransformationInfo.java index 0584a7566c..367b412201 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/bTransformationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/bTransformationInfo.java @@ -1,7 +1,7 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import net.minecraft.item.ItemStack; @@ -10,6 +10,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import java.util.HashMap; +import java.util.HashSet; /** * Created by Tec on 26.05.2017. @@ -24,11 +25,7 @@ public class bTransformationInfo { public static final HashMap<Integer,aOredictQuantizationInfo> oredictQuantization=new HashMap<>(32); public HashMap<iElementalDefinition,aOredictDequantizationInfo> oredictDequantization; - public bTransformationInfo(){ - fluidDequantization=new HashMap<>(); - itemDequantization=new HashMap<>(); - oredictDequantization=new HashMap<>(); - } + public static final HashSet<iElementalDefinition> stacksRegistered=new HashSet<>(); public bTransformationInfo(int fluidCap,int itemCap, int oreCap){ if(fluidCap>0) { @@ -45,49 +42,58 @@ public class bTransformationInfo { public void addFluid(iHasElementalDefinition em, FluidStack fluidStack){ fluidQuantization.put(fluidStack.getFluidID(),new aFluidQuantizationInfo(fluidStack,em)); fluidDequantization.put(em.getDefinition(),new aFluidDequantizationInfo(em,fluidStack)); + stacksRegistered.add(em.getDefinition()); } public void addFluid(iHasElementalDefinition em ,int fluidID,int fluidAmount) { fluidQuantization.put(fluidID,new aFluidQuantizationInfo(fluidID,fluidAmount,em)); fluidDequantization.put(em.getDefinition(),new aFluidDequantizationInfo(em,fluidID,fluidAmount)); + stacksRegistered.add(em.getDefinition()); } public void addFluid(iHasElementalDefinition em, Fluid fluid, int fluidAmount){ fluidQuantization.put(fluid.getID(),new aFluidQuantizationInfo(fluid,fluidAmount,em)); fluidDequantization.put(em.getDefinition(),new aFluidDequantizationInfo(em,fluid,fluidAmount)); + stacksRegistered.add(em.getDefinition()); } - public void addItemQuantization(aItemQuantizationInfo aIQI){ + private void addItemQuantization(aItemQuantizationInfo aIQI){ itemQuantization.put(aIQI,aIQI); } public void addItem(iHasElementalDefinition em, ItemStack itemStack, boolean skipNBT){ addItemQuantization(new aItemQuantizationInfo(itemStack,skipNBT,em)); itemDequantization.put(em.getDefinition(),new aItemDequantizationInfo(em,itemStack)); + stacksRegistered.add(em.getDefinition()); } public void addItem(iHasElementalDefinition em, OrePrefixes prefix, Materials material, int amount, boolean skipNBT){ addItemQuantization(new aItemQuantizationInfo(prefix,material,amount,skipNBT,em)); itemDequantization.put(em.getDefinition(),new aItemDequantizationInfo(em,prefix,material,amount)); + stacksRegistered.add(em.getDefinition()); } public void addOredict(iHasElementalDefinition em, int id, int qty){ oredictQuantization.put(id,new aOredictQuantizationInfo(id,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,id,qty)); + stacksRegistered.add(em.getDefinition()); } public void addOredict(iHasElementalDefinition em, String name, int qty){ oredictQuantization.put(OreDictionary.getOreID(name),new aOredictQuantizationInfo(name,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,name,qty)); + stacksRegistered.add(em.getDefinition()); } public void addOredict(iHasElementalDefinition em, OrePrefixes prefix, Materials material, int qty){ oredictQuantization.put(OreDictionary.getOreID(prefix.name() + material.mName),new aOredictQuantizationInfo(prefix,material,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,prefix,material,qty)); + stacksRegistered.add(em.getDefinition()); } public void addOredict(iHasElementalDefinition em, OrePrefixes prefix, String materialName, int qty){ oredictQuantization.put(OreDictionary.getOreID(prefix.name() + materialName),new aOredictQuantizationInfo(prefix,materialName,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,prefix,materialName,qty)); + stacksRegistered.add(em.getDefinition()); } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/iExchangeInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/iExchangeInfo.java index 84c5855dab..f4e77bfe2b 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/iExchangeInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/iExchangeInfo.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.elementalMatter.core.transformations; +package com.github.technus.tectech.mechanics.elementalMatter.core.transformations; /** * Created by Tec on 23.05.2017. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java index 1b17407970..23f566075a 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java @@ -1,24 +1,25 @@ -package com.github.technus.tectech.elementalMatter.definitions.complex.atom; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; import com.github.technus.tectech.XSTR; import com.github.technus.tectech.compatibility.gtpp.GtppAtomLoader; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.cElementalMutableDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.tElementalException; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.transformations.aFluidDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aItemDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aOredictDequantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.bTransformationInfo; -import com.github.technus.tectech.elementalMatter.definitions.complex.hadron.dHadronDefinition; -import com.github.technus.tectech.elementalMatter.definitions.primitive.eBosonDefinition; -import com.github.technus.tectech.elementalMatter.definitions.primitive.eLeptonDefinition; -import com.github.technus.tectech.elementalMatter.definitions.primitive.eNeutrinoDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalMutableDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aFluidDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eLeptonDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eNeutrinoDefinition; import cpw.mods.fml.common.Loader; import gregtech.api.enums.Materials; import net.minecraft.nbt.NBTTagCompound; @@ -26,9 +27,10 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.*; import static com.github.technus.tectech.XSTR.XSTR_INSTANCE; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.eBosonDefinition.boson_Y__; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.eBosonDefinition.deadEnd; +import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition.getNbtTagCompound; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition.boson_Y__; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition.deadEnd; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; import static gregtech.api.enums.OrePrefixes.dust; @@ -393,7 +395,7 @@ public final class dAtomDefinition extends cElementalDefinition { if (type == 1) { switch (decayMode) { case -2: - if(TecTech.Rnd.nextBoolean() && ElectronCapture(decaysList)) { + if(TecTech.RANDOM.nextBoolean() && ElectronCapture(decaysList)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); } else if(PbetaDecay(decaysList)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); @@ -461,28 +463,28 @@ public final class dAtomDefinition extends cElementalDefinition { case "D": { if (withThis.removeAllAmounts(false, deuterium.definition.getSubParticles())){ withThis.putReplace(deuterium); - decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_unsafeMightLeaveExposedElementalTree())); + decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; } } break; case "3H": { if (withThis.removeAllAmounts(false, tritium.definition.getSubParticles())){ withThis.putReplace(tritium); - decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_unsafeMightLeaveExposedElementalTree())); + decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; } } break; case "3HE": { if (withThis.removeAllAmounts(false, helium_3.definition.getSubParticles())){ withThis.putReplace(helium_3); - decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_unsafeMightLeaveExposedElementalTree())); + decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; } } break; case "8BE": { if (withThis.removeAllAmounts(false, beryllium_8.definition.getSubParticles())){ withThis.putReplace(beryllium_8); - decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_unsafeMightLeaveExposedElementalTree())); + decaysList.add(new cElementalDecay(decay.chance,withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; } } break; @@ -490,8 +492,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, carbon_14.definition.getSubParticles())){ newStuff.putReplace(carbon_14); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -504,8 +506,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, neon_24.definition.getSubParticles())){ newStuff.putReplace(neon_24); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -518,8 +520,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, silicon_34.definition.getSubParticles())){ newStuff.putReplace(silicon_34); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -532,8 +534,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, dHadronDefinition.hadron_n2,dHadronDefinition.hadron_p2)){ newStuff.putReplace(alpha); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -548,8 +550,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eLeptonDefinition.lepton_e_1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -564,8 +566,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eLeptonDefinition.lepton_e_2); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -580,8 +582,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eLeptonDefinition.lepton_e1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -596,8 +598,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eLeptonDefinition.lepton_e2); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -611,8 +613,8 @@ public final class dAtomDefinition extends cElementalDefinition { withThis.putUnify(dHadronDefinition.hadron_n1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -626,8 +628,8 @@ public final class dAtomDefinition extends cElementalDefinition { withThis.putUnify(dHadronDefinition.hadron_n2); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -642,8 +644,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eLeptonDefinition.lepton_e_1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -658,8 +660,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); newStuff.putReplace(alpha); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -675,8 +677,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); newStuff.putReplace(dHadronDefinition.hadron_p1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -692,8 +694,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); newStuff.putReplace(dHadronDefinition.hadron_p2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -708,8 +710,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_1); newStuff.putReplace(alpha); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -725,8 +727,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_1); newStuff.putReplace(dHadronDefinition.hadron_n1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -742,8 +744,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_1); newStuff.putReplace(dHadronDefinition.hadron_n2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -758,8 +760,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_1); newStuff.putReplace(dHadronDefinition.hadron_p1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -773,8 +775,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); newStuff.putReplace(alpha); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -789,8 +791,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); newStuff.putReplace(dHadronDefinition.hadron_p1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -805,8 +807,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); newStuff.putReplace(dHadronDefinition.hadron_p2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -821,8 +823,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve2); newStuff.putReplace(dHadronDefinition.hadron_p3); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -835,8 +837,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, dHadronDefinition.hadron_n1)){ newStuff.putReplace(dHadronDefinition.hadron_n1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -849,8 +851,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, dHadronDefinition.hadron_n2)){ newStuff.putReplace(dHadronDefinition.hadron_n2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -863,8 +865,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, dHadronDefinition.hadron_p1)){ newStuff.putReplace(dHadronDefinition.hadron_p1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -877,8 +879,8 @@ public final class dAtomDefinition extends cElementalDefinition { if (withThis.removeAllAmounts(false, dHadronDefinition.hadron_p2)){ newStuff.putReplace(dHadronDefinition.hadron_p2); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -961,7 +963,7 @@ public final class dAtomDefinition extends cElementalDefinition { return true; }else{ if(DEBUG_MODE) { - TecTech.Logger.info("Tried to emit Gamma from ground state"); + TecTech.LOGGER.info("Tried to emit Gamma from ground state"); } decaysList.add(new cElementalDecay(decay.chance, this)); return true; @@ -974,8 +976,8 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve2); newStuff.putReplace(eBosonDefinition.boson_Y__1); try{ - newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_unsafeMightLeaveExposedElementalTree()).getStackForm(1)); - decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); + newStuff.putReplace(new dAtomDefinition(withThis.toImmutable_optimized_unsafeLeavesExposedElementalTree()).getStackForm(1)); + decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; }catch (Exception e){ if(DEBUG_MODE) { @@ -990,7 +992,7 @@ public final class dAtomDefinition extends cElementalDefinition { default: throw new Error("Unsupported decay mode: " + decay.decayName + ' ' + neutralCount+ ' ' +element); } if(DEBUG_MODE) { - TecTech.Logger.info("Failed to decay " + element + ' ' + neutralCount + ' ' + decay.decayName); + TecTech.LOGGER.info("Failed to decay " + element + ' ' + neutralCount + ' ' + decay.decayName); } return false; } @@ -999,7 +1001,7 @@ public final class dAtomDefinition extends cElementalDefinition { cElementalMutableDefinitionStackMap tree = elementalStacks.toMutable(); if (tree.removeAmount(false, emit)) { try { - decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), emit)); + decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_optimized_unsafeLeavesExposedElementalTree()), 1), emit)); return true; } catch (Exception e) { if (DEBUG_MODE) { @@ -1014,7 +1016,7 @@ public final class dAtomDefinition extends cElementalDefinition { cElementalMutableDefinitionStackMap tree = elementalStacks.toMutable(); if (tree.removeAllAmounts(false, alpha.definition.getSubParticles())) { try { - decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), alpha)); + decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_optimized_unsafeLeavesExposedElementalTree()), 1), alpha)); return true; } catch (Exception e) { if (DEBUG_MODE) { @@ -1030,7 +1032,7 @@ public final class dAtomDefinition extends cElementalDefinition { if (tree.removeAmount(false, dHadronDefinition.hadron_n1)) { try { tree.putUnify(dHadronDefinition.hadron_p1); - decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), eLeptonDefinition.lepton_e1, eNeutrinoDefinition.lepton_Ve_1)); + decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_optimized_unsafeLeavesExposedElementalTree()), 1), eLeptonDefinition.lepton_e1, eNeutrinoDefinition.lepton_Ve_1)); return true; } catch (Exception e) { if (DEBUG_MODE) { @@ -1046,7 +1048,7 @@ public final class dAtomDefinition extends cElementalDefinition { if (tree.removeAmount(false, dHadronDefinition.hadron_p1)) { try { tree.putUnify(dHadronDefinition.hadron_n1); - decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), eLeptonDefinition.lepton_e_1, eNeutrinoDefinition.lepton_Ve1)); + decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_optimized_unsafeLeavesExposedElementalTree()), 1), eLeptonDefinition.lepton_e_1, eNeutrinoDefinition.lepton_Ve1)); return true; } catch (Exception e) { if (DEBUG_MODE) { @@ -1062,7 +1064,7 @@ public final class dAtomDefinition extends cElementalDefinition { if (tree.removeAllAmounts(false, dHadronDefinition.hadron_p1,eLeptonDefinition.lepton_e1)) { try { tree.putUnify(dHadronDefinition.hadron_n1); - decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), eNeutrinoDefinition.lepton_Ve1)); + decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_optimized_unsafeLeavesExposedElementalTree()), 1), eNeutrinoDefinition.lepton_Ve1)); return true; } catch (Exception e) { if (DEBUG_MODE) { @@ -1111,9 +1113,9 @@ public final class dAtomDefinition extends cElementalDefinition { } try { - particles.putReplace(new cElementalDefinitionStack(new dAtomDefinition(fissile.toImmutable_unsafeMightLeaveExposedElementalTree()),1)); - particles.putReplace(new cElementalDefinitionStack(new dAtomDefinition(heavy.toImmutable_unsafeMightLeaveExposedElementalTree()),1)); - decaysList.add(new cElementalDecay(probability, particles.toImmutable_unsafeMightLeaveExposedElementalTree())); + particles.putReplace(new cElementalDefinitionStack(new dAtomDefinition(fissile.toImmutable_optimized_unsafeLeavesExposedElementalTree()),1)); + particles.putReplace(new cElementalDefinitionStack(new dAtomDefinition(heavy.toImmutable_optimized_unsafeLeavesExposedElementalTree()),1)); + decaysList.add(new cElementalDecay(probability, particles.toImmutable_optimized_unsafeLeavesExposedElementalTree())); return true; } catch (Exception e) { if(DEBUG_MODE) { @@ -1216,6 +1218,33 @@ public final class dAtomDefinition extends cElementalDefinition { } @Override + public boolean usesMultipleDecayCalls(long energyLevel) { + if(!iaeaDefinitionExistsAndHasEnergyLevels) return false; + iaeaNuclide.energeticState state; + if(energyLevel>iaea.energeticStatesArray.length) { + state = iaea.energeticStatesArray[iaea.energeticStatesArray.length - 1]; + } else if(energyLevel<=0) { + state = iaea.energeticStatesArray[0]; + } else { + state = iaea.energeticStatesArray[(int) energyLevel]; + } + for (iaeaNuclide.iaeaDecay decay:state.decaymodes){ + if(decay.decayName.contains("F")) return true;//if is fissile + } + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return iaeaDefinitionExistsAndHasEnergyLevels; + } + + @Override + public boolean fusionMakesEnergy(long energyLevel) { + return iaea!=null || iaeaDefinitionExistsAndHasEnergyLevels; + } + + @Override public cElementalDecay[] getNaturalDecayInstant() { //disembody ArrayList<cElementalDefinitionStack> decaysInto = new ArrayList<>(); @@ -1253,7 +1282,7 @@ public final class dAtomDefinition extends cElementalDefinition { anti.putReplace(new cElementalDefinitionStack(stack.definition.getAnti(), stack.amount)); } try { - return new dAtomDefinition(anti.toImmutable_unsafeMightLeaveExposedElementalTree()); + return new dAtomDefinition(anti.toImmutable_optimized_unsafeLeavesExposedElementalTree()); } catch (tElementalException e) { if (DEBUG_MODE) { e.printStackTrace(); @@ -1285,14 +1314,7 @@ public final class dAtomDefinition extends cElementalDefinition { @Override public NBTTagCompound toNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setByte("t", nbtType); - cElementalDefinitionStack[] elementalStacksValues = elementalStacks.values(); - nbt.setInteger("i", elementalStacksValues.length); - for (int i = 0; i < elementalStacksValues.length; i++) { - nbt.setTag(Integer.toString(i), elementalStacksValues[i].toNBT()); - } - return nbt; + return getNbtTagCompound(nbtType, elementalStacks); } public static dAtomDefinition fromNBT(NBTTagCompound nbt) { @@ -1368,7 +1390,7 @@ public final class dAtomDefinition extends cElementalDefinition { new cElementalDefinitionStack(dHadronDefinition.hadron_n, integerTreeSetEntry.getValue().first()), new cElementalDefinitionStack(eLeptonDefinition.lepton_e, integerTreeSetEntry.getKey()))); if (DEBUG_MODE) { - TecTech.Logger.info("Added Stable Atom:" + integerTreeSetEntry.getKey() + ' ' + integerTreeSetEntry.getValue().first() + ' ' + stableAtoms.get(integerTreeSetEntry.getKey()).getMass()); + TecTech.LOGGER.info("Added Stable Atom:" + integerTreeSetEntry.getKey() + ' ' + integerTreeSetEntry.getValue().first() + ' ' + stableAtoms.get(integerTreeSetEntry.getKey()).getMass()); } } for (Map.Entry<Integer, TreeMap<Float, Integer>> integerTreeMapEntry : mostStableUnstableIsotopes.entrySet()) { @@ -1377,7 +1399,7 @@ public final class dAtomDefinition extends cElementalDefinition { new cElementalDefinitionStack(dHadronDefinition.hadron_n, integerTreeMapEntry.getValue().lastEntry().getValue()), new cElementalDefinitionStack(eLeptonDefinition.lepton_e, integerTreeMapEntry.getKey()))); if (DEBUG_MODE) { - TecTech.Logger.info("Added Unstable Atom:" + integerTreeMapEntry.getKey() + ' ' + integerTreeMapEntry.getValue().lastEntry().getValue() + ' ' + unstableAtoms.get(integerTreeMapEntry.getKey()).getMass()); + TecTech.LOGGER.info("Added Unstable Atom:" + integerTreeMapEntry.getKey() + ' ' + integerTreeMapEntry.getValue().lastEntry().getValue() + ' ' + unstableAtoms.get(integerTreeMapEntry.getKey()).getMass()); } } deuterium=new dAtomDefinition( @@ -1425,7 +1447,7 @@ public final class dAtomDefinition extends cElementalDefinition { } } if(DEBUG_MODE) { - TecTech.Logger.info("Registered Elemental Matter Class: Atom " + nbtType + ' ' + 64); + TecTech.LOGGER.info("Registered Elemental Matter Class: Atom " + nbtType + ' ' + 64); } } @@ -1447,7 +1469,7 @@ public final class dAtomDefinition extends cElementalDefinition { transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(12), 144), dust, Materials.Magnesium,1); transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(13), 144), dust, Materials.Aluminium,1); transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(14), 144), dust, Materials.Silicon,1); - transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(15), 144), dust, Materials.Phosphor,1); + transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(15), 144), dust, Materials.Phosphorus,1); transformation.addOredict(new cElementalDefinitionStack(getFirstStableIsotope(16), 144), dust, Materials.Sulfur,1); transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(17), 144),Materials.Chlorine.mGas.getID(), 144); transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(18), 144),Materials.Argon.mGas.getID(), 144); @@ -1557,7 +1579,7 @@ public final class dAtomDefinition extends cElementalDefinition { ); transformation.addOredict(new cElementalDefinitionStack(temp, 144), dust, Materials.Uranium235,1); - TecTech.Logger.info("Diff Mass U : "+(tempMass-temp.getMass())); + TecTech.LOGGER.info("Diff Mass U : "+(tempMass-temp.getMass())); temp=new dAtomDefinition( new cElementalDefinitionStack(eLeptonDefinition.lepton_e, 94), @@ -1573,9 +1595,9 @@ public final class dAtomDefinition extends cElementalDefinition { ); transformation.addOredict(new cElementalDefinitionStack(somethingHeavy, 144), dust, Materials.Plutonium241,1); - TecTech.Logger.info("Diff Mass Pu: "+(somethingHeavy.getMass()-temp.getMass())); + TecTech.LOGGER.info("Diff Mass Pu: "+(somethingHeavy.getMass()-temp.getMass())); - TecTech.Logger.info("Neutron Mass: "+dHadronDefinition.hadron_n.getMass()); + TecTech.LOGGER.info("Neutron Mass: "+dHadronDefinition.hadron_n.getMass()); } catch (tElementalException e) { if (DEBUG_MODE) { @@ -1583,7 +1605,7 @@ public final class dAtomDefinition extends cElementalDefinition { } } - if(Loader.isModLoaded("miscutils")) { + if(Loader.isModLoaded(Reference.GTPLUSPLUS)) { new GtppAtomLoader().run(); } } @@ -1601,6 +1623,10 @@ public final class dAtomDefinition extends cElementalDefinition { return 64; } + public static byte getClassTypeStatic(){ + return 64; + } + @Override public int hashCode() { return hash; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/iaeaNuclide.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/iaeaNuclide.java index 49cb89b53c..10c537ed55 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/iaeaNuclide.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/iaeaNuclide.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.elementalMatter.definitions.complex.atom; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom; import com.github.technus.tectech.Util; @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.TreeMap; -import static com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; +import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; public final class iaeaNuclide { public static final double AMU_TO_EV_DIV_C_C=9.31494061E08D,MICRO_AMU_TO_EV_DIV_C_C=9.31494061E02D; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/hadron/dHadronDefinition.java index c08588090d..6b98cd2a99 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/hadron/dHadronDefinition.java @@ -1,17 +1,17 @@ -package com.github.technus.tectech.elementalMatter.definitions.complex.hadron; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.cElementalMutableDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.tElementalException; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.transformations.*; -import com.github.technus.tectech.elementalMatter.definitions.primitive.eBosonDefinition; -import com.github.technus.tectech.elementalMatter.definitions.primitive.eQuarkDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalMutableDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.*; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import net.minecraft.nbt.NBTTagCompound; @@ -19,9 +19,10 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.transformation; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.eBosonDefinition.boson_Y__; +import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition.getNbtTagCompound; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition.transformation; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition.boson_Y__; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; import static gregtech.api.enums.OrePrefixes.dust; @@ -222,6 +223,21 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi } @Override + public boolean usesMultipleDecayCalls(long energyLevel) { + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return false; + } + + @Override + public boolean fusionMakesEnergy(long energyLevel) { + return false; + } + + @Override public cElementalDecay[] getDecayArray() { cElementalDefinitionStack[] quarkStacks = this.quarkStacks.values(); if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType()) { @@ -314,7 +330,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi anti.putReplace(new cElementalDefinitionStack(stack.definition.getAnti(), stack.amount)); } try { - return new dHadronDefinition(anti.toImmutable_unsafeMightLeaveExposedElementalTree()); + return new dHadronDefinition(anti.toImmutable_optimized_unsafeLeavesExposedElementalTree()); } catch (tElementalException e) { if (DEBUG_MODE) { e.printStackTrace(); @@ -340,14 +356,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public NBTTagCompound toNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setByte("t", nbtType); - cElementalDefinitionStack[] quarkStacksValues = quarkStacks.values(); - nbt.setInteger("i", quarkStacksValues.length); - for (int i = 0; i < quarkStacksValues.length; i++) { - nbt.setTag(Integer.toString(i), quarkStacksValues[i].toNBT()); - } - return nbt; + return getNbtTagCompound(nbtType, quarkStacks); } public static dHadronDefinition fromNBT(NBTTagCompound nbt) { @@ -400,7 +409,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi } } if(DEBUG_MODE) { - TecTech.Logger.info("Registered Elemental Matter Class: Hadron " + nbtType + ' ' + -64); + TecTech.LOGGER.info("Registered Elemental Matter Class: Hadron " + nbtType + ' ' + -64); } } @@ -419,6 +428,10 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi return -64; } + public static byte getClassTypeStatic(){ + return -64; + } + @Override public int hashCode() { return hash; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/cPrimitiveDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/cPrimitiveDefinition.java index 24904e6a31..6b23c232c7 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/cPrimitiveDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/cPrimitiveDefinition.java @@ -1,8 +1,8 @@ -package com.github.technus.tectech.elementalMatter.definitions.primitive; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; -import static com.github.technus.tectech.elementalMatter.core.cElementalDecay.noDecay; +import static com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay.noDecay; /** * Created by danie_000 on 22.10.2016. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eBosonDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eBosonDefinition.java index 636cd9b8fc..dada9b9c10 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eBosonDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eBosonDefinition.java @@ -1,8 +1,8 @@ -package com.github.technus.tectech.elementalMatter.definitions.primitive; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; /** * Created by danie_000 on 22.10.2016. @@ -36,6 +36,6 @@ public final class eBosonDefinition extends cElementalPrimitive { @Override public boolean isTimeSpanHalfLife() { - return false; + return this==boson_H__; } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eLeptonDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eLeptonDefinition.java index 0e7abf4a42..412fcfcd4e 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eLeptonDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eLeptonDefinition.java @@ -1,8 +1,8 @@ -package com.github.technus.tectech.elementalMatter.definitions.primitive; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; /** * Created by danie_000 on 22.10.2016. diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eNeutrinoDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eNeutrinoDefinition.java index 459719a8a4..9f20908575 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eNeutrinoDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eNeutrinoDefinition.java @@ -1,8 +1,8 @@ -package com.github.technus.tectech.elementalMatter.definitions.primitive; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; /** * Created by danie_000 on 22.10.2016. @@ -26,7 +26,7 @@ public final class eNeutrinoDefinition extends cElementalPrimitive { } public static void run() { - lepton_Ve.init(lepton_Ve_, 1F, 0, 0, + lepton_Ve.init(lepton_Ve_, 1F, -1, -1, cElementalDecay.noProduct); lepton_Vm.init(lepton_Vm_, 1F, 1, 0, new cElementalDecay(0.825F, nothing), @@ -35,7 +35,7 @@ public final class eNeutrinoDefinition extends cElementalPrimitive { new cElementalDecay(0.75F, nothing), eBosonDefinition.deadEnd); - lepton_Ve_.init(lepton_Ve, 1F, 0, 0, + lepton_Ve_.init(lepton_Ve, 1F, -1, -1, cElementalDecay.noProduct); lepton_Vm_.init(lepton_Vm, 1F, 1, 0, new cElementalDecay(0.825F, nothing), diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eQuarkDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eQuarkDefinition.java index 3abf04464f..9a7dd6753a 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eQuarkDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/eQuarkDefinition.java @@ -1,7 +1,7 @@ -package com.github.technus.tectech.elementalMatter.definitions.primitive; +package com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive; -import com.github.technus.tectech.elementalMatter.core.cElementalDecay; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; /** * Created by danie_000 on 22.10.2016. diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index e64a68304f..a797a65d09 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -6,13 +6,9 @@ import codechicken.nei.PositionedStack; import codechicken.nei.guihook.GuiContainerManager; import codechicken.nei.guihook.IContainerInputHandler; import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; +import codechicken.nei.recipe.*; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.recipe.TT_recipe; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.OrePrefixes; diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java index 5a46f13f12..8154816cfc 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java @@ -6,13 +6,9 @@ import codechicken.nei.PositionedStack; import codechicken.nei.guihook.GuiContainerManager; import codechicken.nei.guihook.IContainerInputHandler; import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; +import codechicken.nei.recipe.*; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.recipe.TT_recipe; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.OrePrefixes; diff --git a/src/main/java/com/github/technus/tectech/network/Dispatcher.java b/src/main/java/com/github/technus/tectech/network/Dispatcher.java deleted file mode 100644 index cae93a7ce8..0000000000 --- a/src/main/java/com/github/technus/tectech/network/Dispatcher.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.technus.tectech.network; - -import com.github.technus.tectech.auxiliary.Reference; -import eu.usrv.yamcore.network.PacketDispatcher; - -/** - * Created by Bass on 25/07/2017. - */ -public class Dispatcher extends PacketDispatcher { - public Dispatcher() { - super(Reference.MODID); - } - - @Override - public void registerPackets() { - //this.registerMessage(SpawnParticleFXMessage.SpawnParticleFXMessageHandler.class, SpawnParticleFXMessage.class); - } -} diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 92e0fa6822..255cf56e96 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -1,7 +1,8 @@ package com.github.technus.tectech.proxy; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.compatibility.openmodularturrets.TT_turret_loader; import com.github.technus.tectech.entity.fx.BlockHint; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumGlassRender; @@ -18,10 +19,10 @@ import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.particle.EntityExplodeFX; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import openmodularturrets.TT_turret_loader; import org.lwjgl.opengl.GL11; public class ClientProxy extends CommonProxy { @@ -42,8 +43,8 @@ public class ClientProxy extends CommonProxy { public void hint_particle(World world, int x, int y, int z, Block block, int meta) { Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(world,x,y,z,block,meta)); - EntityFX particle = new EntityExplodeFX(world, x + TecTech.Rnd.nextFloat() * 0.5F, y + TecTech.Rnd.nextFloat() * 0.5F, z + TecTech.Rnd.nextFloat() * 0.5F, 0, 0, 0); - particle.setRBGColorF(0, 0.6F * TecTech.Rnd.nextFloat(), 0.8f); + EntityFX particle = new EntityExplodeFX(world, x + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); Minecraft.getMinecraft().effectRenderer.addEffect(particle); } @@ -58,8 +59,15 @@ public class ClientProxy extends CommonProxy { //aDir.offsetY*0.1F+0.2F+0.1F*floatGen.nextFloat(); float xSpd = 0; float zSpd = 0; - EntityFX particle = new EntityExplodeFX(aMuffler.getWorld(), xPos + TecTech.Rnd.nextFloat() * 0.5F, yPos + TecTech.Rnd.nextFloat() * 0.5F, zPos + TecTech.Rnd.nextFloat() * 0.5F, xSpd, ySpd, zSpd); - particle.setRBGColorF(0, 0.6F * TecTech.Rnd.nextFloat(), 0.8f); + EntityFX particle = new EntityExplodeFX(aMuffler.getWorld(), xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); + Minecraft.getMinecraft().effectRenderer.addEffect(particle); + } + + @Override + public void em_particle(World w,double x,double y,double z) {//CUTE! + EntityFX particle = new EntityExplodeFX(w, x + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); Minecraft.getMinecraft().effectRenderer.addEffect(particle); } @@ -113,4 +121,21 @@ public class ClientProxy extends CommonProxy { public void playSound(IGregTechTileEntity base,String name) { base.getWorld().playSoundEffect(base.getXCoord(),base.getYCoord(),base.getZCoord(), Reference.MODID+':'+name, 1, 1); } + + @Override + public void renderAABB(World w,AxisAlignedBB box) { + em_particle(w,box.minX,box.minY,box.minZ); + em_particle(w,box.minX,box.minY,box.maxZ); + em_particle(w,box.minX,box.maxY,box.maxZ); + em_particle(w,box.minX,box.maxY,box.minZ); + em_particle(w,box.maxX,box.maxY,box.minZ); + em_particle(w,box.maxX,box.maxY,box.maxZ); + em_particle(w,box.maxX,box.minY,box.maxZ); + em_particle(w,box.maxX,box.minY,box.minZ); + } + + @Override + public void renderAABB(AxisAlignedBB box) { + renderAABB(Minecraft.getMinecraft().theWorld,box); + } } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 271887d579..598a8b148f 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -5,14 +5,17 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; public class CommonProxy implements IGuiHandler { public void registerRenderInfo() {} public void hint_particle(World world, int x, int y, int z, Block block, int meta){} public void em_particle(IGregTechTileEntity aMuffler, byte facing) {}//CUTE! + public void em_particle(World w,double x,double y,double z){} @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { @@ -42,4 +45,40 @@ public class CommonProxy implements IGuiHandler { public void printInchat(String... strings){} public void playSound(IGregTechTileEntity base,String name){} + + public void renderAABB(AxisAlignedBB box){} + public void renderAABB(World w,AxisAlignedBB box){} + + public String getUUID(String name) { + for(WorldServer worldServer:MinecraftServer.getServer().worldServers){ + for(Object o:worldServer.playerEntities){ + if(o instanceof EntityPlayer && ((EntityPlayer) o).getGameProfile().getName().equals(name)){ + return ((EntityPlayer) o).getGameProfile().getId().toString(); + } + } + } + return null; + } + + public boolean isOnlineName(String name) { + for(WorldServer worldServer:MinecraftServer.getServer().worldServers){ + for(Object o:worldServer.playerEntities){ + if(o instanceof EntityPlayer && ((EntityPlayer) o).getGameProfile().getName().equals(name)){ + return true; + } + } + } + return false; + } + + public boolean isOnlineUUID(String uuid) { + for(WorldServer worldServer:MinecraftServer.getServer().worldServers){ + for(Object o:worldServer.playerEntities){ + if(o instanceof EntityPlayer && ((EntityPlayer) o).getGameProfile().getId().toString().equals(uuid)){ + return true; + } + } + } + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index ff26894729..57d479a705 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -1,9 +1,9 @@ package com.github.technus.tectech.recipe; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.templates.cElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.util.GT_Recipe; import net.minecraft.item.ItemStack; @@ -13,7 +13,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; public class TT_recipe extends GT_Recipe { public static final String E_RECIPE_ID = "eRecipeID"; diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 5f69cbbc6d..f38fc1fc60 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -1,19 +1,25 @@ package com.github.technus.tectech.recipe; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; import com.github.technus.tectech.thing.item.ElementalDefinitionContainer_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import gregtech.api.enums.ItemList; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import gregtech.common.GT_RecipeAdder; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -public class TT_recipeAdder extends GT_RecipeAdder { +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class TT_recipeAdder extends GT_RecipeAdder { public static final ItemStack[] nullItem=new ItemStack[0]; public static final FluidStack[] nullFluid=new FluidStack[0]; @@ -29,7 +35,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { } for(ItemStack tItem : aInputs){ if(tItem==null){ - TecTech.Logger.error("addResearchableAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + TecTech.LOGGER.error("addResearchableAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } if(researchAmperage<=0) { @@ -44,7 +50,72 @@ public class TT_recipeAdder extends GT_RecipeAdder { } TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")}, aFluidInputs, null, assDuration, assEUt, 0,true); - GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, 0/*ignored*/, aInputs, aFluidInputs, aOutput, assDuration, assEUt)); + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, totalComputationRequired/computationRequiredPerSec, aInputs, aFluidInputs, aOutput, assDuration, assEUt)); + return true; + } + + public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int assDuration, int assEUt) { + if(aInputs==null) { + aInputs = nullItem; + } + if(aFluidInputs==null) { + aFluidInputs = nullFluid; + } + if (aResearchItem==null || totalComputationRequired<=0 || aOutput == null || aInputs.length>15 || aFluidInputs.length>4 || assDuration<=0 || assEUt<=0) { + return false; + } + + ItemStack[] tInputs = new ItemStack[aInputs.length]; + ItemStack[][] tAlts = new ItemStack[aInputs.length][]; + for(int i = 0; i < aInputs.length; i++){ + Object obj = aInputs[i]; + if (obj instanceof ItemStack) { + tInputs[i] = (ItemStack) obj; + tAlts[i] = null; + continue; + } else if (obj instanceof ItemStack[]) { + ItemStack[] aStacks = (ItemStack[]) obj; + if (aStacks.length > 0) { + tInputs[i] = aStacks[0]; + tAlts[i] = Arrays.copyOf(aStacks, aStacks.length); + continue; + } + } else if (obj instanceof Object[]) { + Object[] objs = (Object[]) obj; + List<ItemStack> tList; + if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) { + try { + int tAmount = ((Number) objs[1]).intValue(); + List<ItemStack> uList = new ArrayList<>(); + for (ItemStack tStack : tList) { + ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack); + if (GT_Utility.isStackValid(uStack)) { + uList.add(uStack); + if (tInputs[i] == null) tInputs[i] = uStack; + } + } + tAlts[i] = uList.toArray(new ItemStack[0]); + continue; + } catch (Exception t) { + TecTech.LOGGER.error("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> there is some ... in that recipe"); + } + } + } + TecTech.LOGGER.error("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + } + if(researchAmperage<=0) { + researchAmperage = 1; + } else if(researchAmperage > Short.MAX_VALUE) { + researchAmperage = Short.MAX_VALUE; + } + if(computationRequiredPerSec<=0) { + computationRequiredPerSec = 1; + } else if(computationRequiredPerSec > Short.MAX_VALUE) { + computationRequiredPerSec = Short.MAX_VALUE; + } + TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},aFluidInputs,null,assDuration,assEUt,0,tAlts,true); + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, totalComputationRequired/computationRequiredPerSec, tInputs, aFluidInputs, aOutput, assDuration, assEUt, tAlts)); return true; } @@ -70,7 +141,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { } for(ItemStack tItem : aInputs){ if(tItem==null){ - TecTech.Logger.error("addResearchableEMmachineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + TecTech.LOGGER.error("addResearchableEMmachineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } if(researchAmperage<=0) { @@ -127,7 +198,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { } for(ItemStack tItem : aInputs){ if(tItem==null){ - TecTech.Logger.error("addScannableEMmachineRecipe "+aResearchEM+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + TecTech.LOGGER.error("addScannableEMmachineRecipe "+aResearchEM+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } if(researchAmperage<=0) { diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index be42c6a13e..a062693db4 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -11,7 +11,24 @@ import net.minecraft.item.ItemStack; import static gregtech.api.enums.GT_Values.W; public enum CustomItemList implements IItemContainer { - hatch_CreativeMaitenance, Machine_DebugWriter,Machine_DebugGenny, + Casing_UEV,Casing_UIV,Casing_UMV,Casing_UXV,Casing_OPV,Casing_MAXV, + Hull_UEV,Hull_UIV,Hull_UMV,Hull_UXV,Hull_OPV,Hull_MAXV, + Transformer_UEV_UHV,Transformer_UIV_UEV,Transformer_UMV_UIV, + Transformer_UXV_UMV,Transformer_OPV_UXV,Transformer_MAXV_OPV, + WetTransformer_LV_ULV,WetTransformer_MV_LV,WetTransformer_HV_MV,WetTransformer_EV_HV, + WetTransformer_IV_EV,WetTransformer_LuV_IV,WetTransformer_ZPM_LuV,WetTransformer_UV_ZPM, + WetTransformer_UHV_UV,WetTransformer_UEV_UHV,WetTransformer_UIV_UEV,WetTransformer_UMV_UIV, + WetTransformer_UXV_UMV,WetTransformer_OPV_UXV,WetTransformer_MAXV_OPV, + + Transformer_HA_UEV_UHV,Transformer_HA_UIV_UEV,Transformer_HA_UMV_UIV,Transformer_HA_UXV_UMV, + Transformer_HA_OPV_UXV,Transformer_HA_MAXV_OPV, + + hatch_CreativeMaitenance, + Machine_OwnerDetector,Machine_DataReader, + Machine_BuckConverter_IV,Machine_BuckConverter_LuV,Machine_BuckConverter_ZPM, + Machine_BuckConverter_UV,Machine_BuckConverter_UHV,Machine_BuckConverter_UEV, + Machine_BuckConverter_UIV,Machine_BuckConverter_UMV, Machine_BuckConverter_UXV, + Machine_DebugWriter,Machine_DebugGenny, EMpipe, DATApipe, rack_Hatch, holder_Hatch, capacitor_Hatch, eM_dynamomulti4_IV, eM_dynamomulti16_IV, eM_dynamomulti64_IV, @@ -37,12 +54,12 @@ public enum CustomItemList implements IItemContainer { eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV, eM_out_UV, eM_out_UHV, eM_out_UEV, eM_out_UIV, eM_out_UMV, eM_out_UXV, eM_muffler_UV, eM_muffler_UHV, eM_muffler_UEV, eM_muffler_UIV, eM_muffler_UMV, eM_muffler_UXV, - Parametrizer_Hatch, ParametrizerX_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, dataIn_Hatch, dataOut_Hatch, + Parametrizer_Hatch, ParametrizerX_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, dataIn_Hatch, dataOut_Hatch, dataInAss_Hatch, dataOutAss_Hatch, eM_Containment, eM_Containment_Field, eM_Containment_Advanced, eM_Coil, eM_Teleportation, eM_Dimensional, eM_Ultimate_Containment, eM_Ultimate_Containment_Advanced, eM_Ultimate_Containment_Field, eM_Spacetime, eM_Computer_Casing, eM_Computer_Bus, eM_Computer_Vent, eM_Hollow, eM_Power, debugBlock, Machine_Multi_Microwave, Machine_Multi_teslaCoil, Machine_Multi_Transformer, - Machine_Multi_Computer, Machine_Multi_Switch, Machine_Multi_Research, + Machine_Multi_Computer, Machine_Multi_Switch, Machine_Multi_Research, Machine_Multi_DataBank, Machine_Multi_MatterToEM, Machine_Multi_EMToMatter, Machine_Multi_EMjunction, Machine_Multi_Scanner, Machine_Multi_EssentiaToEM, Machine_Multi_EMToEssentia, Machine_Multi_Infuser, Machine_Multi_Collider, @@ -211,4 +228,4 @@ public enum CustomItemList implements IItemContainer { } return this; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java index 44018a7392..ef903cbf38 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java @@ -12,7 +12,7 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.Reference.MODID; /** * Created by danie_000 on 17.12.2016. diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffBlock.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffBlock.java index bd26c838ba..639a269523 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffBlock.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffBlock.java @@ -15,7 +15,7 @@ import net.minecraft.world.World; import java.util.ArrayList; import java.util.Random; -import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.Reference.MODID; /** * Created by danie_000 on 17.12.2016. diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java index add97c46a1..5d495a8355 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java @@ -58,9 +58,9 @@ public final class QuantumStuffRender implements ISimpleBlockRenderingHandler { tes.setBrightness(15728880); IIcon side = QuantumStuffBlock.stuff; for(int i=0;i<6;i++){ - float f = 1 - TecTech.Rnd.nextFloat() / 4f, g = f - TecTech.Rnd.nextFloat() / 4f, r = g - TecTech.Rnd.nextFloat() / 4f - 0.25f; + float f = 1 - TecTech.RANDOM.nextFloat() / 4f, g = f - TecTech.RANDOM.nextFloat() / 4f, r = g - TecTech.RANDOM.nextFloat() / 4f - 0.25f; tes.setColorOpaque_F(r, g, f); - float rotX=TecTech.Rnd.nextFloat()*2*(float) Math.PI,rotY=TecTech.Rnd.nextFloat()*2*(float) Math.PI,rotZ=TecTech.Rnd.nextFloat()*2*(float) Math.PI; + float rotX=TecTech.RANDOM.nextFloat()*2*(float) Math.PI,rotY=TecTech.RANDOM.nextFloat()*2*(float) Math.PI,rotZ=TecTech.RANDOM.nextFloat()*2*(float) Math.PI; tesAbuse(x,y,z,-1.425f,-1.425f,.1f,rotX,rotY,rotZ,side.getMinU(), side.getMaxV()); tesAbuse(x,y,z,-1.425f,1.425f,.1f,rotX,rotY,rotZ,side.getMinU(), side.getMinV()); tesAbuse(x,y,z,1.425f,1.425f,.1f,rotX,rotY,rotZ,side.getMaxU(), side.getMinV()); diff --git a/src/main/java/com/github/technus/tectech/thing/block/ReactorSimBlock.java b/src/main/java/com/github/technus/tectech/thing/block/ReactorSimBlock.java index ebe5808a4a..1440e16c62 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/ReactorSimBlock.java +++ b/src/main/java/com/github/technus/tectech/thing/block/ReactorSimBlock.java @@ -17,7 +17,7 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.Reference.MODID; /** * Created by danie_000 on 30.09.2017. diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java new file mode 100644 index 0000000000..78b0a2a6a9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java @@ -0,0 +1,59 @@ +package com.github.technus.tectech.thing.casing; + +import com.github.technus.tectech.thing.CustomItemList; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Block_Casings_Abstract; +import gregtech.common.blocks.GT_Material_Casings; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import static com.github.technus.tectech.thing.metaTileEntity.Textures.*; + +/** + * Created by danie_000 on 03.10.2016. + */ +public class GT_Block_CasingsNH + extends GT_Block_Casings_Abstract { + public static boolean mConnectedMachineTextures = true; + + public GT_Block_CasingsNH() { + super(GT_Item_CasingsNH.class, "gt.blockcasingsNH", GT_Material_Casings.INSTANCE); + for (byte b = 0; b < 16; b = (byte) (b + 1)) { + Textures.BlockIcons.casingTexturePages[8][b+64] = new GT_CopiedBlockTexture(this, 6, b); + /*IMPORTANT for block recoloring*/ + } + + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "UEV Machine Casing");//adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "UIV Machine Casing");//adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "UMV Machine Casing");//adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "UXV Machine Casing");//adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "OPV Machine Casing");//adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "MAX Machine Casing");//adding + + CustomItemList.Casing_UEV.set(new ItemStack(this,1,10)); + CustomItemList.Casing_UIV.set(new ItemStack(this,1,11)); + CustomItemList.Casing_UMV.set(new ItemStack(this,1,12)); + CustomItemList.Casing_UXV.set(new ItemStack(this,1,13)); + CustomItemList.Casing_OPV.set(new ItemStack(this,1,14)); + CustomItemList.Casing_MAXV.set(new ItemStack(this,1,15)); + } + + @Override + public void registerBlockIcons(IIconRegister aIconRegister) { + //super.registerBlockIcons(aIconRegister); + } + + @Override + public IIcon getIcon(int aSide, int aMeta) { + if (aSide == 0) { + return MACHINECASINGS_BOTTOM_TT[aMeta].getIcon(); + } + if (aSide == 1) { + return MACHINECASINGS_TOP_TT[aMeta].getIcon(); + } + return MACHINECASINGS_SIDE_TT[aMeta].getIcon(); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java index 5112f156c7..dc9e809b46 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.thing.casing; -import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.thing.CustomItemList; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsNH.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsNH.java new file mode 100644 index 0000000000..68a835c00a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsNH.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.thing.casing; + +import gregtech.common.blocks.GT_Item_Casings_Abstract; +import net.minecraft.block.Block; + +/** + * Created by danie_000 on 03.10.2016. + */ +public class GT_Item_CasingsNH + extends GT_Item_Casings_Abstract { + public GT_Item_CasingsNH(Block par1) { + super(par1); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java index 4526a98f2e..851046f34b 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java @@ -8,6 +8,7 @@ import net.minecraft.block.Block; public final class TT_Container_Casings { public static Block sBlockCasingsTT; public static Block sHintCasingsTT; + public static Block sBlockCasingsNH; private TT_Container_Casings() {} } diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index ab83518607..efb9e6d644 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -23,9 +23,8 @@ import net.minecraftforge.common.util.FakePlayer; import java.util.HashMap; import java.util.List; +import static com.github.technus.tectech.Reference.MODID; import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.auxiliary.Reference.MODID; -import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; import static gregtech.api.GregTech_API.sBlockCasings1; /** @@ -34,11 +33,11 @@ import static gregtech.api.GregTech_API.sBlockCasings1; public final class ConstructableTriggerItem extends Item { public static ConstructableTriggerItem INSTANCE; - public static HashMap<String,MultiblockInfoContainer> multiblockMap= new HashMap<>(); + private static HashMap<String,MultiblockInfoContainer> multiblockMap= new HashMap<>(); private ConstructableTriggerItem() { - setUnlocalizedName("em.debugBuilder"); - setTextureName(MODID + ":itemDebugBuilder"); + setUnlocalizedName("em.constructable"); + setTextureName(MODID + ":itemConstructable"); } @Override @@ -122,20 +121,20 @@ public final class ConstructableTriggerItem extends Item { INSTANCE = new ConstructableTriggerItem(); GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); - multiblockMap.put(GT_MetaTileEntity_ElectricBlastFurnace.class.getCanonicalName(), new MultiblockInfoContainer() { + registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new MultiblockInfoContainer() { //region Structure private final String[][] shape = new String[][]{ - {"000","111","111"," . ",}, - {"0!0","1A1","1A1"," ",}, - {"000","111","111"," ",}, + {"000","\"\"\"","\"\"\""," . ",}, + {"0!0","\"A\"","\"A\""," ",}, + {"000","\"\"\"","\"\"\""," ",}, }; - private final Block[] blockType = new Block[]{sBlockCasings1, sHintCasingsTT}; - private final byte[] blockMeta = new byte[]{11, 12}; + private final Block[] blockType = new Block[]{sBlockCasings1}; + private final byte[] blockMeta = new byte[]{11}; private final String[] desc=new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or Heat Proof Casing", "2 - Muffler Hatch", - "General - Coil blocks" + "3 - Coil blocks" }; //endregion @@ -156,4 +155,12 @@ public final class ConstructableTriggerItem extends Item { @SideOnly(Side.CLIENT) String[] getDescription(int stackSize); } + + public static void registerTileClass(Class<? extends TileEntity> clazz,MultiblockInfoContainer info){ + multiblockMap.put(clazz.getCanonicalName(),info); + } + + public static void registerMetaClass(Class<? extends IMetaTileEntity> clazz,MultiblockInfoContainer info){ + multiblockMap.put(clazz.getCanonicalName(),info); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java index 52ebed6a21..1f68163238 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java @@ -2,9 +2,12 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.iElementalInstanceContainer; -import com.github.technus.tectech.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.iElementalInstanceContainer; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -21,8 +24,8 @@ import net.minecraft.world.World; import java.util.Collections; import java.util.List; -import static com.github.technus.tectech.auxiliary.Reference.MODID; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 15.03.2017. @@ -71,6 +74,30 @@ public final class DebugElementalInstanceContainer_EM extends Item { return aPlayer instanceof EntityPlayerMP; } + public ItemStack setContent(ItemStack aStack,cElementalInstanceStackMap content){ + NBTTagCompound tNBT = aStack.getTagCompound(); + if(tNBT==null){ + aStack.setTagCompound(new NBTTagCompound()); + } + if (tNBT.hasKey("content")) { + try { + content.putUnifyAll(cElementalInstanceStackMap.fromNBT(tNBT.getCompoundTag("content"))); + } catch (tElementalException e) { + if (DEBUG_MODE) { + e.printStackTrace(); + } + return aStack; + } + tNBT.removeTag("content"); + tNBT.removeTag("info"); + } else if (content.hasStacks()) { + tNBT.setTag("info", content.getInfoNBT()); + tNBT.setTag("content", content.toNBT()); + content.clear(); + } + return aStack; + } + @Override public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { aList.add(CommonValues.TEC_MARK_EM); @@ -98,5 +125,10 @@ public final class DebugElementalInstanceContainer_EM extends Item { ItemStack that = new ItemStack(this, 1); that.setTagCompound(new NBTTagCompound()); list.add(that); + for(iElementalDefinition defintion:bTransformationInfo.stacksRegistered){ + list.add(setContent(new ItemStack(this).setStackDisplayName(defintion.getName()+" x"+1),new cElementalInstanceStackMap(new cElementalInstanceStack(defintion,1)))); + list.add(setContent(new ItemStack(this).setStackDisplayName(defintion.getName()+" x"+144),new cElementalInstanceStackMap(new cElementalInstanceStack(defintion,144)))); + list.add(setContent(new ItemStack(this).setStackDisplayName(defintion.getName()+" x"+1000),new cElementalInstanceStackMap(new cElementalInstanceStack(defintion,1000)))); + } } } diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java index c2137df464..e774704f46 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java @@ -2,8 +2,8 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalDefinitionStackMap; -import com.github.technus.tectech.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -14,8 +14,8 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.Collections; import java.util.List; -import static com.github.technus.tectech.auxiliary.Reference.MODID; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 15.03.2017. diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java index 4ba1323d15..97371e2449 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java @@ -3,8 +3,8 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.loader.ModGuiHandler; +import com.github.technus.tectech.loader.gui.ModGuiHandler; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.CustomItemList; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; @@ -21,7 +21,7 @@ import net.minecraft.world.World; import java.util.List; -import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.Reference.MODID; /** * Created by Tec on 15.03.2017. diff --git a/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java new file mode 100644 index 0000000000..8edcd32bdb --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java @@ -0,0 +1,79 @@ +package com.github.technus.tectech.thing.item; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Reference; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; + +import java.util.ArrayList; +import java.util.List; + +import static com.github.technus.tectech.Reference.MODID; + +public class EuMeterGT extends Item { + public static EuMeterGT INSTANCE; + + private EuMeterGT() { + setUnlocalizedName("em.EuMeterGT"); + setTextureName(MODID + ":itemEuMeterGT"); + setMaxStackSize(1); + } + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if(tTileEntity==null || aPlayer instanceof FakePlayer) { + return aPlayer instanceof EntityPlayerMP; + } + if (aPlayer instanceof EntityPlayerMP && !aPlayer.isSneaking() && tTileEntity instanceof IGregTechTileEntity) { + if (tTileEntity instanceof BaseMetaTileEntity) { + GT_Utility.sendChatToPlayer(aPlayer, EnumChatFormatting.AQUA+"----- X:"+aX+" Y:"+aY+" Z:"+aZ+" D:"+aWorld.provider.dimensionId+" S:"+aSide + " -----"); + GT_Utility.sendChatToPlayer(aPlayer, "Stored energy: "+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getUniversalEnergyStored())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GREEN+(((BaseMetaTileEntity) tTileEntity).getUniversalEnergyCapacity())); + GT_Utility.sendChatToPlayer(aPlayer, "Stored EU: "+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getStoredEU())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GREEN+(((BaseMetaTileEntity) tTileEntity).getEUCapacity())); + GT_Utility.sendChatToPlayer(aPlayer, "Average I/O: "+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getAverageElectricInput())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getAverageElectricOutput())); + GT_Utility.sendChatToPlayer(aPlayer, "Voltage I/O (max): "+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getInputVoltage())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getOutputVoltage())); + GT_Utility.sendChatToPlayer(aPlayer, "Voltage I/O max: "+EnumChatFormatting.RED+(((BaseMetaTileEntity) tTileEntity).getMaxSafeInput())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.RED+(((BaseMetaTileEntity) tTileEntity).getMaxEnergyOutput())); + GT_Utility.sendChatToPlayer(aPlayer, "Amperage I/O (max): "+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getInputAmperage())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getOutputAmperage())); + GT_Utility.sendChatToPlayer(aPlayer, "Side capabilities: "+(((BaseMetaTileEntity) tTileEntity).inputEnergyFrom((byte) aSide)?"input ":"")+(((BaseMetaTileEntity) tTileEntity).outputsEnergyTo((byte) aSide)?"output ":"")); + return true; + } else if (tTileEntity instanceof BaseMetaPipeEntity) { + if(((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable){ + ArrayList<String> tList = new ArrayList<>(); + GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ); + for(String str:tList){ + GT_Utility.sendChatToPlayer(aPlayer,str); + } + } + return true; + } + } + if(!(aPlayer instanceof EntityPlayerMP)){ + GT_Utility.doSoundAtClient(Reference.MODID+":fx_scan", 1, 1.0F, (double)aX, (double)aY, (double)aZ); + } + return false; + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.TEC_MARK_GENERAL); + aList.add("Measures basic EU related stuff"); + aList.add(EnumChatFormatting.BLUE + "Just right click on blocks."); + } + + public static void run() { + INSTANCE = new EuMeterGT(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java new file mode 100644 index 0000000000..8e2a1c1a9b --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java @@ -0,0 +1,66 @@ +package com.github.technus.tectech.thing.item; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; + +import java.util.List; + +import static com.github.technus.tectech.Reference.MODID; + +/** + * Created by Tec on 15.03.2017. + */ +public final class FrontRotationTriggerItem extends Item { + public static FrontRotationTriggerItem INSTANCE; + + private FrontRotationTriggerItem() { + setUnlocalizedName("em.frontRotate"); + setTextureName(MODID + ":itemFrontRotate"); + } + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if(tTileEntity==null || aPlayer instanceof FakePlayer) { + return aPlayer instanceof EntityPlayerMP; + } + if (aPlayer instanceof EntityPlayerMP) { + if (tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (metaTE instanceof IFrontRotation) { + ((IFrontRotation) metaTE).rotateAroundFrontPlane(!aPlayer.isSneaking()); + System.out.println("DID SHIT"); + return true; + } + } else if (tTileEntity instanceof IFrontRotation) { + ((IFrontRotation) tTileEntity).rotateAroundFrontPlane(!aPlayer.isSneaking()); + return true; + } + } + return false; + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.TEC_MARK_GENERAL); + aList.add("Triggers Front Rotation Interface"); + aList.add(EnumChatFormatting.BLUE + "Rotates only the front panel,"); + aList.add(EnumChatFormatting.BLUE + "which allows structure rotation."); + } + + public static void run() { + INSTANCE = new FrontRotationTriggerItem(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index 883a1923a1..035b049a99 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -23,7 +23,7 @@ import net.minecraft.world.World; import java.util.List; -import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.Reference.MODID; import static com.github.technus.tectech.thing.CustomItemList.parametrizerMemory; /** diff --git a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java index 3c8411639a..753581439b 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java +++ b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.thing.item.gui; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; @@ -11,6 +10,7 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; +import static com.github.technus.tectech.Reference.MODID; import static org.lwjgl.opengl.GL11.*; /** @@ -23,15 +23,15 @@ public class ScanDisplayScreen extends GuiScreen { private final String[] lines; private int firstLine =0; - private static final ResourceLocation[] BACKGROUNDS =new ResourceLocation[]{new ResourceLocation("tectech:textures/gui/scanDisplayScreen1.png"), - new ResourceLocation("tectech:textures/gui/scanDisplayScreen2.png"), - new ResourceLocation("tectech:textures/gui/scanDisplayScreen3.png"), - new ResourceLocation("tectech:textures/gui/scanDisplayScreen4.png"), - new ResourceLocation("tectech:textures/gui/scanDisplayScreen5.png"), - new ResourceLocation("tectech:textures/gui/scanDisplayScreen6.png"), - new ResourceLocation("tectech:textures/gui/scanDisplayScreen7.png"), - new ResourceLocation("tectech:textures/gui/scanDisplayScreen8.png")}; - private static final ResourceLocation ITEM =new ResourceLocation("tectech:textures/gui/scanDisplayItem.png"); + private static final ResourceLocation[] BACKGROUNDS =new ResourceLocation[]{new ResourceLocation(MODID+":textures/gui/scanDisplayScreen1.png"), + new ResourceLocation(MODID+":textures/gui/scanDisplayScreen2.png"), + new ResourceLocation(MODID+":textures/gui/scanDisplayScreen3.png"), + new ResourceLocation(MODID+":textures/gui/scanDisplayScreen4.png"), + new ResourceLocation(MODID+":textures/gui/scanDisplayScreen5.png"), + new ResourceLocation(MODID+":textures/gui/scanDisplayScreen6.png"), + new ResourceLocation(MODID+":textures/gui/scanDisplayScreen7.png"), + new ResourceLocation(MODID+":textures/gui/scanDisplayScreen8.png")}; + private static final ResourceLocation ITEM =new ResourceLocation(MODID+"::textures/gui/scanDisplayItem.png"); public ScanDisplayScreen(EntityPlayer player){ lines=ElementalDefinitionScanStorage_EM.getLines(player.getHeldItem()); @@ -50,7 +50,7 @@ public class ScanDisplayScreen extends GuiScreen { glDisable(GL_BLEND); super.drawScreen(x,y,partialTicks); - itick=(TecTech.Rnd.nextInt(0x66)<<16)+0x77EEFF; + itick=(TecTech.RANDOM.nextInt(0x66)<<16)+0x77EEFF; int textBaseX=baseX+20; int textBaseXX=baseX+95; int textBaseY=baseY+28; @@ -149,7 +149,7 @@ public class ScanDisplayScreen extends GuiScreen { @Override public void func_146113_a(SoundHandler soundHandler) { - soundHandler.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(Reference.MODID+":fx_click"), 1.0F)); + soundHandler.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(MODID+":fx_click"), 1.0F)); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java new file mode 100644 index 0000000000..7ac296e41f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java @@ -0,0 +1,11 @@ +package com.github.technus.tectech.thing.metaTileEntity; + +public interface IFrontRotation { + boolean isFrontRotationValid(byte frontRotation, byte frontFacing); + + void rotateAroundFrontPlane(boolean direction); + + void forceSetRotationDoRender(byte frontRotation); + + byte getFrontRotation(); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java new file mode 100644 index 0000000000..99ff2bea97 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java @@ -0,0 +1,169 @@ +package com.github.technus.tectech.thing.metaTileEntity; + +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.GT_SidedTexture; + +import static gregtech.api.enums.Dyes.MACHINE_METAL; +import static gregtech.api.enums.Textures.BlockIcons.*; + +public class Textures { + private static IIconContainer OVERLAY_ENERGY_IN_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_IN_POWER"); + private static IIconContainer OVERLAY_ENERGY_OUT_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_POWER"); + private static IIconContainer MACHINE_UEV_SIDE = new CustomIcon("iconsets/MACHINE_UEV_SIDE"); + private static IIconContainer MACHINE_UIV_SIDE = new CustomIcon("iconsets/MACHINE_UIV_SIDE"); + private static IIconContainer MACHINE_UMV_SIDE = new CustomIcon("iconsets/MACHINE_UMV_SIDE"); + private static IIconContainer MACHINE_UXV_SIDE = new CustomIcon("iconsets/MACHINE_UXV_SIDE"); + private static IIconContainer MACHINE_OPV_SIDE = new CustomIcon("iconsets/MACHINE_OPV_SIDE"); + private static IIconContainer MACHINE_MAXV_SIDE = new CustomIcon("iconsets/MACHINE_MAXV_SIDE"); + private static IIconContainer MACHINE_UEV_TOP = new CustomIcon("iconsets/MACHINE_UEV_TOP"); + private static IIconContainer MACHINE_UIV_TOP = new CustomIcon("iconsets/MACHINE_UIV_TOP"); + private static IIconContainer MACHINE_UMV_TOP = new CustomIcon("iconsets/MACHINE_UMV_TOP"); + private static IIconContainer MACHINE_UXV_TOP = new CustomIcon("iconsets/MACHINE_UXV_TOP"); + private static IIconContainer MACHINE_OPV_TOP = new CustomIcon("iconsets/MACHINE_OPV_TOP"); + private static IIconContainer MACHINE_MAXV_TOP = new CustomIcon("iconsets/MACHINE_MAXV_TOP"); + private static IIconContainer MACHINE_UEV_BOTTOM = new CustomIcon("iconsets/MACHINE_UEV_BOTTOM"); + private static IIconContainer MACHINE_UIV_BOTTOM = new CustomIcon("iconsets/MACHINE_UIV_BOTTOM"); + private static IIconContainer MACHINE_UMV_BOTTOM = new CustomIcon("iconsets/MACHINE_UMV_BOTTOM"); + private static IIconContainer MACHINE_UXV_BOTTOM = new CustomIcon("iconsets/MACHINE_UXV_BOTTOM"); + private static IIconContainer MACHINE_OPV_BOTTOM = new CustomIcon("iconsets/MACHINE_OPV_BOTTOM"); + private static IIconContainer MACHINE_MAXV_BOTTOM = new CustomIcon("iconsets/MACHINE_MAXV_BOTTOM"); + + public static IIconContainer[] MACHINECASINGS_SIDE_TT = new IIconContainer[]{ + MACHINE_8V_SIDE, MACHINE_LV_SIDE, MACHINE_MV_SIDE, MACHINE_HV_SIDE, + MACHINE_EV_SIDE, MACHINE_IV_SIDE, MACHINE_LuV_SIDE, MACHINE_ZPM_SIDE, + MACHINE_UV_SIDE, MACHINE_MAX_SIDE, MACHINE_UEV_SIDE, MACHINE_UIV_SIDE, + MACHINE_UMV_SIDE, MACHINE_UXV_SIDE, MACHINE_OPV_SIDE, MACHINE_MAXV_SIDE, + }, MACHINECASINGS_TOP_TT = new IIconContainer[]{ + MACHINE_8V_TOP, MACHINE_LV_TOP, MACHINE_MV_TOP, MACHINE_HV_TOP, + MACHINE_EV_TOP, MACHINE_IV_TOP, MACHINE_LuV_TOP, MACHINE_ZPM_TOP, + MACHINE_UV_TOP, MACHINE_MAX_TOP, MACHINE_UEV_TOP, MACHINE_UIV_TOP, + MACHINE_UMV_TOP, MACHINE_UXV_TOP, MACHINE_OPV_TOP, MACHINE_MAXV_TOP, + }, MACHINECASINGS_BOTTOM_TT = new IIconContainer[]{ + MACHINE_8V_BOTTOM, MACHINE_LV_BOTTOM, MACHINE_MV_BOTTOM, MACHINE_HV_BOTTOM, + MACHINE_EV_BOTTOM, MACHINE_IV_BOTTOM, MACHINE_LuV_BOTTOM, MACHINE_ZPM_BOTTOM, + MACHINE_UV_BOTTOM, MACHINE_MAX_BOTTOM, MACHINE_UEV_BOTTOM, MACHINE_UIV_BOTTOM, + MACHINE_UMV_BOTTOM, MACHINE_UXV_BOTTOM, MACHINE_OPV_BOTTOM, MACHINE_MAXV_BOTTOM, + }; + public static ITexture[] OVERLAYS_ENERGY_IN_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}), + }, OVERLAYS_ENERGY_OUT_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}), + }, OVERLAYS_ENERGY_IN_MULTI_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}), + }, OVERLAYS_ENERGY_OUT_MULTI_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}), + }, OVERLAYS_ENERGY_IN_POWER_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}), + }, OVERLAYS_ENERGY_OUT_POWER_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}), + }; + + public static ITexture[][] MACHINE_CASINGS_TT = new ITexture[16][17]; + + public Textures(){ + for (byte i = 0; i < MACHINE_CASINGS_TT.length; i++) { + for (byte j = 0; j < MACHINE_CASINGS_TT[i].length; j++) { + MACHINE_CASINGS_TT[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM_TT[i], MACHINECASINGS_TOP_TT[i], MACHINECASINGS_SIDE_TT[i], Dyes.getModulation(j - 1, MACHINE_METAL.mRGBa)); + } + } + MACHINE_CASINGS=MACHINE_CASINGS_TT; + + OVERLAYS_ENERGY_IN=OVERLAYS_ENERGY_IN_TT; + OVERLAYS_ENERGY_OUT=OVERLAYS_ENERGY_OUT_TT; + OVERLAYS_ENERGY_IN_MULTI=OVERLAYS_ENERGY_IN_MULTI_TT; + OVERLAYS_ENERGY_OUT_MULTI=OVERLAYS_ENERGY_OUT_MULTI_TT; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java index a2b4057628..2aae2b8c2b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Capacitor; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Capacitor; import cpw.mods.fml.relauncher.Side; @@ -26,6 +27,7 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Capacitor(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 1, descr); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_Capacitor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java index 4a3914acfe..fe963c4d51 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java @@ -1,15 +1,19 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; public class GT_MetaTileEntity_Hatch_CreativeMaintenance extends GT_MetaTileEntity_Hatch_Maintenance { public GT_MetaTileEntity_Hatch_CreativeMaintenance(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_CreativeMaintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -18,10 +22,12 @@ public class GT_MetaTileEntity_Hatch_CreativeMaintenance extends GT_MetaTileEnti @Override public String[] getDescription() { - String[] desc = new String[this.mDescriptionArray.length + 1]; - System.arraycopy(this.mDescriptionArray, 0, desc, 0, this.mDescriptionArray.length); - desc[this.mDescriptionArray.length] = "Fixing is for plebs!"; - return desc; + return new String[]{ + CommonValues.BASS_MARK, + mDescription, + "Does fix everything but itself.", + EnumChatFormatting.AQUA + "Fixing is for plebs!" + }; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java index 16eb50b4e4..cb88d9861d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java @@ -1,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.dataFramework.QuantumDataPacket; -import com.github.technus.tectech.thing.metaTileEntity.pipe.iConnectsToDataPipe; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.mechanics.dataTransport.DataPacket; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Dyes; @@ -24,17 +25,18 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; /** * Created by danie_000 on 11.12.2016. */ -public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileEntity_Hatch implements iConnectsToDataPipe { - private static Textures.BlockIcons.CustomIcon EM_D_SIDES; - private static Textures.BlockIcons.CustomIcon EM_D_ACTIVE; - private static Textures.BlockIcons.CustomIcon EM_D_CONN; +public abstract class GT_MetaTileEntity_Hatch_DataConnector<T extends DataPacket> extends GT_MetaTileEntity_Hatch implements IConnectsToDataPipe { + public static Textures.BlockIcons.CustomIcon EM_D_SIDES; + public static Textures.BlockIcons.CustomIcon EM_D_ACTIVE; + public static Textures.BlockIcons.CustomIcon EM_D_CONN; - public QuantumDataPacket q; + public T q; public short id = -1; protected GT_MetaTileEntity_Hatch_DataConnector(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 0, descr); + Util.setTier(aTier,this); } protected GT_MetaTileEntity_Hatch_DataConnector(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -74,10 +76,12 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileE super.loadNBTData(aNBT); id = aNBT.getShort("eID"); if (aNBT.hasKey("eDATA")) { - q = new QuantumDataPacket(aNBT.getCompoundTag("eDATA")); + q = loadPacketFromNBT(aNBT.getCompoundTag("eDATA")); } } + protected abstract T loadPacketFromNBT(NBTTagCompound nbt); + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { @@ -142,11 +146,11 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileE @Override public String[] getInfoData() { if (id > 0) { - return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "Computation: " + EnumChatFormatting.AQUA + (q != null ? q.computation : 0), "PacketHistory: " + EnumChatFormatting.RED + (q != null ? q.trace.size() : 0),}; + return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "Content: " + EnumChatFormatting.AQUA + (q != null ? q.getContentString() : 0), "PacketHistory: " + EnumChatFormatting.RED + (q != null ? q.getTraceSize() : 0),}; } return new String[]{ - "Computation: " + EnumChatFormatting.AQUA + (q != null ? q.computation : 0), - "PacketHistory: " + EnumChatFormatting.RED + (q != null ? q.trace.size() : 0), + "Content: " + EnumChatFormatting.AQUA + (q != null ? q.getContentString() : 0), + "PacketHistory: " + EnumChatFormatting.RED + (q != null ? q.getTraceSize() : 0), }; } @@ -159,4 +163,9 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileE EnumChatFormatting.AQUA + "Must be painted to work" }; } + + @Override + public byte getColorization() { + return getBaseMetaTileEntity().getColorization(); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java index d83c0ba7e1..2ad4593984 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java @@ -1,58 +1,42 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; -import gregtech.api.enums.Textures; +import com.github.technus.tectech.Util; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import static com.github.technus.tectech.Util.V; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; /** * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch { public final int Amperes; - public final int eTier; - public static ITexture[] overlay; - static{ - try { - overlay=(ITexture[]) GT_Utility.getField(Textures.BlockIcons.class,"OVERLAYS_ENERGY_OUT_POWER").get(null); - }catch (IllegalAccessException | NullPointerException e){ - overlay = Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI; - } - } public GT_MetaTileEntity_Hatch_DynamoMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Extractor for Multiblocks"); Amperes = aAmp; - eTier=aTier; + Util.setTier(aTier,this); } - //public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { - // super(aName, aTier, 0, aDescription, aTextures); - // Amperes = aAmp; - // eTier=aTier; - //} - - public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int eTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); Amperes = aAmp; - this.eTier=eTier; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, overlay[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, overlay[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; } @Override @@ -92,12 +76,12 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch @Override public long maxEUOutput() { - return V[eTier]; + return V[mTier]; } @Override public long maxEUStore() { - return 512L + V[eTier] * 4L * Amperes; + return 512L + V[mTier] * 4L * Amperes; } @Override @@ -107,7 +91,7 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_DynamoMulti(mName, mTier, eTier, Amperes, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_DynamoMulti(mName, mTier, Amperes, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java new file mode 100644 index 0000000000..eeacf91014 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -0,0 +1,225 @@ +package com.github.technus.tectech.thing.metaTileEntity.hatch; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import static com.github.technus.tectech.CommonValues.TRANSFER_AT; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; + +/** + * Created by danie_000 on 16.12.2016. + */ +public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatch implements IConnectsToEnergyTunnel { + public final int Amperes; + private final long upkeep; + private long packetsCount=0; + + public GT_MetaTileEntity_Hatch_DynamoTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { + super(aID, aName, aNameRegional, aTier, 0, "Energy extracting terminal for Multiblocks"); + Amperes = aAmp; + Util.setTier(aTier,this); + upkeep=Math.max(V[mTier]/Amperes,V[4]); + } + + public GT_MetaTileEntity_Hatch_DynamoTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + Amperes = aAmp; + upkeep=aUpkeep; + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + packetsCount=aNBT.getLong("ePackets"); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("ePackets",packetsCount); + } + + @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 isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public long getMinimumStoredEU() { + return V[mTier]; + } + + @Override + public long maxEUOutput() { + return V[mTier]; + } + + @Override + public long maxEUStore() { + return 512L + V[mTier] * 4L * Amperes; + } + + @Override + public long maxAmperesOut() { + return 0; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_DynamoTunnel(mName, mTier, Amperes, upkeep, mDescription, mTextures); + } + + @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 false; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_GENERAL, + mDescription + }; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + byte Tick = (byte) (aTick % 20); + if (TRANSFER_AT == Tick) { + if(aBaseMetaTileEntity.getStoredEU()>=maxEUOutput()) { + long diff = aBaseMetaTileEntity.getStoredEU() / maxEUOutput(); + setEUVar(aBaseMetaTileEntity.getStoredEU() - diff * maxEUOutput()); + addPackets(diff); + } + if(packetsCount>0){ + moveAround(aBaseMetaTileEntity); + } + if(packetsCount>0){ + long diff=(maxEUStore()-aBaseMetaTileEntity.getStoredEU())/maxEUOutput(); + if(diff>0) { + setEUVar(aBaseMetaTileEntity.getStoredEU() + takePackets(diff) * maxEUOutput()); + } + } + if(aBaseMetaTileEntity.getStoredEU()>0){ + setEUVar(aBaseMetaTileEntity.getStoredEU()-upkeep); + if(aBaseMetaTileEntity.getStoredEU()<0){ + setEUVar(0); + } + } + getBaseMetaTileEntity().setActive(packetsCount>0); + } + } + } + + private void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { + byte color = getBaseMetaTileEntity().getColorization(); + if (color < 0) { + return; + } + byte front = aBaseMetaTileEntity.getFrontFacing(); + byte opposite = GT_Utility.getOppositeSide(front); + for (short dist = 1; dist < 1000; dist++) { + IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); + if (tGTTileEntity != null && tGTTileEntity.getColorization() == color) { + IMetaTileEntity aMetaTileEntity = tGTTileEntity.getMetaTileEntity(); + if (aMetaTileEntity != null) { + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyTunnel && + opposite == tGTTileEntity.getFrontFacing()) { + if(maxEUOutput()>((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()){ + aMetaTileEntity.doExplosion(maxEUOutput()); + }else if(maxEUOutput()==((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()){ + long ampRx=((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).Amperes; + if(packetsCount > ampRx && Amperes>ampRx){ + tGTTileEntity.setToFire(); + }else if(Amperes>ampRx){ + tGTTileEntity.setOnFire(); + ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).addPackets(takePackets(Amperes)); + }else { + ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).addPackets(takePackets(Amperes)); + } + } + return; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) { + if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount > 2) { + return; + } + } else { + return; + } + } else { + return; + } + } else { + return; + } + } + } + + @Override + public boolean canConnect(byte side) { + return isOutputFacing(side); + } + + public void addPackets(long count){ + packetsCount+=count; + } + + public long takePackets(long count){ + if(packetsCount>count){ + packetsCount-=count; + return count; + }else { + count=packetsCount; + packetsCount=0; + return count; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index 4ff8a5db75..c84057c121 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -1,10 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.iElementalInstanceContainer; -import com.github.technus.tectech.elementalMatter.core.tElementalException; -import com.github.technus.tectech.thing.metaTileEntity.pipe.iConnectsToEMpipe; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.iElementalInstanceContainer; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToElementalPipe; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Dyes; @@ -21,15 +22,14 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; import static com.github.technus.tectech.CommonValues.*; -import static com.github.technus.tectech.Util.V; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static gregtech.api.enums.Dyes.MACHINE_METAL; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; /** * Created by danie_000 on 11.12.2016. */ -public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_MetaTileEntity_Hatch implements iElementalInstanceContainer, iConnectsToEMpipe { +public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_MetaTileEntity_Hatch implements iElementalInstanceContainer, IConnectsToElementalPipe { private static Textures.BlockIcons.CustomIcon EM_T_SIDES; private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE; private static Textures.BlockIcons.CustomIcon EM_T_CONN; @@ -40,21 +40,14 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta public float overflowMatter = 0f; public short id = -1; private byte deathDelay = 2; - public final int eTier; protected GT_MetaTileEntity_Hatch_ElementalContainer(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 0, descr); - eTier=aTier; + Util.setTier(aTier,this); } - //public GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - // super(aName, aTier, 0, aDescription, aTextures); - // eTier=aTier; - //} - - protected GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, int eTier, String aDescription, ITexture[][][] aTextures) { + protected GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); - this.eTier=eTier; } @Override @@ -128,7 +121,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta if (tGTTileEntity != null && tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental) { GT_MetaTileEntity_Hatch_OverflowElemental aMetaTileEntity = (GT_MetaTileEntity_Hatch_OverflowElemental) tGTTileEntity.getMetaTileEntity(); if (aMetaTileEntity.addOverflowMatter(overflowMatter)) { - if (TecTech.ModConfig.BOOM_ENABLE) { + if (TecTech.configTecTech.BOOM_ENABLE) { tGTTileEntity.doExplosion(V[14]); } else { TecTech.proxy.broadcast("Container1 BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); @@ -138,9 +131,11 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta overflowMatter = 0F; } } else if (deathDelay < 1) { - if (TecTech.ModConfig.BOOM_ENABLE) { + if (TecTech.configTecTech.BOOM_ENABLE) { getBaseMetaTileEntity().doExplosion(V[14]); } else { + deathDelay=3; + overflowMatter=0; TecTech.proxy.broadcast("Container0 BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); } } @@ -204,11 +199,11 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } public int getMaxStacksCount() { - return eTier * 2; + return mTier * 2; } public int getMaxStackSize() { - return eTier * (eTier - 7) * 1000; + return mTier * (mTier - 7) * 1000; } @Override @@ -223,7 +218,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta @Override public String[] getInfoData() { - if(TecTech.ModConfig.EASY_SCAN) { + if(TecTech.configTecTech.EASY_SCAN) { if (id > 0) { if (content == null || content.size() == 0) { return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "No Stacks"}; @@ -276,7 +271,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta @Override public void onRemoval() { if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { - if (TecTech.ModConfig.BOOM_ENABLE) { + if (TecTech.configTecTech.BOOM_ENABLE) { getBaseMetaTileEntity().doExplosion(V[15]); } else { TecTech.proxy.broadcast("BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java index 7610cd8242..64dda8f84a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java @@ -1,59 +1,43 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; -import gregtech.api.enums.Textures; +import com.github.technus.tectech.Util; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.V; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; /** * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch { public final int Amperes; - public final int eTier; - public static ITexture[] overlay; - static{ - try { - overlay=(ITexture[]) GT_Utility.getField(Textures.BlockIcons.class,"OVERLAYS_ENERGY_IN_POWER").get(null); - }catch (IllegalAccessException | NullPointerException e){ - overlay = Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI; - } - } public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Injector for Multiblocks"); Amperes = aAmp; - eTier=aTier; + Util.setTier(aTier,this); } - //public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { - // super(aName, aTier, 0, aDescription, aTextures); - // Amperes = aAmp; - // eTier=aTier; - //} - - public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int eTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); Amperes = aAmp; - this.eTier=eTier; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, overlay[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, overlay[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; } @Override @@ -93,12 +77,12 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch @Override public long maxEUInput() { - return V[eTier]; + return V[mTier]; } @Override public long maxEUStore() { - return 512L + V[eTier] * 4L * Amperes; + return 512L + V[mTier] * 4L * Amperes; } @Override @@ -108,7 +92,7 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_EnergyMulti(mName, mTier, eTier, Amperes, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_EnergyMulti(mName, mTier, Amperes, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java new file mode 100644 index 0000000000..4e7fffcf9f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java @@ -0,0 +1,170 @@ +package com.github.technus.tectech.thing.metaTileEntity.hatch; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import static com.github.technus.tectech.CommonValues.TRANSFER_AT; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; + +/** + * Created by danie_000 on 16.12.2016. + */ +public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatch implements IConnectsToEnergyTunnel { + public final int Amperes; + private final long upkeep; + private long packetsCount=0; + + public GT_MetaTileEntity_Hatch_EnergyTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { + super(aID, aName, aNameRegional, aTier, 0, "Energy injecting terminal for Multiblocks"); + Amperes = aAmp; + Util.setTier(aTier,this); + upkeep=Math.max(V[mTier]/Amperes,V[4]); + } + + public GT_MetaTileEntity_Hatch_EnergyTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + Amperes = aAmp; + this.upkeep=aUpkeep; + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + packetsCount=aNBT.getLong("ePackets"); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("ePackets",packetsCount); + } + + @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 isInputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public long getMinimumStoredEU() { + return V[mTier]; + } + + @Override + public long maxEUInput() { + return V[mTier]; + } + + @Override + public long maxEUStore() { + return 512L + V[mTier] * 4L * Amperes; + } + + @Override + public long maxAmperesIn() { + return 0; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_EnergyTunnel(mName, mTier, Amperes, upkeep, mDescription, mTextures); + } + + @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 false; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_GENERAL, + mDescription, + }; + } + + @Override + public boolean canConnect(byte side) { + return isInputFacing(side); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + byte Tick = (byte) (aTick % 20); + if (TRANSFER_AT == Tick) { + if(packetsCount>0){ + long diff=(maxEUStore()-aBaseMetaTileEntity.getStoredEU())/maxEUInput(); + if(diff>0) { + setEUVar(aBaseMetaTileEntity.getStoredEU() + takePackets(diff) * maxEUInput()); + } + } + if(aBaseMetaTileEntity.getStoredEU()>0){ + setEUVar(aBaseMetaTileEntity.getStoredEU()-upkeep); + if(aBaseMetaTileEntity.getStoredEU()<0){ + setEUVar(0); + } + } + getBaseMetaTileEntity().setActive(packetsCount>0); + } + } + } + + public void addPackets(long count){ + packetsCount+=count; + } + + public long takePackets(long count){ + if(packetsCount>count){ + packetsCount-=count; + return count; + }else { + count=packetsCount; + packetsCount=0; + return count; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index ea40ec8fc3..409f8195e2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Holder; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Holder; import cpw.mods.fml.relauncher.Side; @@ -26,6 +27,7 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Holder(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 1, descr); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_Holder(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java index 8a3ae77b7f..8ea024d6dd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java @@ -1,18 +1,22 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; -import com.github.technus.tectech.thing.metaTileEntity.pipe.iConnectsToDataPipe; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.nbt.NBTTagCompound; /** * Created by danie_000 on 27.10.2016. */ -public class GT_MetaTileEntity_Hatch_InputData extends GT_MetaTileEntity_Hatch_DataConnector { - public boolean delDelay = true; +public class GT_MetaTileEntity_Hatch_InputData extends GT_MetaTileEntity_Hatch_DataConnector<QuantumDataPacket> { + private boolean delDelay = true; public GT_MetaTileEntity_Hatch_InputData(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Data Input for Multiblocks"); + super(aID, aName, aNameRegional, aTier, "Quantum Data Input for Multiblocks"); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_InputData(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -25,11 +29,21 @@ public class GT_MetaTileEntity_Hatch_InputData extends GT_MetaTileEntity_Hatch_D } @Override + protected QuantumDataPacket loadPacketFromNBT(NBTTagCompound nbt) { + return new QuantumDataPacket(nbt); + } + + @Override public boolean isInputFacing(byte aSide) { return aSide == getBaseMetaTileEntity().getFrontFacing(); } @Override + public boolean isDataInputFacing(byte side) { + return isInputFacing(side); + } + + @Override public boolean isOutputFacing(byte aSide) { return false; } @@ -40,21 +54,34 @@ public class GT_MetaTileEntity_Hatch_InputData extends GT_MetaTileEntity_Hatch_D } @Override - public boolean canConnect(byte side) { + public boolean canConnectData(byte side) { return isInputFacing(side); } @Override - public iConnectsToDataPipe getNext(iConnectsToDataPipe source) { + public IConnectsToDataPipe getNext(IConnectsToDataPipe source) { return null; } + public void setContents(QuantumDataPacket qIn){ + if(qIn==null){ + this.q=null; + }else{ + if(qIn.getContent()>0) { + this.q = qIn; + delDelay=true; + }else{ + this.q=null; + } + } + } + @Override public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { if (delDelay) { delDelay = false; } else { - q = null; + setContents(null); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java new file mode 100644 index 0000000000..80498ed8df --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java @@ -0,0 +1,229 @@ +package com.github.technus.tectech.thing.metaTileEntity.hatch; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe; +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess; +import gregtech.api.objects.GT_RenderedTexture; +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 java.util.ArrayList; + +import static com.github.technus.tectech.CommonValues.MOVE_AT; +import static com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DataConnector.*; +import static gregtech.api.enums.Dyes.MACHINE_METAL; + +public class GT_MetaTileEntity_Hatch_InputDataItems extends GT_MetaTileEntity_Hatch_DataAccess implements IConnectsToDataPipe { + private final String mDescription; + public boolean delDelay = true; + private ItemStack[] stacks; + + public GT_MetaTileEntity_Hatch_InputDataItems(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + Util.setTier(aTier,this); + mDescription="ItemStack Data Input for Multiblocks"; + } + + public GT_MetaTileEntity_Hatch_InputDataItems(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + mDescription=aDescription; + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_D_ACTIVE, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(EM_D_CONN)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_D_SIDES, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(EM_D_CONN)}; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_InputDataItems(this.mName, this.mTier, mDescription, this.mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } else { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @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 false; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isOutputFacing(byte aSide) { + return false; + } + + @Override + public boolean isInputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isDataInputFacing(byte side) { + return isInputFacing(side); + } + + @Override + public boolean canConnectData(byte side) { + return isInputFacing(side); + } + + @Override + public IConnectsToDataPipe getNext(IConnectsToDataPipe source) { + return null; + } + + public void setContents(InventoryDataPacket iIn){ + if(iIn==null){ + stacks=null; + }else{ + if(iIn.getContent().length>0) { + stacks = iIn.getContent(); + delDelay=true; + }else{ + stacks=null; + } + } + } + + @Override + public void onRemoval() { + stacks=null; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + NBTTagCompound stacksTag=new NBTTagCompound(); + if(stacks!=null){ + stacksTag.setInteger("count",stacks.length); + for(int i=0;i<stacks.length;i++){ + stacksTag.setTag(Integer.toString(i),stacks[i].writeToNBT(new NBTTagCompound())); + } + } + aNBT.setTag("data_stacks",stacksTag); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + NBTTagCompound stacksTag=new NBTTagCompound(); + int count=stacksTag.getInteger("count"); + if(count>0){ + ArrayList<ItemStack> stacks=new ArrayList<>(); + for(int i=0;i<count;i++){ + ItemStack stack=ItemStack.loadItemStackFromNBT(stacksTag.getCompoundTag(Integer.toString(i))); + if(stack!=null){ + stacks.add(stack); + } + } + if(stacks.size()>0) { + this.stacks = stacks.toArray(new ItemStack[0]); + } + } + } + + @Override + public int getSizeInventory() { + return stacks!=null?stacks.length:0; + } + + @Override + public ItemStack getStackInSlot(int aIndex) { + return stacks!=null && aIndex<stacks.length?stacks[aIndex]:null; + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity,aTick); + if(MOVE_AT == aTick % 20) { + if(stacks==null){ + getBaseMetaTileEntity().setActive(false); + } else { + getBaseMetaTileEntity().setActive(true); + if (delDelay) { + delDelay = false; + } else { + setContents(null); + } + } + } + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + mDescription, + "High speed fibre optics connector.", + EnumChatFormatting.AQUA + "Must be painted to work" + }; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public String[] getInfoData() { + return new String[]{ + "Content: Stack Count: "+(stacks==null?0:stacks.length) + }; + } + + @Override + public byte getColorization() { + return getBaseMetaTileEntity().getColorization(); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java index 35def63310..ccf7f1a063 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; +import com.github.technus.tectech.Util; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -10,19 +11,20 @@ import gregtech.api.metatileentity.MetaTileEntity; public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer { public GT_MetaTileEntity_Hatch_InputElemental(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Elemental Input for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)"); + Util.setTier(aTier,this); } //public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { // super(aName, aTier, aDescription, aTextures); //} - public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, int eTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, eTier,aDescription, aTextures); + public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_InputElemental(mName, mTier, eTier, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_InputElemental(mName, mTier, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java index ef5bc961bb..d0e5399f75 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java @@ -1,19 +1,23 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; -import com.github.technus.tectech.thing.metaTileEntity.pipe.iConnectsToDataPipe; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; +import net.minecraft.nbt.NBTTagCompound; /** * Created by danie_000 on 27.10.2016. */ -public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_DataConnector { +public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_DataConnector<QuantumDataPacket> { public GT_MetaTileEntity_Hatch_OutputData(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Data Output for Multiblocks"); + super(aID, aName, aNameRegional, aTier, "Quantum Data Output for Multiblocks"); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_OutputData(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -41,18 +45,27 @@ public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_ } @Override - public boolean canConnect(byte side) { + public boolean isDataInputFacing(byte side) { + return isInputFacing(side); + } + + @Override + protected QuantumDataPacket loadPacketFromNBT(NBTTagCompound nbt) { + return new QuantumDataPacket(nbt); + } + + @Override + public boolean canConnectData(byte side) { return isOutputFacing(side); } @Override public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { - iConnectsToDataPipe current = this, source = this, next; + IConnectsToDataPipe current = this, source = this, next; int range = 0; while ((next = current.getNext(source)) != null && range++ < 1000) { if (next instanceof GT_MetaTileEntity_Hatch_InputData) { - ((GT_MetaTileEntity_Hatch_InputData) next).q = q; - ((GT_MetaTileEntity_Hatch_InputData) next).delDelay = true; + ((GT_MetaTileEntity_Hatch_InputData) next).setContents(q); break; } source = current; @@ -62,27 +75,23 @@ public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_ } @Override - public iConnectsToDataPipe getNext(iConnectsToDataPipe source/*==this*/) { + public IConnectsToDataPipe getNext(IConnectsToDataPipe source/*==this*/) { IGregTechTileEntity base = getBaseMetaTileEntity(); byte color = base.getColorization(); if (color < 0) { return null; } IGregTechTileEntity next = base.getIGregTechTileEntityAtSide(base.getFrontFacing()); - if (next == null || color != base.getColorization()) { + if (next == null) { return null; } IMetaTileEntity meta = next.getMetaTileEntity(); - if (meta instanceof iConnectsToDataPipe) { - if (meta instanceof GT_MetaTileEntity_Hatch_InputData - && GT_Utility.getOppositeSide(next.getFrontFacing()) == base.getFrontFacing()) { - return (iConnectsToDataPipe) meta; - } - if (meta instanceof GT_MetaTileEntity_Pipe_Data - /*&& ((GT_MetaTileEntity_Pipe_Data) meta).connectionCount==2*/)//Checked later - { - return (iConnectsToDataPipe) meta; - } + if (meta instanceof GT_MetaTileEntity_Pipe_Data){ + return (IConnectsToDataPipe) meta; + }else if (meta instanceof GT_MetaTileEntity_Hatch_InputData && + ((GT_MetaTileEntity_Hatch_InputData) meta).getColorization()==color && + ((GT_MetaTileEntity_Hatch_InputData) meta).canConnectData(GT_Utility.getOppositeSide(base.getFrontFacing()))) { + return (IConnectsToDataPipe) meta; } return null; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java new file mode 100644 index 0000000000..82bda9d326 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java @@ -0,0 +1,138 @@ +package com.github.technus.tectech.thing.metaTileEntity.hatch; + +import com.github.technus.tectech.Util; +import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; +import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; +import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +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; + +public class GT_MetaTileEntity_Hatch_OutputDataItems extends GT_MetaTileEntity_Hatch_DataConnector<InventoryDataPacket> { + public GT_MetaTileEntity_Hatch_OutputDataItems(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "ItemStack Data Output for Multiblocks"); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_Hatch_OutputDataItems(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_OutputDataItems(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } else { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @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 false; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isInputFacing(byte aSide) { + return false; + } + + @Override + protected InventoryDataPacket loadPacketFromNBT(NBTTagCompound nbt) { + return new InventoryDataPacket(nbt); + } + + @Override + public boolean isDataInputFacing(byte side) { + return isInputFacing(side); + } + + @Override + public boolean canConnectData(byte side) { + return isOutputFacing(side); + } + + @Override + public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { + IConnectsToDataPipe current = this, source = this, next; + int range = 0; + while ((next = current.getNext(source)) != null && range++ < 1000) { + if (next instanceof GT_MetaTileEntity_Hatch_InputDataItems) { + ((GT_MetaTileEntity_Hatch_InputDataItems) next).setContents(q); + break; + } + source = current; + current = next; + } + q = null; + } + + @Override + public IConnectsToDataPipe getNext(IConnectsToDataPipe source/*==this*/) { + IGregTechTileEntity base = getBaseMetaTileEntity(); + byte color = base.getColorization(); + if (color < 0) { + return null; + } + IGregTechTileEntity next = base.getIGregTechTileEntityAtSide(base.getFrontFacing()); + if (next == null) { + return null; + } + IMetaTileEntity meta = next.getMetaTileEntity(); + if (meta instanceof GT_MetaTileEntity_Pipe_Data){ + return (IConnectsToDataPipe) meta; + }else if (meta instanceof GT_MetaTileEntity_Hatch_InputDataItems && + ((GT_MetaTileEntity_Hatch_InputDataItems) meta).getColorization()==color && + ((GT_MetaTileEntity_Hatch_InputDataItems) meta).canConnectData(GT_Utility.getOppositeSide(base.getFrontFacing()))) { + return (IConnectsToDataPipe) meta; + } + return null; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index 22ae90a3c0..942dc48256 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -13,19 +14,20 @@ import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer { public GT_MetaTileEntity_Hatch_OutputElemental(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Elemental Output for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)"); + Util.setTier(aTier,this); } //public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { // super(aName, aTier, aDescription, aTextures); //} - public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, int eTier,String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, eTier, aDescription, aTextures); + public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_OutputElemental(mName, mTier, eTier, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_OutputElemental(mName, mTier, mDescription, mTextures); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java index 4fa2682a27..867f814b63 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Dyes; @@ -26,7 +27,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.Locale; import static com.github.technus.tectech.CommonValues.DISPERSE_AT; -import static com.github.technus.tectech.Util.V; +import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.loader.MainLoader.elementalPollution; import static gregtech.api.enums.Dyes.MACHINE_METAL; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; @@ -42,30 +43,20 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity private float overflowMatter = 0f; public final float overflowMax; private final float overflowDisperse; - private final int eTier; public GT_MetaTileEntity_Hatch_OverflowElemental(int aID, String aName, String aNameRegional, int aTier, float max) { super(aID, aName, aNameRegional, aTier, 0, "Disposes excess elemental Matter"); overflowMatter = max / 2; overflowMax = max; overflowDisperse = overflowMax / (float) (30 - aTier); - eTier=aTier; + Util.setTier(aTier,this); } - //public GT_MetaTileEntity_Hatch_MufflerElemental(String aName, int aTier, float max, String aDescription, ITexture[][][] aTextures) { - // super(aName, aTier, 0, aDescription, aTextures); - // overflowMatter = max / 2; - // overflowMax = max; - // overflowDisperse = overflowMax / (float) (30 - aTier); - // eTier=aTier; - //} - - public GT_MetaTileEntity_Hatch_OverflowElemental(String aName, int aTier, int eTier, float max, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_OverflowElemental(String aName, int aTier, float max, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); overflowMatter = max / 2; overflowMax = max; overflowDisperse = overflowMax / (float) (30 - aTier); - this.eTier=eTier; } @Override @@ -121,7 +112,7 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_OverflowElemental(mName, mTier, eTier, overflowMax, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_OverflowElemental(mName, mTier, overflowMax, mDescription, mTextures); } @Override @@ -211,7 +202,7 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity @Override public void onRemoval() { if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { - if (TecTech.ModConfig.BOOM_ENABLE) { + if (TecTech.configTecTech.BOOM_ENABLE) { getBaseMetaTileEntity().doExplosion(V[15]); } else { TecTech.proxy.broadcast("Muffler BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java index ba65fe90a8..2a2812368b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java @@ -38,6 +38,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Param(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 0, "For parametrization of Multiblocks"); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_Param(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -54,7 +55,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier >= 10) { + if (mTier > 7) { return new GT_Container_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); } return new GT_Container_Param(aPlayerInventory, aBaseMetaTileEntity); @@ -62,7 +63,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier >= 10) { + if (mTier > 7) { return new GT_GUIContainer_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); } return new GT_GUIContainer_Param(aPlayerInventory, aBaseMetaTileEntity); @@ -104,7 +105,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - if(mTier>=10) { + if(mTier>7) { return new String[]{"Parametrizer ID: " + EnumChatFormatting.GREEN + param, "Value 0I: " + EnumChatFormatting.AQUA + value0i, "Value 0FB: " + EnumChatFormatting.AQUA + Float.intBitsToFloat(value0i) + ' ' + Util.intBitsToShortString(value0i), "Value 1I: " + EnumChatFormatting.BLUE + value1i, "Value 1FB: " + EnumChatFormatting.BLUE + Float.intBitsToFloat(value1i) + ' ' + Util.intBitsToShortString(value1i), "Input 0I: " + EnumChatFormatting.GOLD + input0i, "Input 0FB: " + EnumChatFormatting.GOLD + Float.intBitsToFloat(input0i) + ' ' + Util.intBitsToShortString(input0i), "Input 1I: " + EnumChatFormatting.YELLOW + input1i, "Input 1FB: " + EnumChatFormatting.YELLOW + Float.intBitsToFloat(input1i) + ' ' + Util.intBitsToShortString(input1i),}; } return new String[]{ @@ -199,12 +200,12 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { } public boolean isUsingFloats() { - return mTier >= 10 && usesFloat; + return mTier > 7 && usesFloat; } //returns - succeded public boolean setUsingFloats(boolean value){ - if(mTier>=10){ + if(mTier>7){ usesFloat=value; return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java index b06bef34ee..37cb66d97a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java @@ -1,7 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Rack; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Rack; import cpw.mods.fml.common.Loader; @@ -26,7 +28,7 @@ import java.util.Map; import static com.github.technus.tectech.CommonValues.MULTI_CHECK_AT; import static com.github.technus.tectech.Util.getUniqueIdentifier; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 03.04.2017. @@ -40,6 +42,7 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Rack(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 4, descr); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_Rack(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -162,8 +165,8 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { } else if (comp.subZero || this.heat >= 0) { heat += (1f + comp.coEff * this.heat / 10000f) * (comp.heat > 0 ? comp.heat * overclock * overclock * overvolt : comp.heat); //=MAX(0;MIN(MIN($B4;1*C$3+C$3-0,25);1+RAND()+(C$3-1)-($B4-1)/2)) - if (overvolt * 10f > 7f + TecTech.Rnd.nextFloat()) { - computation += comp.computation * Math.max(0, Math.min(Math.min(overclock, overvolt + overvolt - 0.25), 1 + TecTech.Rnd.nextFloat() + (overvolt - 1) - (overclock - 1) / 2)); + if (overvolt * 10f > 7f + TecTech.RANDOM.nextFloat()) { + computation += comp.computation * Math.max(0, Math.min(Math.min(overclock, overvolt + overvolt - 0.25), 1 + TecTech.RANDOM.nextFloat() + (overvolt - 1) - (overclock - 1) / 2)); } } } else { @@ -182,7 +185,7 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { } public int tickComponents(float oc, float ov) { - if (oc > 3 + TecTech.Rnd.nextFloat() || ov > 2 + TecTech.Rnd.nextFloat()) { + if (oc > 3 + TecTech.RANDOM.nextFloat() || ov > 2 + TecTech.RANDOM.nextFloat()) { getBaseMetaTileEntity().setToFire(); } overClock = oc; @@ -267,26 +270,52 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { } public static void run() {//20k heat cap max! - new RackComponent(ItemList.Circuit_Primitive.get(1), 1, 4, 0, 500, true); - new RackComponent(ItemList.Circuit_Basic.get(1), 4, 8, 0, 1000, true); - new RackComponent(ItemList.Circuit_Good.get(1), 6, 9, -.05f, 1500, true); + new RackComponent(ItemList.Circuit_Primitive.get(1), 1, 4, 0, 500, true);//Primitive Circuit + new RackComponent(ItemList.Circuit_Basic.get(1), 4, 8, 0, 1000, true);//Basic Circuit + new RackComponent(ItemList.Circuit_Microprocessor.get(1), 6, 8, 0, 1250, true); + new RackComponent(ItemList.Circuit_Good.get(1), 6, 9, -.05f, 1500, true);//Good Circuit + new RackComponent(ItemList.Circuit_Integrated_Good.get(1), 7, 9, -.075f, 1750, true); + new RackComponent(ItemList.Circuit_Processor.get(1), 8, 9, -.07f, 1800, true); new RackComponent(ItemList.Circuit_Parts_Advanced.get(1), 1, 2, -.05f, 2000, true); + new RackComponent(ItemList.Circuit_Nanoprocessor.get(1), 8, 10, -.09f, 2250, true);//Advanced Circuit new RackComponent(ItemList.Circuit_Advanced.get(1), 8, 10, -.1f, 2500, true); - new RackComponent(ItemList.Circuit_Data.get(1), 1, 1, -.1f, 3000, true); - new RackComponent(ItemList.Circuit_Master.get(1), 12, 10, -.2F, 5000, true); - new RackComponent(ItemList.Circuit_Elite.get(1), 16, 12, -.15F, 3500, true); - + new RackComponent(ItemList.Circuit_Data.get(1), 9, 1, -.1f, 3000, true);//EV Circuit + new RackComponent(ItemList.Circuit_Nanocomputer.get(1), 11, 10, -.125f, 3300, true); + new RackComponent(ItemList.Circuit_Quantumprocessor.get(1), 13, 10, -.15f, 3600, true); + new RackComponent(ItemList.Circuit_Elite.get(1), 12, 10, -.15F, 3500, true);//IV Circuit + new RackComponent(ItemList.Circuit_Elitenanocomputer.get(1), 14, 10, -.15F, 4000, true); + new RackComponent(ItemList.Circuit_Quantumcomputer.get(1), 16, 10, -.15F, 4500, true); + new RackComponent(ItemList.Circuit_Crystalprocessor.get(1), 18, 10, -.15F, 5000, true); + new RackComponent(ItemList.Circuit_Master.get(1), 16, 12, -.2F, 5000, true);//LuV Circuit + new RackComponent(ItemList.Circuit_Masterquantumcomputer.get(1), 16, 13, -.2F, 5100, true); + new RackComponent(ItemList.Circuit_Crystalcomputer.get(1), 20, 14, -.25F, 5200, true); + new RackComponent(ItemList.Circuit_Neuroprocessor.get(1), 24, 15, -.3F, 5300, true); + new RackComponent(ItemList.Circuit_Quantummainframe.get(1), 22, 14, -.3F, 5200, true);//ZPM Circuit + new RackComponent(ItemList.Circuit_Ultimatecrystalcomputer.get(1), 26, 16, -.3F, 5400, true); + new RackComponent(ItemList.Circuit_Wetwarecomputer.get(1), 30, 18, -.3F, 5600, true); + new RackComponent(ItemList.Circuit_Crystalmainframe.get(1), 30, 18, -.35F, 5500, true);//UV Circuit + new RackComponent(ItemList.Circuit_Wetwaresupercomputer.get(1), 35, 22, -.3F, 5700, true); + new RackComponent(ItemList.Circuit_Wetwaremainframe.get(1), 38, 25, -.4F, 6000, true);//UHV Circuit + new RackComponent("IC2:ic2.reactorVent", 0, -1, 10f, 1000, false); new RackComponent("IC2:ic2.reactorVentCore", 0, -1, 20f, 2500, false); new RackComponent("IC2:ic2.reactorVentGold", 0, -1, 40f, 5000, false); new RackComponent("IC2:ic2.reactorVentDiamond", 0, -1, 80f, 10000, false);//2x oc - - if (Loader.isModLoaded("dreamcraft")) { + + if (Loader.isModLoaded(Reference.DREAMCRAFT)) { + //GTNH-GT5u circuits + //these components causes crashes when used with the original GT5u + new RackComponent(ItemList.NandChip.get(1), 2, 6, 0, 750, true);//Primitive Circuit + new RackComponent(ItemList.Circuit_Biowarecomputer.get(1), 40, 26, -.35F, 5900, true); + new RackComponent(ItemList.Circuit_Biowaresupercomputer.get(1), 42, 30, -.4F, 6200, true); + new RackComponent(ItemList.Circuit_Biomainframe.get(1), 40, 28, -.4F, 6000, true);//UHV Circuit + new RackComponent(ItemList.Circuit_Bioprocessor.get(1), 34, 20, -.35F, 5800, true); + new RackComponent("dreamcraft:item.HighEnergyCircuitParts", 3, 2, -.1f, 9001, true); new RackComponent("dreamcraft:item.HighEnergyFlowCircuit", 24, 16, -.25f, 10000, true); - new RackComponent("dreamcraft:item.NanoCircuit", 32, 20, -.15f, 8000, true); - new RackComponent("dreamcraft:item.PikoCircuit", 64, 32, -.2f, 8500, true); - new RackComponent("dreamcraft:item.QuantumCircuit", 128, 48, -.3f, 9000, true); + new RackComponent("dreamcraft:item.NanoCircuit", 48, 35, -.45f, 8000, true); + new RackComponent("dreamcraft:item.PikoCircuit", 64, 40, -.5f, 8500, true); + new RackComponent("dreamcraft:item.QuantumCircuit", 128, 48, -.6f, 9000, true); } if (Loader.isModLoaded("OpenComputers")) { new RackComponent("OpenComputers:item.23", 0, 1, 0f, 100, true);//Transistor @@ -332,7 +361,7 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { this.subZero = subZero; componentBinds.put(unlocalizedName, this); if (DEBUG_MODE) { - TecTech.Logger.info("Component registered: " + unlocalizedName); + TecTech.LOGGER.info("Component registered: " + unlocalizedName); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java index 7736ee2bcc..361b9c678f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Uncertainty; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Uncertainty; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_UncertaintyAdv; @@ -32,6 +33,7 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch public GT_MetaTileEntity_Hatch_Uncertainty(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 0, "Feeling certain, or not?"); + Util.setTier(aTier,this); regenerate(); } @@ -55,7 +57,7 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier >= 10) { + if (mTier > 7) { return new GT_GUIContainer_UncertaintyAdv(aPlayerInventory, aBaseMetaTileEntity); } return new GT_GUIContainer_Uncertainty(aPlayerInventory, aBaseMetaTileEntity); @@ -195,7 +197,7 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch public void regenerate() { for (int i = 0; i < matrix.length; i++) { - matrix[i] = (short) TecTech.Rnd.nextInt(1000); + matrix[i] = (short) TecTech.RANDOM.nextInt(1000); } } @@ -269,7 +271,7 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch } private void shift() { - int i = TecTech.Rnd.nextInt(16), j = TecTech.Rnd.nextInt(128); + int i = TecTech.RANDOM.nextInt(16), j = TecTech.RANDOM.nextInt(128); matrix[i] += ((matrix[i] & 1) == 0 ? 2 : -2) * j >> 5; matrix[i] += j == 0 ? 1 : 0; if (matrix[i] < 0) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java index 289588a40a..90d8a26d1c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java @@ -55,8 +55,8 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - boolean doStuff = true; if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { + boolean doStuff = true; GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity(); int columnPointer=paramH.pointer &0xff; boolean secondRow=(paramH.pointer &0x0100)!=0; @@ -227,7 +227,8 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { var1.sendProgressBarUpdate(this, 107, input0f >>> 16); var1.sendProgressBarUpdate(this, 108, input1f & 0xFFFF); var1.sendProgressBarUpdate(this, 109, input1f >>> 16); - var1.sendProgressBarUpdate(this, 110, usesFloats ? pointer + 0x10000 : pointer); + var1.sendProgressBarUpdate(this, 110, pointer); + var1.sendProgressBarUpdate(this, 111, usesFloats ? 1 : 0); } } @@ -268,7 +269,8 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { return; case 110: pointer = par2 & 0xFFFF; - usesFloats =par2>=0x10000; + case 111: + usesFloats = par2 != 0; default: } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java index f5fe2bd002..e003774f13 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java @@ -99,7 +99,7 @@ public class GT_GUIContainer_Uncertainty extends GT_GUIContainerMetaTile_Machine x -= 6; y -= 6; for (int i = 0; i < 16; i++) { - if (TecTech.Rnd.nextInt(1000) < ((GT_Container_Uncertainty) mContainer).matrix[i]) { + if (TecTech.RANDOM.nextInt(1000) < ((GT_Container_Uncertainty) mContainer).matrix[i]) { drawTexturedModalRect(x + 12 * (i / 4), y + 12 * (i % 4), fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index cfcbf1ac90..be9ff21e58 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -4,19 +4,19 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -79,7 +79,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl @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[texturePage][12], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; } @@ -91,7 +91,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 5, 5, 0,getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 5, 5, 0,getBaseMetaTileEntity(),this,hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 748fa18f5a..15e9628b7a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -4,19 +4,19 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -154,9 +154,9 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public void construct(int stackSize, boolean hintsOnly) { if((stackSize &1)==1) { - StructureBuilder(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(),this, hintsOnly); } else { - StructureBuilder(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), hintsOnly); + StructureBuilderExtreme(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(),this, hintsOnly); } } @@ -176,7 +176,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @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[texturePage][12], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index bc814e30d2..471870b13b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -2,17 +2,27 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalMutableDefinitionStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -21,7 +31,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.Util.StructureBuilder; +import java.util.HashMap; + +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -32,7 +44,231 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; - private byte eTier = 0; + private static Textures.BlockIcons.CustomIcon ScreenON_Slave; + private static Textures.BlockIcons.CustomIcon ScreenOFF_Slave; + + private static double MASS_TO_EU_PARTIAL,MASS_TO_EU_INSTANT; + private static int STARTUP_COST,KEEPUP_COST; + + private long plasmaEnergy; + + public static void setValues(int heliumPlasmaValue){ + MASS_TO_EU_PARTIAL = heliumPlasmaValue / 1.75893000478707E07;//mass diff + MASS_TO_EU_INSTANT = MASS_TO_EU_PARTIAL * 20; + STARTUP_COST=-heliumPlasmaValue*10000; + KEEPUP_COST=-heliumPlasmaValue; + } + + //region collision handlers + public static final HashMap<Integer, ColliderHandler> FUSE_HANDLERS =new HashMap<>(); + public static final HashMap<String, PrimitiveColliderHandler> PRIMITIVE_FUSE_HANDLERS =new HashMap<>(); + public interface PrimitiveColliderHandler { + void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out); + } + public interface ColliderHandler extends PrimitiveColliderHandler { + byte getRequiredTier(); + } + static { + FUSE_HANDLERS.put((dAtomDefinition.getClassTypeStatic() << 16) | dAtomDefinition.getClassTypeStatic(), new ColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + try { + cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + defs.putUnifyAll(in1.definition.getSubParticles()); + defs.putUnifyAll(in2.definition.getSubParticles()); + dAtomDefinition atom = new dAtomDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); + out.putUnify(new cElementalInstanceStack(atom,Math.min(in1.amount,in2.amount))); + }catch (Exception e){ + out.putUnifyAll(in1,in2); + return; + } + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + } + } + + @Override + public byte getRequiredTier() { + return 1; + } + }); + registerSimpleAtomFuse(dHadronDefinition.getClassTypeStatic()); + registerSimpleAtomFuse(dComplexAspectDefinition.getClassTypeStatic()); + registerSimpleAtomFuse(cElementalPrimitive.getClassTypeStatic()); + + FUSE_HANDLERS.put((dHadronDefinition.getClassTypeStatic() << 16) | dHadronDefinition.getClassTypeStatic(), new ColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + try { + cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + defs.putUnifyAll(in1.definition.getSubParticles()); + defs.putUnifyAll(in2.definition.getSubParticles()); + dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); + out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); + }catch (Exception e){ + out.putUnifyAll(in1,in2); + return; + } + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + } + } + + @Override + public byte getRequiredTier() { + return 2; + } + }); + FUSE_HANDLERS.put((dHadronDefinition.getClassTypeStatic() << 16) | cElementalPrimitive.getClassTypeStatic(), new ColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + try { + cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + defs.putUnifyAll(in1.definition.getSubParticles()); + defs.putUnify(in2.definition.getStackForm(1)); + dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); + out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); + }catch (Exception e){ + out.putUnifyAll(in1,in2); + return; + } + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + } + } + + @Override + public byte getRequiredTier() { + return 2; + } + }); + + registerSimpleAspectFuse(dComplexAspectDefinition.getClassTypeStatic()); + registerSimpleAspectFuse(cElementalPrimitive.getClassTypeStatic()); + + FUSE_HANDLERS.put((cElementalPrimitive.getClassTypeStatic() << 16) | cElementalPrimitive.getClassTypeStatic(), new ColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + PrimitiveColliderHandler collisionHandler= PRIMITIVE_FUSE_HANDLERS.get(in1.definition.getClass().getName()+'\0'+in2.definition.getClass().getName()); + if (collisionHandler != null) { + collisionHandler.collide(in2, in1, out); + } else { + out.putUnifyAll(in1,in2); + } + } + + @Override + public byte getRequiredTier() { + return 2; + } + }); + + PRIMITIVE_FUSE_HANDLERS.put(eQuarkDefinition.class.getName() + '\0' + eQuarkDefinition.class.getName(), new PrimitiveColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + try { + cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + defs.putUnify(in1.definition.getStackForm(1)); + defs.putUnify(in2.definition.getStackForm(1)); + dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); + out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); + }catch (Exception e){ + out.putUnifyAll(in1,in2); + return; + } + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + } + } + }); + PRIMITIVE_FUSE_HANDLERS.put(ePrimalAspectDefinition.class.getName() + '\0' + ePrimalAspectDefinition.class.getName(), new PrimitiveColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + if (fuseAspects(in1, in2, out)) return; + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + } + } + }); + } + + private static boolean fuseAspects(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + try { + cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + defs.putUnify(in1.definition.getStackForm(1)); + defs.putUnify(in2.definition.getStackForm(1)); + dComplexAspectDefinition aspect = new dComplexAspectDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); + out.putUnify(new cElementalInstanceStack(aspect,Math.min(in1.amount,in2.amount))); + }catch (Exception e){ + out.putUnifyAll(in1,in2); + return true; + } + return false; + } + + private static void registerSimpleAspectFuse(byte classTypeStatic) { + FUSE_HANDLERS.put((dComplexAspectDefinition.getClassTypeStatic() << 16) | classTypeStatic, new ColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + if (fuseAspects(in1, in2, out)) return; + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + } + } + + @Override + public byte getRequiredTier() { + return 1; + } + }); + } + + private static void registerSimpleAtomFuse(byte classTypeStatic) { + FUSE_HANDLERS.put((dAtomDefinition.getClassTypeStatic() << 16) | classTypeStatic, new ColliderHandler() { + @Override + public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { + try { + cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + defs.putUnifyAll(in1.definition.getSubParticles()); + defs.putUnify(in2.definition.getStackForm(1)); + dAtomDefinition atom = new dAtomDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); + out.putUnify(new cElementalInstanceStack(atom,Math.min(in1.amount,in2.amount))); + }catch (Exception e){ + out.putUnifyAll(in1,in2); + return; + } + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + } + } + + @Override + public byte getRequiredTier() { + return 1; + } + }); + } + //endregion + + protected byte eTier = 0; + protected cElementalInstanceStack stack; + + protected static final byte FUSE_MODE=0, COLLIDE_MODE =1; + protected boolean started=false; //region Structure //use multi A energy inputs, use less power the longer it runs @@ -101,32 +337,43 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB public void registerIcons(IIconRegister aBlockIconRegister) { ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER"); ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_ACTIVE"); + ScreenOFF_Slave = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_SLAVE"); + ScreenON_Slave = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_ACTIVE_SLAVE"); super.registerIcons(aBlockIconRegister); } @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[texturePage][4], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + if(aFacing%2==0){ + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + }else{ + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON_Slave : ScreenOFF_Slave)}; + } } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; } @Override - public boolean isFacingValid(byte aFacing) { - return aFacing >= 2; - } - - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setByte("eTier", eTier); + aNBT.setByte("eTier", eTier);//collider tier + aNBT.setBoolean("eStarted",started); + if(stack!=null) { + aNBT.setTag("eStack", stack.toNBT()); + } + aNBT.setLong("ePlasmaEnergy",plasmaEnergy); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - eTier = aNBT.getByte("eTier"); + eTier = aNBT.getByte("eTier");//collider tier + started=aNBT.getBoolean("eStarted"); + if(aNBT.hasKey("eStack")){ + stack=cElementalInstanceStack.fromNBT(aNBT.getCompoundTag("eStack")); + } + plasmaEnergy=aNBT.getLong("ePlasmaEnergy"); } @Override @@ -170,23 +417,235 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB public void construct(int stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*4; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY*4; int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*4; if(hintsOnly){ TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), iGregTechTileEntity.getXCoord()+xDir, - iGregTechTileEntity.getYCoord(), + iGregTechTileEntity.getYCoord()+yDir, iGregTechTileEntity.getZCoord()+zDir, TT_Container_Casings.sHintCasingsTT,12); } else{ if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) { - iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord(), iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); + iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord()+yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); } } if ((stackSize & 1) == 1) { - StructureBuilder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity,this, hintsOnly); + } else { + StructureBuilderExtreme(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity,this, hintsOnly); + } + } + + @Override + public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { + if(isMaster()) { + double mode = getParameterIn(0, 0); + if (mode == FUSE_MODE || mode == COLLIDE_MODE) { + setStatusOfParameterIn(0, 0, STATUS_OK); + } else if (mode > 1) { + setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); + } else if (mode < 0) { + setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); + }else{ + setStatusOfParameterIn(0,0,STATUS_WRONG); + } + } + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + GT_MetaTileEntity_EM_collider partner=getPartner(); + if(partner==null){ + return false; + } + mEfficiencyIncrease=10000; + if(started) { + if(stack==null) { + for (GT_MetaTileEntity_Hatch_InputElemental inputElemental : eInputHatches) { + cElementalInstanceStackMap container = inputElemental.getContainerHandler(); + if (container.isEmpty()) { + continue; + } + stack = container.remove(container.getFirst().definition); + long eut = KEEPUP_COST+(long)(KEEPUP_COST * Math.abs(stack.getMass() / dAtomDefinition.getSomethingHeavy().getMass()))/2; + if (eut < Integer.MIN_VALUE + 7) { + return false; + } + mMaxProgresstime = 20; + mEUt = (int) eut; + eAmpereFlow = 5; + return true; + } + mMaxProgresstime = 20; + mEUt = KEEPUP_COST; + eAmpereFlow = 1; + return true; + } + mMaxProgresstime = 20; + mEUt = KEEPUP_COST; + eAmpereFlow = 2; + return true; + }else{ + started=true; + mMaxProgresstime=20; + mEUt=STARTUP_COST; + eAmpereFlow=10; + return true; + } + } + + protected double fuse(GT_MetaTileEntity_EM_collider partner){ + if(partner.stack!=null && stack!=null) {//todo add single event mode as an option + boolean check=stack.definition.fusionMakesEnergy(stack.getEnergy()) && + partner.stack.definition.fusionMakesEnergy(partner.stack.getEnergy()); + + cElementalInstanceStack stack2 = partner.stack; + double preMass = stack2.getMass() + stack.getMass(); + //System.out.println("preMass = " + preMass); + + cElementalInstanceStackMap map = new cElementalInstanceStackMap(); + ColliderHandler colliderHandler; + if (stack2.definition.getClassType() > stack.definition.getClassType()) {//always bigger first + colliderHandler = FUSE_HANDLERS.get((stack2.definition.getClassType() << 16) | stack.definition.getClassType()); + if (handleRecipe(stack2, map, colliderHandler)) return 0; + } else { + colliderHandler = FUSE_HANDLERS.get((stack.definition.getClassType() << 16) | stack2.definition.getClassType()); + if (handleRecipe(stack2, map, colliderHandler)) return 0; + } + for (cElementalInstanceStack newStack : map.values()) { + check &= newStack.definition.fusionMakesEnergy(newStack.getEnergy()); + } + //System.out.println("outputEM[0].getMass() = " + outputEM[0].getMass()); + outputEM = new cElementalInstanceStackMap[]{map}; + + partner.stack = stack = null; + //System.out.println("check = " + check); + //System.out.println("preMass-map.getMass() = " + (preMass - map.getMass())); + return check ? preMass - map.getMass() : + Math.min(preMass - map.getMass(), 0); + } + return 0; + } + + private boolean handleRecipe(cElementalInstanceStack stack2, cElementalInstanceStackMap map, ColliderHandler colliderHandler) { + if (colliderHandler != null && eTier>= colliderHandler.getRequiredTier()) { + colliderHandler.collide(stack2, stack, map); + } else { + map.putUnifyAll(stack,stack2); + outputEM=new cElementalInstanceStackMap[]{map}; + return true; + } + return false; + } + + @Override + protected void afterRecipeCheckFailed() { + started=false; + if(stack!=null){ + cleanMassEM_EM(stack.getMass()); + stack=null; + } + getBaseMetaTileEntity().disableWorking(); + super.afterRecipeCheckFailed(); + } + + @Override + public void stopMachine() { + started=false; + if(stack!=null){ + cleanMassEM_EM(stack.getMass()); + stack=null; + } + super.stopMachine(); + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if(!aBaseMetaTileEntity.isAllowedToWork()){ + started=false; + } + super.onPreTick(aBaseMetaTileEntity, aTick); + } + + protected GT_MetaTileEntity_EM_collider getPartner(){ + IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*4; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY*4; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*4; + IGregTechTileEntity gregTechBaseTileEntity=iGregTechTileEntity.getIGregTechTileEntityOffset(xDir, yDir, zDir); + if(gregTechBaseTileEntity!=null) { + IMetaTileEntity gregTechMetaTileEntity = gregTechBaseTileEntity.getMetaTileEntity(); + return gregTechMetaTileEntity instanceof GT_MetaTileEntity_EM_collider && + ((GT_MetaTileEntity_EM_collider) gregTechMetaTileEntity).mMachine && + gregTechBaseTileEntity.getBackFacing() == iGregTechTileEntity.getFrontFacing() ? + (GT_MetaTileEntity_EM_collider) gregTechMetaTileEntity : null; + } + return null; + } + + protected final boolean isMaster(){ + return getBaseMetaTileEntity().getFrontFacing()%2==0; + } + + @Override + public void outputAfterRecipe_EM(){ + GT_MetaTileEntity_EM_collider partner=getPartner(); + if(partner==null){ + if(stack!=null){ + cleanMassEM_EM(stack.getMass()); + stack=null; + } + return; + } + if (isMaster()) { + switch (getParameterInInt(0,0)){ + case FUSE_MODE: + makeEU(fuse(partner)); + break; + case COLLIDE_MODE: + //collide(partner);//todo + break; + default: { + outputEM=new cElementalInstanceStackMap[2]; + outputEM[1]=tickStack(); + if(outputEM[1]==null){ + outputEM[1]=partner.tickStack(); + }else { + cElementalInstanceStackMap map=partner.tickStack(); + if(map!=null){ + outputEM[1].putUnifyAll(map); + } + } + } + } + if(outputEM!=null) { + for(int i=0,lim=Math.min(outputEM.length,eOutputHatches.size());i<lim;i++){ + if(outputEM[i]!=null) { + eOutputHatches.get(i).getContainerHandler().putUnifyAll(outputEM[i]); + outputEM[i]=null; + } + } + } + } + } + + private void makeEU(double massDiff){ + plasmaEnergy+=massDiff*MASS_TO_EU_INSTANT; + System.out.println("plasmaEnergy = " + plasmaEnergy); + } + + private cElementalInstanceStackMap tickStack(){ + if(stack==null){ + return null; + } + cElementalInstanceStackMap newInstances = stack.decay(1, stack.age += 1, 0); + if (newInstances == null) { + stack.nextColor(); } else { - StructureBuilder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, hintsOnly); + stack=newInstances.remove(newInstances.getLast().definition); } + return newInstances; } @Override @@ -199,7 +658,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB return new String[]{ CommonValues.TEC_MARK_EM, "Collide matter at extreme velocities.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Faster than light!!!" + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Faster than light*!!!" }; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 66c32ac761..c021f93260 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -4,12 +4,13 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; import com.github.technus.tectech.Vec3pos; -import com.github.technus.tectech.dataFramework.QuantumDataPacket; +import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -19,7 +20,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; @@ -28,9 +28,9 @@ import net.minecraft.util.ResourceLocation; import java.util.ArrayList; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.V; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -97,7 +97,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @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[texturePage][3], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3]}; } @@ -166,7 +166,10 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB public void outputAfterRecipe_EM() { if (!eOutputData.isEmpty()) { Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); - QuantumDataPacket pack = new QuantumDataPacket(pos, eAvailableData); + QuantumDataPacket pack = new QuantumDataPacket(eAvailableData / eOutputData.size()).unifyTraceWith(pos); + if(pack==null){ + return; + } for (GT_MetaTileEntity_Hatch_InputData hatch : eInputData) { if (hatch.q == null || hatch.q.contains(pos)) { continue; @@ -177,8 +180,6 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } } - pack.computation /= eOutputData.size(); - for (GT_MetaTileEntity_Hatch_OutputData o : eOutputData) { o.q = pack; } @@ -251,7 +252,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } if (!machineBusy) { - setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); } else if (eAvailableData <= 0) { setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); } else { @@ -320,16 +321,16 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { IGregTechTileEntity igt=getBaseMetaTileEntity(); - StructureBuilder(front, blockType, blockMeta, 1, 2, 0, igt,hintsOnly); - StructureBuilder(cap, blockType, blockMeta, 1, 2, -1, igt,hintsOnly); + StructureBuilderExtreme(front, blockType, blockMeta, 1, 2, 0, igt,this,hintsOnly); + StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt,this,hintsOnly); byte offset=-2; for (int rackSlices = stackSize >12?12: stackSize; rackSlices>0 ; rackSlices--) { - StructureBuilder(slice, blockType, blockMeta, 1, 2, offset--, igt,hintsOnly); + StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt,this,hintsOnly); } - StructureBuilder(cap, blockType, blockMeta, 1, 2, offset--, igt,hintsOnly); - StructureBuilder(terminator, blockType, blockMeta, 1, 2, offset,igt,hintsOnly); + StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, offset--, igt,this,hintsOnly); + StructureBuilderExtreme(terminator, blockType, blockMeta, 1, 2, offset,igt,this,hintsOnly); } @Override @@ -348,16 +349,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_EM, - Util.intBitsToString(TecTech.Rnd.nextInt()), + Util.intBitsToString(TecTech.RANDOM.nextInt()), EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "You need it to process the number above" }; } - @Override - public boolean isFacingValid(byte aFacing) { - return aFacing >= 2; - } - //NEW METHOD public final boolean addRackToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java index 4c382c178a..c48f1fdbfe 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java @@ -4,19 +4,19 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -80,7 +80,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB @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[texturePage][12], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; } @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java new file mode 100644 index 0000000000..da2e06c873 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -0,0 +1,198 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Reference; +import com.github.technus.tectech.loader.TecTechConfig; +import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputDataItems; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputDataItems; +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_RenderedTexture; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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_DataAccess; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +import java.util.ArrayList; + +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; + +public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + private final ArrayList<GT_MetaTileEntity_Hatch_OutputDataItems> eStacksDataOutputs = new ArrayList<>(); + private final ArrayList<GT_MetaTileEntity_Hatch_DataAccess> eDataAccessHatches = new ArrayList<>(); + + //region Structure + private static final String[][] shape = new String[][]{ + {"0 0","0 . 0","0 0",}, + {"0!!!0","01110","0!!!0",}, + {"0!!!0","0!!!0","0!!!0",}, + }; + private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{2,1}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList","addDataBankHatchToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset,textureOffset+1}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{0,1}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or high power casing", + "2 - Data Access/Data Bank Master Hatches or computer casing", + }; + //endregion + + public GT_MetaTileEntity_EM_dataBank(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_EM_dataBank(String aName) { + super(aName); + } + + public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_hi_freq"); + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound(){ + return activitySound; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_dataBank(mName); + } + + @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[texturePage][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]}; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, true);//todo texture + } + + @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + eDataAccessHatches.clear(); + eStacksDataOutputs.clear(); + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0); + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta,2, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override + protected void parametersLoadDefault_EM() { + for(int i=0;i<10;i++){ + setStatusOfParameterIn(i,0,STATUS_UNUSED); + setStatusOfParameterIn(i,1,STATUS_UNUSED); + setStatusOfParameterOut(i,0,STATUS_UNUSED); + setStatusOfParameterOut(i,1,STATUS_UNUSED); + } + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + if (eDataAccessHatches.size() > 0 && eStacksDataOutputs.size() > 0) { + mEUt = -(int) V[7]; + eAmpereFlow = 1 + (eStacksDataOutputs.size() >> 2) + eDataAccessHatches.size(); + mMaxProgresstime = 20; + mEfficiencyIncrease = 10000; + return true; + } + return false; + } + + @Override + public void outputAfterRecipe_EM() { + ArrayList<ItemStack> stacks=new ArrayList<>(); + for(GT_MetaTileEntity_Hatch_DataAccess dataAccess:eDataAccessHatches){ + int count=dataAccess.getSizeInventory(); + for(int i=0;i<count;i++){ + ItemStack stack=dataAccess.getStackInSlot(i); + if(stack!=null){ + stacks.add(stack); + } + } + } + if(stacks.size()>0){ + ItemStack[] arr=stacks.toArray(new ItemStack[0]); + for(GT_MetaTileEntity_Hatch_OutputDataItems hatch:eStacksDataOutputs){ + hatch.q=new InventoryDataPacket(arr); + } + }else{ + for(GT_MetaTileEntity_Hatch_OutputDataItems hatch:eStacksDataOutputs){ + hatch.q=null; + } + } + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + "Remote assembly data delivery", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Apply directly to the forehead" + }; + } + + //NEW METHOD + public final boolean addDataBankHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputDataItems) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return eStacksDataOutputs.add((GT_MetaTileEntity_Hatch_OutputDataItems) aMetaTileEntity); + }else if(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess && !(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputDataItems)){ + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return eDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); + } + return false; + } + + public static void run(){ + try { + adderMethodMap.put("addDataBankHatchToMachineList", GT_MetaTileEntity_EM_dataBank.class.getMethod("addDataBankHatchToMachineList", IGregTechTileEntity.class, int.class)); + } catch (NoSuchMethodException e) { + if (TecTechConfig.DEBUG_MODE) { + e.printStackTrace(); + } + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 7edd9caa5f..71a6b70dfb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -1,11 +1,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -14,15 +16,15 @@ 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.objects.GT_RenderedTexture; +import ic2.core.init.MainConfig; +import ic2.core.util.ConfigUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.VN; -import static com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; +import static com.github.technus.tectech.CommonValues.VN; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -34,6 +36,10 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; + private static final double URANIUM_INGOT_MASS_DIFF = 1.6114516E10; + private static final double MASS_TO_EU_PARTIAL = ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/nuclear") * 3_000_000.0 / URANIUM_INGOT_MASS_DIFF; + private static final double MASS_TO_EU_INSTANT= MASS_TO_EU_PARTIAL *20; + //region structure private static final String[][] shape = new String[][]{ {"0C0","A ","A . ","A ","0C0",}, @@ -83,7 +89,7 @@ public class GT_MetaTileEntity_EM_decay 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[texturePage][12], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; } @@ -95,7 +101,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -115,29 +121,54 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase @Override public boolean checkRecipe_EM(ItemStack itemStack) { cElementalInstanceStackMap map= getInputsClone_EM(); - if(map!=null && map.hasStacks() && map.getFirst().getLifeTime()< STABLE_RAW_LIFE_TIME){ - return startRecipe(map.getFirst()); + if(map!=null && map.hasStacks()){ + for(GT_MetaTileEntity_Hatch_InputElemental i:eInputHatches){ + i.getContainerHandler().clear(); + } + return startRecipe(map); } return false; } - private float m1,m2,m3; - private boolean startRecipe(cElementalInstanceStack input) { - m3=(float)Math.ceil(input.getLifeTime() / Math.pow(input.amount,3)); - if(m3<1) { - explodeMultiblock(); + private boolean startRecipe(cElementalInstanceStackMap input) { + mMaxProgresstime = 20; + mEfficiencyIncrease = 10000; + outputEM=new cElementalInstanceStackMap[2]; + outputEM[0]=input; + outputEM[1]=new cElementalInstanceStackMap(); + + + for(cElementalInstanceStack stack:outputEM[0].values()){ + if(stack.getEnergy()==0 && stack.definition.decayMakesEnergy(1)){ + if(getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)(stack.getEnergySettingCost(1)*MASS_TO_EU_INSTANT),false)){ + stack.setEnergy(1); + }else{ + outputEM[0].remove(stack.definition); + outputEM[1].putReplace(stack); + } + }else if(!stack.definition.decayMakesEnergy(stack.getEnergy())){ + outputEM[0].remove(stack.definition); + outputEM[1].putReplace(stack); + } + //System.out.println(stack.definition.getSymbol()+" "+stack.amount); } - if(m3>=Integer.MAX_VALUE) { - return false; + + + float preMass=outputEM[0].getMass(); + outputEM[0].tickContent(1,0,1); + double energyDose=((preMass-outputEM[0].getMass())* MASS_TO_EU_PARTIAL); + mEUt=(int)(energyDose/getParameterInInt(0,0)); + eAmpereFlow=getParameterInInt(0,0); + + return outputEM[0].hasStacks(); + } + + @Override + public void outputAfterRecipe_EM() { + for(int i=0;i<2&&i<eOutputHatches.size();i++){ + eOutputHatches.get(i).getContainerHandler().putUnifyAll(outputEM[i]); + outputEM[i]=null; } - mMaxProgresstime = 1;//(int)m3; - mEfficiencyIncrease = 10000; - m1 = input.getMass()/input.amount; - cElementalInstanceStackMap decayed=input.decay(); - m2 = decayed.getMass()/input.amount; - //TecTech.Logger.info("I " + input.toString()); - //TecTech.Logger.info("O " + decayed.toString()); - return true; } @Override @@ -174,7 +205,11 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, "Computation: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, - m1+" "+m2+ ' ' +m3 }; } + + @Override + public long maxEUStore() { + return super.maxEUStore(); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 26793ba894..5f102c94ab 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.transformations.iExchangeInfo; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.transformations.aOredictDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.iExchangeInfo; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; @@ -23,11 +23,11 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.V; -import static com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; -import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.refMass; -import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.refUnstableMass; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition.refMass; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition.refUnstableMass; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -84,7 +84,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),this, hintsOnly); } @Override @@ -135,12 +135,12 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo mMaxProgresstime = 20; mEfficiencyIncrease = 10000; float mass = from.getMass(); - float euMult = mass / refMass; - eAmpereFlow = (int) Math.ceil(euMult); + float euMult = Math.abs(mass / refMass); + eAmpereFlow = (int) Math.ceil(Math.sqrt(Math.sqrt(euMult))); if (mass > refUnstableMass || from.getDefinition().getRawTimeSpan(energy) < STABLE_RAW_LIFE_TIME) { - mEUt = (int) -V[10]; - } else { mEUt = (int) -V[8]; + } else { + mEUt = (int) -V[6]; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index e8238af2cb..c6eb10c94a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -2,8 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import cofh.api.energy.IEnergyContainerItem; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; @@ -21,8 +21,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.GregTech_API.mEUtoRF; @@ -71,11 +71,6 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa } @Override - public boolean isFacingValid(byte aFacing) { - return aFacing >= 2; - } - - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_infuser(mName); } @@ -97,7 +92,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index c50caf132f..bd8ed9c6bb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -11,8 +11,8 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.V; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -61,7 +61,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -85,13 +85,13 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB src = getParameterIn(i, 0); if (src <= 0) { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); } else if (src > eInputHatches.size()) { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); } else if (Double.isNaN(src)) { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); } else { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); dest = getParameterIn(i, 1); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 7b90703749..a5a3f451ea 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -1,15 +1,15 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.transformations.aFluidQuantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aItemQuantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.aOredictQuantizationInfo; -import com.github.technus.tectech.elementalMatter.core.transformations.bTransformationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aFluidQuantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemQuantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictQuantizationInfo; +import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; @@ -27,11 +27,14 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; -import static com.github.technus.tectech.Util.*; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition.DEFAULT_ENERGY_LEVEL; -import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.refMass; -import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.refUnstableMass; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.Util.isInputEqual; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.DEFAULT_ENERGY_LEVEL; +import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition.refMass; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition.refUnstableMass; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -89,7 +92,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -123,7 +126,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock int[] oreIDs = OreDictionary.getOreIDs(is); for (int ID : oreIDs) { if (DEBUG_MODE) { - TecTech.Logger.info("Quantifier-Ore-recipe " + is.getItem().getUnlocalizedName() + '.' + is.getItemDamage() + ' ' + OreDictionary.getOreName(ID)); + TecTech.LOGGER.info("Quantifier-Ore-recipe " + is.getItem().getUnlocalizedName() + '.' + is.getItemDamage() + ' ' + OreDictionary.getOreName(ID)); } aOredictQuantizationInfo aOQI = bTransformationInfo.oredictQuantization.get(ID); if (aOQI == null) { @@ -138,7 +141,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } else { //Do ITEM STACK quantization if (DEBUG_MODE) { - TecTech.Logger.info("Quantifier-Item-recipe " + is.getItem().getUnlocalizedName() + '.' + is.getItemDamage()); + TecTech.LOGGER.info("Quantifier-Item-recipe " + is.getItem().getUnlocalizedName() + '.' + is.getItemDamage()); } iHasElementalDefinition into = aIQI.output(); if (into != null && isInputEqual(true, false, GT_MetaTileEntity_MultiblockBase_EM.nothingF, new ItemStack[]{new ItemStack(is.getItem(), aIQI.input().stackSize, is.getItemDamage())}, null, inI)) { @@ -172,12 +175,12 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock mMaxProgresstime = 20; mEfficiencyIncrease = 10000; float mass = into.getMass(); - float euMult = mass / refMass; - eAmpereFlow = (int) Math.ceil(euMult); - if (mass > refUnstableMass || into.getDefinition().getRawTimeSpan(DEFAULT_ENERGY_LEVEL) < 1.5e25f) { - mEUt = (int) -V[10]; - } else { + float euMult = Math.abs(mass / refMass); + eAmpereFlow = (int) Math.ceil(Math.sqrt(Math.sqrt(euMult))); + if (mass > refUnstableMass || into.getDefinition().getRawTimeSpan(DEFAULT_ENERGY_LEVEL) < STABLE_RAW_LIFE_TIME) { mEUt = (int) -V[8]; + } else { + mEUt = (int) -V[6]; } outputEM = new cElementalInstanceStackMap[]{ into instanceof cElementalInstanceStack ? diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index dc7c99df7b..377291f59a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -1,12 +1,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.auxiliary.TecTechConfig; +import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; @@ -17,7 +18,6 @@ import gregtech.api.metatileentity.MetaTileEntity; 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; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -30,8 +30,11 @@ import net.minecraft.nbt.NBTTagString; import net.minecraft.util.EnumChatFormatting; import java.util.ArrayList; +import java.util.LinkedHashMap; -import static com.github.technus.tectech.Util.*; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.CommonValues.VN; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; @@ -110,7 +113,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 3, 4, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 3, 4, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -143,7 +146,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { if(aBaseMetaTileEntity.isServerSide()) { if (computationRemaining > 0) { aRecipe = null; @@ -199,18 +202,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB if (GT_Utility.areStacksEqual(assRecipe.mResearchItem, holdItem, true)) { tRecipe = assRecipe; //if found - for (GT_Recipe ttRecipe : TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.mRecipeList) { - if (GT_Utility.areStacksEqual(ttRecipe.mInputs[0], holdItem, true)) { - computationRequired = computationRemaining = ttRecipe.mDuration * 20L; - mMaxProgresstime = 20; - mEfficiencyIncrease = 10000; - eRequiredData = (short) (ttRecipe.mSpecialValue >>> 16); - eAmpereFlow = (short) (ttRecipe.mSpecialValue & 0xFFFF); - mEUt = ttRecipe.mEUt; - eHolders.get(0).getBaseMetaTileEntity().setActive(true); - return true; - } - } + if (iterateRecipes()) return true; } } }else if(ItemList.Tool_DataOrb.isStackEqual(itemStack, false, true)){ @@ -219,18 +211,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB aRecipe = assRecipeTT; machineType=machine; //if found - for (GT_Recipe ttRecipe : TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.mRecipeList) { - if (GT_Utility.areStacksEqual(ttRecipe.mInputs[0], holdItem, true)) { - computationRequired = computationRemaining = ttRecipe.mDuration * 20L; - mMaxProgresstime = 20; - mEfficiencyIncrease = 10000; - eRequiredData = (short) (ttRecipe.mSpecialValue >>> 16); - eAmpereFlow = (short) (ttRecipe.mSpecialValue & 0xFFFF); - mEUt = ttRecipe.mEUt; - eHolders.get(0).getBaseMetaTileEntity().setActive(true); - return true; - } - } + if (iterateRecipes()) return true; } } for (TT_recipe.TT_assLineRecipe assRecipeTT:TT_recipe.TT_Recipe_Map.sCrafterRecipes.recipeList()){ @@ -238,18 +219,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB aRecipe = assRecipeTT; machineType=crafter; //if found - for (GT_Recipe ttRecipe : TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.mRecipeList) { - if (GT_Utility.areStacksEqual(ttRecipe.mInputs[0], holdItem, true)) { - computationRequired = computationRemaining = ttRecipe.mDuration * 20L; - mMaxProgresstime = 20; - mEfficiencyIncrease = 10000; - eRequiredData = (short) (ttRecipe.mSpecialValue >>> 16); - eAmpereFlow = (short) (ttRecipe.mSpecialValue & 0xFFFF); - mEUt = ttRecipe.mEUt; - eHolders.get(0).getBaseMetaTileEntity().setActive(true); - return true; - } - } + if (iterateRecipes()) return true; } } } @@ -262,6 +232,22 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB return false; } + private boolean iterateRecipes() { + for (GT_Recipe ttRecipe : TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.mRecipeList) { + if (GT_Utility.areStacksEqual(ttRecipe.mInputs[0], holdItem, true)) { + computationRequired = computationRemaining = ttRecipe.mDuration * 20L; + mMaxProgresstime = 20; + mEfficiencyIncrease = 10000; + eRequiredData = (short) (ttRecipe.mSpecialValue >>> 16); + eAmpereFlow = (short) (ttRecipe.mSpecialValue & 0xFFFF); + mEUt = ttRecipe.mEUt; + eHolders.get(0).getBaseMetaTileEntity().setActive(true); + return true; + } + } + return false; + } + @Override public boolean onRunningTick(ItemStack aStack) { if(computationRemaining<=0) { @@ -275,39 +261,150 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } } - @Override - public void outputAfterRecipe_EM() { - if(!eHolders.isEmpty()) { - if (tRecipe != null && ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)){ - eHolders.get(0).getBaseMetaTileEntity().setActive(false); - eHolders.get(0).mInventory[0] = null; + private void makeStick(){ + mInventory[1].setTagCompound(new NBTTagCompound()); + mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + " Construction Data"); + GT_Utility.ItemNBT.setBookTitle(mInventory[1], GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + " Construction Data"); + NBTTagCompound tNBT = mInventory[1].getTagCompound();//code above makes it not null + + tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); + tNBT.setInteger("time", tRecipe.mDuration); + tNBT.setInteger("eu", tRecipe.mEUt); + for (int i = 0; i < tRecipe.mInputs.length; i++) { + tNBT.setTag(String.valueOf(i), tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); + } + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); + } + tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + " Assembling Line Recipe Generator"); + NBTTagList tNBTList = new NBTTagList(); + tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + ' ' + GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + tRecipe.mDuration / 20)); + for (int i = 0; i < tRecipe.mInputs.length; i++) { + if (tRecipe.mInputs[i] != null) { + tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + ' ' + GT_LanguageManager.getTranslation(tRecipe.mInputs[i].getDisplayName()))); + } + } + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + if (tRecipe.mFluidInputs[i] != null) { + tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); + } + } + tNBT.setTag("pages", tNBTList); + } - mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + " Construction Data"); - NBTTagCompound tNBT = mInventory[1].getTagCompound();//code above makes it not null + private static LinkedHashMap<String, String> lServerNames; + static { + try { + Class GT_Assemblyline_Server = Class.forName("gregtech.api.util.GT_Assemblyline_Server"); + lServerNames=(LinkedHashMap<String, String>)GT_Assemblyline_Server.getField("lServerNames").get(null); + }catch (ClassNotFoundException|NoSuchFieldException|IllegalAccessException e){ + lServerNames=null; + } + } - tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); - tNBT.setInteger("time", tRecipe.mDuration); - tNBT.setInteger("eu", tRecipe.mEUt); - for (int i = 0; i < tRecipe.mInputs.length; i++) { - tNBT.setTag(String.valueOf(i), tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); + private void makeStick2(){ + String s = tRecipe.mOutput.getDisplayName(); + if (getBaseMetaTileEntity().isServerSide()) { + s = lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s==null) { + s = tRecipe.mOutput.getDisplayName(); + } + } + mInventory[1].setTagCompound(new NBTTagCompound()); + mInventory[1].setStackDisplayName(s+" Construction Data"); + GT_Utility.ItemNBT.setBookTitle(mInventory[1], s+" Construction Data"); + + NBTTagCompound tNBT = mInventory[1].getTagCompound(); + + tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); + tNBT.setInteger("time", tRecipe.mDuration); + tNBT.setInteger("eu", tRecipe.mEUt); + for(int i = 0 ; i < tRecipe.mInputs.length ; i++){ + tNBT.setTag(""+i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); + } + for(int i = 0 ; i < tRecipe.mOreDictAlt.length ; i++){ + if (tRecipe.mOreDictAlt[i] != null && tRecipe.mOreDictAlt[i].length > 0) { + tNBT.setInteger("a" + i, tRecipe.mOreDictAlt[i].length); + for (int j = 0; j < tRecipe.mOreDictAlt[i].length; j++) { + tNBT.setTag("a" + i + ":" + j, tRecipe.mOreDictAlt[i][j].writeToNBT(new NBTTagCompound())); } - for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { - tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); + } + } + for(int i = 0 ; i < tRecipe.mFluidInputs.length ; i++){ + tNBT.setTag("f"+i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); + } + tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType+ " Recipe Generator"); + NBTTagList tNBTList = new NBTTagList(); + s=tRecipe.mOutput.getDisplayName(); + if (getBaseMetaTileEntity().isServerSide()) { + s = lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s==null) { + s = tRecipe.mOutput.getDisplayName(); + } + } + tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+s+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20))); + for(int i=0;i<tRecipe.mInputs.length;i++){ + if (tRecipe.mOreDictAlt[i] != null) { + int count = 0; + StringBuilder tBuilder = new StringBuilder("Input Bus "+(i+1)+": "); + for (ItemStack tStack : tRecipe.mOreDictAlt[i]) { + if (tStack != null) { + s=tStack.getDisplayName(); + if (getBaseMetaTileEntity().isServerSide()) { + s=lServerNames.get(tStack.getDisplayName()); + if (s==null) + s=tStack.getDisplayName(); + } + + + tBuilder.append(count == 0 ? "" : "\nOr ").append(tStack.stackSize).append(" ").append(s); + count++; + } } - tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + " Assembling Line Recipe Generator"); - NBTTagList tNBTList = new NBTTagList(); - tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + ' ' + GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + tRecipe.mDuration / 20)); - for (int i = 0; i < tRecipe.mInputs.length; i++) { - if (tRecipe.mInputs[i] != null) { - tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + ' ' + GT_LanguageManager.getTranslation(tRecipe.mInputs[i].getDisplayName()))); + if (count > 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString())); + } else if(tRecipe.mInputs[i]!=null){ + s=tRecipe.mInputs[i].getDisplayName(); + if (getBaseMetaTileEntity().isServerSide()) { + s = lServerNames.get(tRecipe.mInputs[i].getDisplayName()); + if (s==null) { + s = tRecipe.mInputs[i].getDisplayName(); } } - for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { - if (tRecipe.mFluidInputs[i] != null) { - tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); + tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+s)); + } + } + for(int i=0;i<tRecipe.mFluidInputs.length;i++){ + if(tRecipe.mFluidInputs[i]!=null){ + s=tRecipe.mFluidInputs[i].getLocalizedName(); + if (getBaseMetaTileEntity().isServerSide()) { + s = lServerNames.get(tRecipe.mFluidInputs[i].getLocalizedName()); + if (s==null) { + s = tRecipe.mFluidInputs[i].getLocalizedName(); + } + } + tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); + } + } + tNBT.setTag("pages", tNBTList); + + mInventory[1].setTagCompound(tNBT); + } + + @Override + public void outputAfterRecipe_EM() { + if(!eHolders.isEmpty()) { + if (tRecipe != null && ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)){ + eHolders.get(0).getBaseMetaTileEntity().setActive(false); + eHolders.get(0).mInventory[0] = null; + if (lServerNames == null) { + makeStick(); + } else { + try { + makeStick2(); + }catch (NoSuchFieldError e){ + makeStick(); } } - tNBT.setTag("pages", tNBTList); }else if (aRecipe != null && ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { eHolders.get(0).getBaseMetaTileEntity().setActive(false); eHolders.get(0).mInventory[0] = null; @@ -334,15 +431,15 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } } - @Override - public boolean isFacingValid(byte aFacing) { - return aFacing >= 2; - } + //@Override + //public boolean isFacingValid(byte aFacing) { + // return aFacing >= 2; + //} @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[texturePage][3], new GT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3]}; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index eab87fe71a..b2711530ed 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -2,10 +2,10 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; @@ -29,9 +29,12 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.Util.*; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; -import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.CommonValues.VN; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +import static com.github.technus.tectech.Util.areBitsSet; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -109,7 +112,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -186,7 +189,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { if(aBaseMetaTileEntity.isServerSide()) { if (totalComputationRemaining > 0 && objectResearched!=null) { eRecipe = null; @@ -263,7 +266,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa totalComputationRequired =0; eRequiredData=0; - eAmpereFlow=objectsScanned.size() + TecTech.Rnd.next(objectsScanned.size()); + eAmpereFlow=objectsScanned.size() + TecTech.RANDOM.next(objectsScanned.size()); mEUt=-(int)V[8]; //get depth scan complexity array diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index c259a8b7fa..ce16d939cd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -10,7 +10,7 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -59,7 +59,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index e15d24243e..1ddb655105 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -1,27 +1,27 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.Vec3pos; -import com.github.technus.tectech.auxiliary.Reference; -import com.github.technus.tectech.dataFramework.QuantumDataPacket; +import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.V; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -72,7 +72,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas @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[texturePage][1], new GT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]}; } @@ -84,7 +84,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -127,7 +127,10 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); - QuantumDataPacket pack = new QuantumDataPacket(pos, 0); + QuantumDataPacket pack = new QuantumDataPacket(0L).unifyTraceWith(pos); + if(pack==null) { + return; + } for (GT_MetaTileEntity_Hatch_InputData hatch : eInputData) { if (hatch.q == null || hatch.q.contains(pos)) { continue; @@ -138,7 +141,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } } - long remaining = pack.computation; + long remaining = pack.getContent(); for (int i = 0; i < 10; i++) { dest= getParameterIn(i,1); @@ -151,17 +154,17 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas GT_MetaTileEntity_Hatch_OutputData out = eOutputData.get(outIndex); if(Double.isInfinite(total)){ if(Double.isInfinite(weight)){ - out.q = new QuantumDataPacket(pack, remaining); + out.q = new QuantumDataPacket(remaining).unifyTraceWith(pack); break; } }else{ - long part = (long) Math.floor(pack.computation * weight / total); + long part = (long) Math.floor(pack.getContent() * weight / total); if (part > 0) { remaining -= part; if (remaining > 0) { - out.q = new QuantumDataPacket(pack, part); + out.q = new QuantumDataPacket(part).unifyTraceWith(pack); } else if (part + remaining > 0) { - out.q = new QuantumDataPacket(pack, part + remaining); + out.q = new QuantumDataPacket( part + remaining).unifyTraceWith(pack); break; } else { break; @@ -180,10 +183,10 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas weight = getParameterIn(i, 0); if (weight < 0) { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); } else if (Double.isNaN(weight)) { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); } else { setStatusOfParameterIn(i, 0, weight==0?STATUS_LOW:GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); dest = getParameterIn(i, 1); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 1623ee60ad..4584e86122 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -1,25 +1,25 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; 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_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -89,7 +89,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -110,7 +110,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @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[texturePage][0], new GT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][0], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][0]}; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 5fb232b256..5e60f59807 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -4,19 +4,19 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -80,7 +80,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB @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[texturePage][4], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; } @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,4, 4, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,4, 4, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 0ef0b04c17..67c390ab7c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -1,16 +1,16 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; 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_RenderedTexture; 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 net.minecraft.block.Block; @@ -22,12 +22,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.HashSet; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.loader.MainLoader.microwaving; import static gregtech.api.GregTech_API.sBlockCasings4; @@ -38,7 +37,6 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock public static final int POWER_SETTING_DEFAULT=1000, TIMER_SETTING_DEFAULT=360; private int powerSetting,timerSetting,timerValue; private boolean hasBeenPausedThisCycle=false; - private boolean flipped=false; //region Structure //use multi A energy inputs, use less power the longer it runs @@ -49,13 +47,6 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock {"0---0", "0---0", "0---0", " 000 ",}, {"00000", "00000", "00000", "0 0",}, }; - private static final String[][] shapeFlipped = new String[][]{ - {shape[0][3],shape[0][2],shape[0][1],shape[0][0],}, - {shape[1][3],shape[1][2],shape[1][1],shape[1][0],}, - {shape[2][3],shape[2][2],shape[2][1],shape[2][0],}, - {shape[3][3],shape[3][2],shape[3][1],shape[3][0],}, - {shape[4][3],shape[4][2],shape[4][1],shape[4][0],}, - }; private static final Block[] blockType = new Block[]{sBlockCasings4}; private static final byte[] blockMeta = new byte[]{1}; @@ -65,7 +56,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock private static final byte[] blockMetaFallback = new byte[]{1}; private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", + "1 - Classic Hatches or Clean Stainless Steel Casing", "Also acts like a hopper so give it an Output Bus", }; //endregion @@ -86,7 +77,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], new TT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; }else if(aSide == GT_Utility.getOppositeSide(aFacing)) { return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], aActive ? Textures.BlockIcons.CASING_BLOCKS[52] : Textures.BlockIcons.CASING_BLOCKS[53]}; } @@ -95,50 +86,22 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, true, true); } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", false, false, true);//todo texture - } - - @Override - public boolean isFacingValid(byte aFacing) { - return aFacing >= 2; + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", false, true, true);//todo texture } @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if(flipped){//some optimization - if(structureCheck_EM(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ - flipped=true; - return true; - } - if(structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ - flipped=false; - return true; - } - }else{ - if(structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ - flipped=false; - return true; - } - if(structureCheck_EM(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ - flipped=true; - return true; - } - } - return false; + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); } @Override public void construct(int stackSize, boolean hintsOnly) { - if((stackSize &0x1)==1) { - StructureBuilder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), hintsOnly); - } else { - StructureBuilder(shapeFlipped, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), hintsOnly); - } + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(),this, hintsOnly); } @Override @@ -179,21 +142,16 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } timerValue--; IGregTechTileEntity mte=getBaseMetaTileEntity(); - int xDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetX*2; - int zDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetZ*2; - float xPos=mte.getXCoord()+0.5f; - float yPos=mte.getYCoord()+0.5f; - float zPos=mte.getZCoord()+0.5f; - ArrayList<ItemStack> itemsToOutput=new ArrayList<>(); - HashSet<Entity> tickedStuff=new HashSet<>(); - - AxisAlignedBB aabb=AxisAlignedBB.getBoundingBox( - xPos-1.5+xDirShift, - yPos-(flipped?2.5:.5), - zPos-1.5+zDirShift, - xPos+1.5+xDirShift, - yPos+(flipped?.5:2.5), - zPos+1.5+zDirShift); + double[] xyzOffsets= getTranslatedOffsets(0,-1,2); + double xPos=mte.getXCoord()+0.5f+xyzOffsets[0]; + double yPos=mte.getYCoord()+0.5f+xyzOffsets[1]; + double zPos=mte.getZCoord()+0.5f+xyzOffsets[2]; + AxisAlignedBB aabb=getBoundingBox(-2,-2,-2,2,2,2).offset(xPos,yPos,zPos); + xyzOffsets= getTranslatedOffsets(0,-4,0); + double[] xyzExpansion= getTranslatedOffsets(1.5,0,1.5); + for(int i=0;i<3;i++){//gets ABS from translated to get expansion values + if(xyzExpansion[i]<0)xyzExpansion[i]=-xyzExpansion[i]; + } int damagingFactor = Math.min(powerSetting >> 6,8)+ @@ -201,6 +159,9 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock Math.min(powerSetting >> 12,48)+ (powerSetting >> 18); + ArrayList<ItemStack> itemsToOutput=new ArrayList<>(); + HashSet<Entity> tickedStuff=new HashSet<>(); + boolean inside=true; do { for (Object entity : mte.getWorld().getEntitiesWithinAABBExcludingEntity(null, aabb)) { @@ -226,11 +187,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } } } - aabb.offset(0,flipped?-3:3,0); - aabb.minX-=.5f; - aabb.maxX+=.5f; - aabb.minZ-=.5f; - aabb.maxZ+=.5f; + aabb.offset(xyzOffsets[0],xyzOffsets[1],xyzOffsets[2]); + aabb=aabb.expand(xyzExpansion[0],xyzExpansion[1],xyzExpansion[2]); inside=false; damagingFactor>>=1; } while(damagingFactor>0); @@ -277,7 +235,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock if (timerParameter <= 1) { setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); } else if (timerParameter <= 3000) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); } else if (Double.isNaN(timerParameter)) { setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); } else { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index ca58340bad..82722e76f9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -21,9 +21,9 @@ import net.minecraft.util.EnumChatFormatting; import java.util.ArrayList; +import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.V; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static gregtech.api.GregTech_API.*; import static gregtech.api.enums.GT_Values.E; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java index b0b8a5a070..91b2635001 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java @@ -35,16 +35,30 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { } @Override + protected void bindPlayerInventory(InventoryPlayer aInventoryPlayer) { + int i; + for(i = 0; i < 3; ++i) { + for(int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 110 + i * 18)); + } + } + + for(i = 0; i < 9; ++i) { + this.addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 168)); + } + } + + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 1, 152, -21)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, -2, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 15, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 32, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 174, 116, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 174, 132, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 174, 148, false, false, 1)); + addSlotToContainer(new Slot(mTileEntity, 1, 174, 168)); } @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { + if (aSlotIndex < 0 || aSlotIndex > 2) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); @@ -52,7 +66,7 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { GT_MetaTileEntity_MultiblockBase_EM mte = (GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity(); IGregTechTileEntity base = mte.getBaseMetaTileEntity(); switch (aSlotIndex) { - case 1: + case 0: if(ePowerPassButton) { TecTech.proxy.playSound(base,"fx_click"); mte.ePowerPass ^= true; @@ -65,13 +79,13 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { } } break; - case 2: + case 1: if(eSafeVoidButton) { TecTech.proxy.playSound(base,"fx_click"); mte.eSafeVoid ^= true; } break; - case 3: + case 2: if(allowedToWorkButton) { TecTech.proxy.playSound(base,"fx_click"); if (mte.getBaseMetaTileEntity().isAllowedToWork()) { @@ -131,6 +145,11 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { } @Override + public int getSlotStartIndex() { + return 3; + } + + @Override public int getSlotCount() { return 1; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java index 3456f22a05..40285cc5e7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java @@ -1,9 +1,16 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; +import gregtech.api.GregTech_API; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.client.gui.FontRenderer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemDye; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import java.util.List; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.*; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; @@ -13,9 +20,9 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; */ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Machine { - String mName = ""; + private String mName; private static byte counter = 0; - public final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; + private final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; public GT_GUIContainer_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, boolean enablePowerPass, boolean enableSafeVoid, boolean enablePowerButton) { super(new GT_Container_MultiMachineEM(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); @@ -23,54 +30,68 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach ePowerPassButton=enablePowerPass; eSafeVoidButton=enableSafeVoid; allowedToWorkButton=enablePowerButton; + ySize= 192; + xSize = 198; } public GT_GUIContainer_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { super(new GT_Container_MultiMachineEM(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); mName = aName; ePowerPassButton=eSafeVoidButton=allowedToWorkButton=true; + ySize= 192; + xSize = 198; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float par3) { + super.drawScreen(mouseX, mouseY, par3); + if (mContainer != null) { + if (mContainer.mTileEntity != null && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_MultiblockBase_EM) { + LEDtooltips(mouseX, mouseY); + } + } } @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(mName, 10, -18, 16448255); + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { + fontRendererObj.drawString(mName, 7, 8, 16448255); if (mContainer != null) { if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 1) != 0) { - fontRendererObj.drawString("Pipe is loose.", 10, -10, 16448255); + fontRendererObj.drawString("Pipe is loose.", 7, 16, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 2) != 0) { - fontRendererObj.drawString("Screws are loose.", 10, -2, 16448255); + fontRendererObj.drawString("Screws are loose.", 7, 24, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 4) != 0) { - fontRendererObj.drawString("Something is stuck.", 10, 6, 16448255); + fontRendererObj.drawString("Something is stuck.", 7, 32, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 8) != 0) { - fontRendererObj.drawString("Plating is dented.", 10, 14, 16448255); + fontRendererObj.drawString("Plating is dented.", 7, 40, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 16) != 0) { - fontRendererObj.drawString("Circuitry burned out.", 10, 22, 16448255); + fontRendererObj.drawString("Circuitry burned out.", 7, 48, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 32) != 0) { - fontRendererObj.drawString("That doesn't belong there.", 10, 30, 16448255); + fontRendererObj.drawString("That doesn't belong there.", 7, 56, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 64) != 0) { - fontRendererObj.drawString("Incomplete Structure.", 10, 38, 16448255); + fontRendererObj.drawString("Incomplete Structure.", 7, 64, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 128) != 0) { - fontRendererObj.drawString("Too Uncertain.", 10, 46, 16448255); + fontRendererObj.drawString("Too Uncertain.", 7, 72, 16448255); } if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 256) != 0) { - fontRendererObj.drawString("Invalid Parameters.", 10, 54, 16448255); + fontRendererObj.drawString("Invalid Parameters.", 7, 80, 16448255); } if (((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode == 0) { if (((GT_Container_MultiMachineEM) mContainer).mActive == 0) { - fontRendererObj.drawString("Soft Hammer or press Button", 10, -10, 16448255); - fontRendererObj.drawString("to (re-)start the Machine", 10, -2, 16448255); - fontRendererObj.drawString("if it doesn't start.", 10, 6, 16448255); + fontRendererObj.drawString("Soft Hammer or press Button", 7, 16, 16448255); + fontRendererObj.drawString("to (re-)start the Machine", 7, 24, 16448255); + fontRendererObj.drawString("if it doesn't start.", 7, 32, 16448255); } else { - fontRendererObj.drawString("Running perfectly.", 10, -10, 16448255); + fontRendererObj.drawString("Running perfectly.", 7, 16, 16448255); } } } @@ -81,101 +102,98 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (width - xSize) / 2; int y = (height - ySize) / 2; - y -= 26; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize + 26); + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); if (mContainer != null && ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus != null) { counter = (byte) ((1 + counter) % 6); GL11.glColor4f(1f, 1f, 1f, 1f); - + x+= 173; if(!ePowerPassButton) { - drawTexturedModalRect(x + 151, y + 23, 215, 23, 18, 18); + drawTexturedModalRect(x, y + 115, 231, 23, 18, 18); } else if (((GT_Container_MultiMachineEM) mContainer).ePowerPass) { - drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); + drawTexturedModalRect(x, y + 115, 207, 23, 18, 18); } if(!eSafeVoidButton) { - drawTexturedModalRect(x + 151, y + 41, 215, 41, 18, 18); + drawTexturedModalRect(x, y + 132, 231, 41, 18, 18); } else if (((GT_Container_MultiMachineEM) mContainer).eSafeVoid) { - drawTexturedModalRect(x + 151, y + 41, 183, 41, 18, 18); + drawTexturedModalRect(x, y + 132, 207, 41, 18, 18); } if(!allowedToWorkButton) { - drawTexturedModalRect(x + 151, y + 57, 215, 57, 18, 18); + drawTexturedModalRect(x, y + 147, 231, 57, 18, 18); } else if (((GT_Container_MultiMachineEM) mContainer).allowedToWork) { - drawTexturedModalRect(x + 151, y + 57, 183, 57, 18, 18); + drawTexturedModalRect(x, y + 147, 207, 57, 18, 18); } - - x += 11; + x -= 162; y += 96; for (int i = 0; i < 20; ) { - byte b = (byte) (i >>> 1); - LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[b]); - LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[b]); - LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[b + 10]); - LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[b + 10]); + byte hatch = (byte) (i >>> 1); + LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[hatch]); + LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[hatch]); + LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[hatch + 10]); + LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[hatch + 10]); } - short rU = 183, Vs = 77; - x += 140; - y -= 19; + short rU = 207, Vs = 77; + x += 162; byte state = ((GT_Container_MultiMachineEM) mContainer).eCertainStatus; switch (((GT_Container_MultiMachineEM) mContainer).eCertainMode) { case 1://ooo oxo ooo drawTexturedModalRect(x + 6, y + 6, - rU + (state == 0 ? 38 : 6), + rU + (state == 0 ? 30 : 6), Vs + 6, 6, 6); break; case 2://ooo xox ooo drawTexturedModalRect(x, y + 6, - rU + ((state & 1) == 0 ? 32 : 0), + rU + ((state & 1) == 0 ? 24 : 0), Vs + 6, 6, 6); drawTexturedModalRect(x + 12, y + 6, - rU + ((state & 2) == 0 ? 44 : 12), + rU + ((state & 2) == 0 ? 36 : 12), Vs + 6, 6, 6); break; case 3://oxo xox oxo drawTexturedModalRect(x + 6, y, - rU + ((state & 1) == 0 ? 38 : 6), + rU + ((state & 1) == 0 ? 30 : 6), Vs, 6, 6); drawTexturedModalRect(x, y + 6, - rU + ((state & 2) == 0 ? 32 : 0), + rU + ((state & 2) == 0 ? 24 : 0), Vs + 6, 6, 6); drawTexturedModalRect(x + 12, y + 6, - rU + ((state & 4) == 0 ? 44 : 12), + rU + ((state & 4) == 0 ? 36 : 12), Vs + 6, 6, 6); drawTexturedModalRect(x + 6, y + 12, - rU + ((state & 8) == 0 ? 38 : 6), + rU + ((state & 8) == 0 ? 30 : 6), Vs + 12, 6, 6); break; case 4://xox ooo xox drawTexturedModalRect(x, y, - rU + ((state & 1) == 0 ? 32 : 0), + rU + ((state & 1) == 0 ? 24 : 0), Vs, 6, 6); drawTexturedModalRect(x + 12, y, - rU + ((state & 2) == 0 ? 44 : 12), + rU + ((state & 2) == 0 ? 36 : 12), Vs, 6, 6); drawTexturedModalRect(x, y + 12, - rU + ((state & 4) == 0 ? 32 : 0), + rU + ((state & 4) == 0 ? 24 : 0), Vs + 12, 6, 6); drawTexturedModalRect(x + 12, y + 12, - rU + ((state & 8) == 0 ? 44 : 12), + rU + ((state & 8) == 0 ? 36 : 12), Vs + 12, 6, 6); break; case 5://xox oxo xox drawTexturedModalRect(x, y, - rU + ((state & 1) == 0 ? 32 : 0), + rU + ((state & 1) == 0 ? 24 : 0), Vs, 6, 6); drawTexturedModalRect(x + 12, y, - rU + ((state & 2) == 0 ? 44 : 12), + rU + ((state & 2) == 0 ? 36 : 12), Vs, 6, 6); drawTexturedModalRect(x + 6, y + 6, - rU + ((state & 4) == 0 ? 38 : 6), + rU + ((state & 4) == 0 ? 30 : 6), Vs + 6, 6, 6); drawTexturedModalRect(x, y + 12, - rU + ((state & 8) == 0 ? 32 : 0), + rU + ((state & 8) == 0 ? 24 : 0), Vs + 12, 6, 6); drawTexturedModalRect(x + 12, y + 12, - rU + ((state & 16) == 0 ? 44 : 12), + rU + ((state & 16) == 0 ? 36 : 12), Vs + 12, 6, 6); break; } @@ -185,7 +203,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach private void LEDdrawP(int x, int y, int i, int j, byte status) { int v = 192, su = 8, sv = 6, u = 11; switch (status) { - case STATUS_WRONG: {//fallthrough + case STATUS_WRONG: //fallthrough if (counter < 2) { drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv); break; @@ -193,7 +211,6 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv); break; } - } case STATUS_OK://ok drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (4 + j), su, sv); break; @@ -213,6 +230,120 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach case STATUS_HIGH:// too high drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (6 + j), su, sv); break; + case STATUS_UNUSED: + if (GregTech_API.sColoredGUI && this.mContainer.mTileEntity != null) { + int tColor = this.mContainer.mTileEntity.getColorization() & 15; + if (tColor < ItemDye.field_150922_c.length) { + tColor = ItemDye.field_150922_c[tColor]; + GL11.glColor4f((float)(tColor >> 16 & 255) / 255.0F, (float)(tColor >> 8 & 255) / 255.0F, (float)(tColor & 255) / 255.0F, 1.0F); + } + } + drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); + GL11.glColor4f(1f, 1f, 1f, 1f); + break; + } + } + + private void LEDtooltips(int x,int y){ + int renderPosX=x; + int renderPosY=y; + x-= (width - xSize) / 2; + y-= (height - ySize) / 2; + //drawHoveringText(Arrays.asList(""+x,""+y), -1, -11, fontRendererObj); + if(mContainer.mTileEntity!=null){ + IMetaTileEntity mte=mContainer.mTileEntity.getMetaTileEntity(); + if(mte instanceof GT_MetaTileEntity_MultiblockBase_EM){ + int su = 8, sv = 6, u=11,v=96; + if(x<u || y<v) return; + v+=sv; + for(int hatch=0;hatch<10;hatch++){ + for(int param=0;param<2;param++){ + if(x<(u+=su)){ + if(y<v){ + if(((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[hatch + (10*param)]==STATUS_UNUSED){ + return; + } + hoveringText(((GT_MetaTileEntity_MultiblockBase_EM) mte).getFullLedDescriptionIn(hatch,param), renderPosX, renderPosY, fontRendererObj); + return; + }else if(y>=v && y<v+sv){ + if(((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[hatch + (10*param)]==STATUS_UNUSED){ + return; + } + hoveringText(((GT_MetaTileEntity_MultiblockBase_EM) mte).getFullLedDescriptionOut(hatch,param), renderPosX, renderPosY, fontRendererObj); + return; + } + } + } + } + } + } + } + + private void hoveringText(List strings, int x, int y, FontRenderer font) { + if (!strings.isEmpty()) { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + //RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + int k = 0; + + for (Object aP_146283_1_ : strings) { + String s = (String) aP_146283_1_; + int l = font.getStringWidth(s); + + if (l > k) { + k = l; + } + } + + int x2 = x + 12; + int y2 = y - 12; + int i1 = 8; + + if (strings.size() > 1) { + i1 += 2 + (strings.size() - 1) * 10; + } + + if (x2 + k > this.width) { + x2 -= 28 + k; + } + + if (y2 + i1 + 6 > this.height) { + y2 = this.height - i1 - 6; + } + + //this.zLevel = 300.0F; + //itemRender.zLevel = 300.0F; + int j1 = 0xf0001040;//bg + this.drawGradientRect(x2 - 3, y2 - 4, x2 + k + 3, y2 - 3, j1, j1); + this.drawGradientRect(x2 - 3, y2 + i1 + 3, x2 + k + 3, y2 + i1 + 4, j1, j1); + this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 + i1 + 3, j1, j1); + this.drawGradientRect(x2 - 4, y2 - 3, x2 - 3, y2 + i1 + 3, j1, j1); + this.drawGradientRect(x2 + k + 3, y2 - 3, x2 + k + 4, y2 + i1 + 3, j1, j1); + int k1 = 0x500040ff;//border bright + int l1 = (k1 & 0xfefefe) >> 1 | k1 & 0xff000000;//border dark??? + this.drawGradientRect(x2 - 3, y2 - 3 + 1, x2 - 3 + 1, y2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(x2 + k + 2, y2 - 3 + 1, x2 + k + 3, y2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 - 3 + 1, k1, k1); + this.drawGradientRect(x2 - 3, y2 + i1 + 2, x2 + k + 3, y2 + i1 + 3, l1, l1); + + for (int i2 = 0; i2 < strings.size(); ++i2) { + String s1 = (String) strings.get(i2); + font.drawStringWithShadow(s1, x2, y2, -1); + + if (i2 == 0) { + y2 += 2; + } + + y2 += 10; + } + + //this.zLevel = 0.0F; + //itemRender.zLevel = 0.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + //RenderHelper.enableStandardItemLighting(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); } } }
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index ef9b9ce833..ebcc0ef622 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -1,13 +1,17 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; +import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Vec3pos; -import com.github.technus.tectech.auxiliary.Reference; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationMessage; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationPacketDispatcher; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -17,7 +21,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.*; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; @@ -27,6 +30,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; @@ -38,16 +42,17 @@ import java.util.HashMap; import java.util.Map; import static com.github.technus.tectech.CommonValues.*; -import static com.github.technus.tectech.Util.*; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.Util.StructureCheckerExtreme; +import static com.github.technus.tectech.Util.getTier; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; /** * Created by danie_000 on 27.10.2016. */ -public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEntity_MultiBlockBase { +public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEntity_MultiBlockBase implements IFrontRotation { //region Constants - //Placeholers for nothing feel free to use + //Placeholders for nothing feel free to use public static final ItemStack[] nothingI = new ItemStack[0]; public static final FluidStack[] nothingF = new FluidStack[0]; //endregion @@ -102,7 +107,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt final byte[] eParamsInStatus = new byte[20];//LED status for I final byte[] eParamsOutStatus = new byte[20];//LED status for O - public static final byte STATUS_UNUSED = 0, + public static final byte STATUS_UNUSED =7, STATUS_NEUTRAL = 0, STATUS_TOO_LOW = 1, STATUS_LOW = 2, STATUS_WRONG = 3, STATUS_OK = 4, STATUS_TOO_HIGH = 5, STATUS_HIGH = 6; @@ -113,6 +118,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region Control variables + //should explode on dismatle?, set it in constructor, if true machine will explode if invalidated structure while active + protected boolean eDismantleBoom = false; + //what is the amount of A required public long eAmpereFlow = 1; // analogue of EU/t but for amperes used (so eu/t is actually eu*A/t) USE ONLY POSITIVE NUMBERS! @@ -139,7 +147,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region READ ONLY unless u really need to change it //functionality toggles - changed by buttons in gui also - protected boolean ePowerPass = false, eSafeVoid = false, eDismantleBoom = false; + protected boolean ePowerPass = false, eSafeVoid = false; //max amperes machine can take in after computing it to the lowest tier (exchange packets to min tier count) protected long eMaxAmpereFlow = 0; @@ -153,6 +161,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //just some info - private so hidden private boolean explodedThisTick=false; + //front rotation val + private byte frontRotation = 0; + //endregion protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) { @@ -165,19 +176,211 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt parametersLoadDefault_EM(); } - //region SUPER STRUCT CHECKERS + //region SUPER STRUCT + + @Override + public boolean isFrontRotationValid(byte frontRotation, byte frontFacing){ + return true; + } + + public boolean isFacingValid_EM(byte aFacing){ + return true; + } + + @Override + public void rotateAroundFrontPlane(boolean direction) { + if(direction){ + frontRotation++; + if(frontRotation>3) frontRotation=0; + }else { + frontRotation--; + if(frontRotation<0) frontRotation=3; + } + if (isFrontRotationValid(frontRotation, getBaseMetaTileEntity().getFrontFacing())) { + updateRotationOnClients(); + } else { + rotateAroundFrontPlane(direction); + } + } + + /** + * Gets AABB based on abc and not xyz, without offsetting to controller position!!! + * @param minA + * @param minB + * @param minC + * @param maxA + * @param maxB + * @param maxC + * @return + */ + public final AxisAlignedBB getBoundingBox(int minA,int minB,int minC,int maxA,int maxB,int maxC){ + double[] offSetsMin= getTranslatedOffsets(minA,minB,minC); + double[] offSetsMax= getTranslatedOffsets(maxA,maxB,maxC); + for (int i=0;i<3;i++){ + if(offSetsMax[i]<offSetsMin[i]){ + double temp=offSetsMax[i]; + offSetsMax[i]=offSetsMin[i]; + offSetsMin[i]=temp; + } + } + return AxisAlignedBB.getBoundingBox( + offSetsMin[0],offSetsMin[1],offSetsMin[2], + offSetsMax[0],offSetsMax[1],offSetsMax[2] + ); + } + + /** + * Translates relative axis coordinates abc to absolute axis coordinates xyz + * abc from the CONTROLLER! + * @param a + * @param b + * @param c + * @return + */ + public final double[] getTranslatedOffsets(double a, double b, double c){ + double[] result=new double[3]; + switch (getBaseMetaTileEntity().getFrontFacing() +(frontRotation<<3)){ + case 4: + result[0]= c; + result[2]= a; + result[1]=- b; + break; + case 12: + result[0]= c; + result[1]=- a; + result[2]=- b; + break; + case 20: + result[0]= c; + result[2]=- a; + result[1]= b; + break; + case 28: + result[0]= c; + result[1]= a; + result[2]= b; + break; + + case 3: + result[0]= a; + result[2]=- c; + result[1]=- b; + break; + case 11: + result[1]=- a; + result[2]=- c; + result[0]=- b; + break; + case 19: + result[0]=- a; + result[2]=- c; + result[1]= b; + break; + case 27: + result[1]= a; + result[2]=- c; + result[0]= b; + break; + + case 5: + result[0]=- c; + result[2]=- a; + result[1]=- b; + break; + case 13: + result[0]=- c; + result[1]=- a; + result[2]= b; + break; + case 21: + result[0]=- c; + result[2]= a; + result[1]= b; + break; + case 29: + result[0]=- c; + result[1]= a; + result[2]=- b; + break; + + case 2: + result[0]=- a; + result[2]= c; + result[1]=- b; + break; + case 10: + result[1]=- a; + result[2]= c; + result[0]= b; + break; + case 18: + result[0]= a; + result[2]= c; + result[1]= b; + break; + case 26: + result[1]= a; + result[2]= c; + result[0]=- b; + break; + //Things get odd if the block faces up or down... + case 1: + result[0]= a; + result[2]= b; + result[1]=- c; + break;//similar to 3 + case 9: + result[2]= a; + result[0]=- b; + result[1]=- c; + break;//similar to 3 + case 17: + result[0]=- a; + result[2]=- b; + result[1]=- c; + break;//similar to 3 + case 25: + result[2]=- a; + result[0]= b; + result[1]=- c; + break;//similar to 3 + + case 0: + result[0]=- a; + result[2]= b; + result[1]= c; + break;//similar to 2 + case 8: + result[2]= a; + result[0]= b; + result[1]= c; + break; + case 16: + result[0]= a; + result[2]=- b; + result[1]= c; + break; + case 24: + result[2]=- a; + result[0]=- b; + result[0]=- b; + result[1]=+ c; + break; + } + return result; + } //can be used to check structures of multi-blocks larger than one chunk, but... //ALL THE HATCHES AND THE CONTROLLER SHOULD BE IN ONE CHUNK OR IN LOADED CHUNKS - @Deprecated - public final boolean structureCheck_EM( - String[][] structure,//0-9 casing, +- air no air, a-z ignore - Block[] blockType,//use numbers 0-9 for casing types - byte[] blockMeta,//use numbers 0-9 for casing types - int horizontalOffset, int verticalOffset, int depthOffset) { - return StructureChecker(structure, blockType, blockMeta, - horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), !mMachine); - } + //@Deprecated + //public final boolean structureCheck_EM( + // String[][] structure,//0-9 casing, +- air no air, a-z ignore + // Block[] blockType,//use numbers 0-9 for casing types + // byte[] blockMeta,//use numbers 0-9 for casing types + // int horizontalOffset, int verticalOffset, int depthOffset) { + // return StructureChecker(structure, blockType, blockMeta, + // horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), !mMachine); + //} public final boolean structureCheck_EM( String[][] structure,//0-9 casing, +- air no air, a-z ignore @@ -188,8 +391,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt Block[] blockTypeFallback,//use numbers 0-9 for casing types byte[] blockMetaFallback,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset) { - return StructureCheckerAdvanced(structure, blockType, blockMeta, adderMethod, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, - horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), !mMachine); + return StructureCheckerExtreme(structure, blockType, blockMeta, adderMethod, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, + horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), this, !mMachine); } //endregion @@ -249,6 +452,40 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region tooltip and scanner result /** + * + * @param hatchNo + * @param paramID + * @return + */ + public ArrayList<String> getFullLedDescriptionIn(int hatchNo, int paramID){ + ArrayList<String> list=new ArrayList<>(); + list.add(EnumChatFormatting.WHITE+"ID: " + + EnumChatFormatting.AQUA+hatchNo + + EnumChatFormatting.YELLOW+ ":" + + EnumChatFormatting.AQUA+paramID + + EnumChatFormatting.YELLOW+ ":"+ + EnumChatFormatting.AQUA+"I"); + return list; + } + + /** + * + * @param hatchNo + * @param paramID + * @return + */ + public ArrayList<String> getFullLedDescriptionOut(int hatchNo, int paramID){ + ArrayList<String> list=new ArrayList<>(); + list.add(EnumChatFormatting.WHITE+"ID: " + + EnumChatFormatting.AQUA+hatchNo + + EnumChatFormatting.YELLOW+ ":" + + EnumChatFormatting.AQUA+paramID + + EnumChatFormatting.YELLOW+ ":"+ + EnumChatFormatting.AQUA+"O"); + return list; + } + + /** * TOOLTIP * @return strings in tooltip */ @@ -312,7 +549,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //endregion - //region GUI/SOUND + //region GUI/SOUND/RENDER /** * Server side container @@ -364,7 +601,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @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[texturePage][4], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; } @@ -507,7 +744,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) { hatch_elemental.id = -1; } - for (GT_MetaTileEntity_Hatch_OutputData hatch_data : eOutputData) { + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { hatch_data.id = -1; hatch_data.q = null; } @@ -554,17 +791,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } /** - * loads default parameters in CONSTRUCTOR! FUCKING ONCE + * loads default parameters in CONSTRUCTOR! CALLED ONCE on creation, don't call it in your classes */ protected void parametersLoadDefault_EM(){ //load default parameters with setParameterPairIn_ClearOut } /** - * This is called automatically when there is new parameters data, copy it to your variables for safe storage + * This is called automatically when there was parameters data update, copy it to your variables for safe storage * although the base code only downloads the values from parametrizers when machines is NOT OPERATING * - * good place for get Parameters + * good place to get Parameters */ protected void parametersInRead_EM(){} @@ -591,7 +828,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected void extraExplosions_EM() {}//For that extra hatches explosions, and maybe some MOORE EXPLOSIONS /** - * Get Available data, Override only on data producers should return mAvailableData that is set in check recipe + * Get Available data, Override only on data outputters should return mAvailableData that is set in check recipe * @return available data */ protected long getAvailableData_EM() { @@ -599,7 +836,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); for (GT_MetaTileEntity_Hatch_InputData in : eInputData) { if (in.q != null) { - result += in.q.computationIfNotContained(pos); + Long value=in.q.contentIfNotInTrace(pos); + if(value!=null) { + result += value; + } } } return result; @@ -607,7 +847,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * Extra hook on cyclic updates (not really needed for machines smaller than 1 chunk) - * BUT NEEDED WHEN - machine blocks are not touching each other ot they don't implement IMachineBlockUpdateable (ex. air) + * BUT NEEDED WHEN - machine blocks are not touching each other or they don't implement IMachineBlockUpdateable (ex. air,stone,weird TE's) */ protected boolean cyclicUpdate_EM() { return mUpdate <= -1000;//set to false to disable cyclic update @@ -660,6 +900,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt aNBT.setByte("eCertainM", eCertainMode); aNBT.setByte("eCertainS", eCertainStatus); aNBT.setByte("eMinRepair", minRepairStatus); + aNBT.setByte("eRotation",frontRotation); aNBT.setBoolean("eParam", eParameters); aNBT.setBoolean("ePass", ePowerPass); aNBT.setBoolean("eVoid", eSafeVoid); @@ -752,6 +993,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt eCertainMode = aNBT.getByte("eCertainM"); eCertainStatus = aNBT.getByte("eCertainS"); minRepairStatus = aNBT.getByte("eMinRepair"); + frontRotation = aNBT.getByte("eRotation"); eParameters = aNBT.getBoolean("eParam"); ePowerPass = aNBT.getBoolean("ePass"); eSafeVoid = aNBT.getBoolean("eVoid"); @@ -823,7 +1065,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } /** - * if u want to use gt recipes maps... + * if u want to use gt recipe maps... * @return */ @Override @@ -832,7 +1074,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } /** - * does some validation and cleaning,, dont touch i think + * does some validation and cleaning, dont touch i think */ @Override public void updateSlots() { @@ -850,27 +1092,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt */ @Override public void stopMachine() { - if (outputEM != null) { - float mass = 0; - for (cElementalInstanceStackMap tree : outputEM) { - if (tree != null) { - mass += tree.getMass(); - } - } - if (mass > 0) { - if (eMufflerHatches.size() < 1) { - explodeMultiblock(); - } else { - mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { - if (dump.addOverflowMatter(mass)) { - explodeMultiblock(); - } - } - } - } - outputEM = null; - } + cleanOrExplode(); for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { data.q = null; @@ -892,6 +1114,24 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt * helper method so i don't have to set that params to nothing at all times */ protected void afterRecipeCheckFailed(){ + cleanOrExplode(); + + for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { + data.q = null; + } + + mOutputItems = null; + mOutputFluids = null; + mEfficiency = 0; + mEfficiencyIncrease = 0; + mProgresstime = 0; + mMaxProgresstime = 0; + eAvailableData = 0; + //getBaseMetaTileEntity().disableWorking(); //can add in override + //hatchesStatusUpdate_EM(); //called always after recipe checks + } + + private void cleanOrExplode() { if (outputEM != null) { float mass = 0; for (cElementalInstanceStackMap tree : outputEM) { @@ -913,20 +1153,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } outputEM = null; } - - for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { - data.q = null; - } - - mOutputItems = null; - mOutputFluids = null; - mEfficiency = 0; - mEfficiencyIncrease = 0; - mProgresstime = 0; - //mMaxProgresstime = 0; //Done after this - cos it is VITAL! - eAvailableData = 0; - //getBaseMetaTileEntity().disableWorking(); - //hatchesStatusUpdate_EM(); //called always after recipe checks } /** @@ -954,6 +1180,40 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region internal + @Override + public final byte getFrontRotation() { + return frontRotation; + } + + @Override + public final void forceSetRotationDoRender(byte rotation) { + frontRotation = rotation; + IGregTechTileEntity base=getBaseMetaTileEntity(); + if(base.isClientSide()) { + base.getWorld().markBlockRangeForRenderUpdate(base.getXCoord(), base.getYCoord(), base.getZCoord(), base.getXCoord(), base.getYCoord(), base.getZCoord()); + } + } + + protected final void updateRotationOnClients(){ + if(getBaseMetaTileEntity().isServerSide()){ + IGregTechTileEntity base=getBaseMetaTileEntity(); + RotationPacketDispatcher.INSTANCE.sendToAllAround(new RotationMessage.RotationData(this), + base.getWorld().provider.dimensionId, + base.getXCoord(), + base.getYCoord(), + base.getZCoord(), + 256); + } + } + + @Override + public final boolean isFacingValid(byte aFacing) { + if (!isFrontRotationValid(frontRotation, aFacing)) { + rotateAroundFrontPlane(false); + } + return isFacingValid_EM(aFacing); + } + /** * internal check machine * @param iGregTechTileEntity @@ -978,7 +1238,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return result; } - private void hatchesStatusUpdate_EM() { + /** + * callback for updating parameters, change this if u really need dynamic (inside recipe time) parameter updates + */ + protected void hatchesStatusUpdate_EM() { boolean busy=mMaxProgresstime>0; if (busy) {//write from buffer to hatches only for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { @@ -1025,6 +1288,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //endregion //region TICKING functions + + public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity){} + + @Override + public final void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + isFacingValid(aBaseMetaTileEntity.getFrontFacing()); + if(getBaseMetaTileEntity().isClientSide()){ + RotationPacketDispatcher.INSTANCE.sendToServer(new RotationMessage.RotationQuery(this)); + } + onFirstTick_EM(aBaseMetaTileEntity); + } + /** * called every tick the machines is active * @param aStack @@ -1331,7 +1606,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } } - if (ePowerPass) { + if (ePowerPass && getEUVar()>getMinimumStoredEU()) { for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUOutput(); @@ -1398,7 +1673,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - (getIdealStatus() - getRepairStatus()) * 1000)); }else { afterRecipeCheckFailed(); - mMaxProgresstime=0;//Just to be sure... } updateSlots(); } else { @@ -1414,7 +1688,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - (getIdealStatus() - getRepairStatus()) * 1000)); }else { afterRecipeCheckFailed(); - mMaxProgresstime=0;//Just to be sure... } updateSlots(); } //else notAllowedToWork_stopMachine_EM(); //it is already stopped here @@ -1537,6 +1810,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return false; } + /** + * + * @param EU + * @param Amperes + * @return if was able to put inside the hatches + */ private boolean addEnergyOutput_EM(long EU, long Amperes) { if(EU<0) { EU = -EU; @@ -1580,6 +1859,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } } + setEUVar(Math.min(getEUVar() + euVar,maxEUStore())); return false; } @@ -1617,10 +1897,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EUtTierVoltage > maxEUinputMax || //TIER IS BASED ON BEST HATCH! not total EUtEffective input (EUtTierVoltage*Amperes - 1) / maxEUinputMin + 1 > eMaxAmpereFlow) {// EUuse==0? --> (EUuse - 1) / maxEUinputMin + 1 = 1! //if not too much A if (DEBUG_MODE) { - TecTech.Logger.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar())); - TecTech.Logger.debug("L2 " + EUtEffective + ' ' + maxEUinputMax + ' ' + (EUtEffective > maxEUinputMax)); - TecTech.Logger.debug("L3 " + EUuse + ' ' + eMaxAmpereFlow); - TecTech.Logger.debug("L4 " + ((EUuse - 1) / maxEUinputMin + 1) + ' ' + eMaxAmpereFlow + ' ' + ((EUuse - 1) / maxEUinputMin + 1 > eMaxAmpereFlow)); + TecTech.LOGGER.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar())); + TecTech.LOGGER.debug("L2 " + EUtEffective + ' ' + maxEUinputMax + ' ' + (EUtEffective > maxEUinputMax)); + TecTech.LOGGER.debug("L3 " + EUuse + ' ' + eMaxAmpereFlow); + TecTech.LOGGER.debug("L4 " + ((EUuse - 1) / maxEUinputMin + 1) + ' ' + eMaxAmpereFlow + ' ' + ((EUuse - 1) / maxEUinputMin + 1 > eMaxAmpereFlow)); } return false; } @@ -1701,7 +1981,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //endregion - //region convinience copies input and output EM + //region convenience copies input and output EM //new Method public final cElementalInstanceStackMap getInputsClone_EM(){ cElementalInstanceStackMap in=new cElementalInstanceStackMap(); @@ -1829,7 +2109,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return; } explodedThisTick=true; - if (!TecTech.ModConfig.BOOM_ENABLE) { + if (!TecTech.configTecTech.BOOM_ENABLE) { TecTech.proxy.broadcast("Multi Explode BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); StackTraceElement[] ste = Thread.currentThread().getStackTrace(); TecTech.proxy.broadcast("Multi Explode BOOM! " + ste[2].toString()); @@ -1895,6 +2175,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public void doExplosion(long aExplosionPower) { explodeMultiblock(); + if (!TecTech.configTecTech.BOOM_ENABLE) { + TecTech.proxy.broadcast("Multi DoExplosion BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + StackTraceElement[] ste = Thread.currentThread().getStackTrace(); + TecTech.proxy.broadcast("Multi DoExplosion BOOM! " + ste[2].toString()); + return; + } super.doExplosion(aExplosionPower); }//Redirecting to explodemultiblock //endregion @@ -2413,7 +2699,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - //CALLBACK from hatcher adders + //CALLBACK from hatches adders public boolean addThing(String methodName, IGregTechTileEntity igt, int casing) { try { return (boolean) adderMethodMap.get(methodName).invoke(this, igt, casing); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java new file mode 100644 index 0000000000..59b14c16ed --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java @@ -0,0 +1,140 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; + +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + +public class RotationMessage implements IMessage { + int mPosX; + int mPosY; + int mPosZ; + int mPosD; + int mRotF; + + public RotationMessage() { + } + + private RotationMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); + mPosX=base.getXCoord(); + mPosY=base.getYCoord(); + mPosZ=base.getZCoord(); + mPosD=base.getWorld().provider.dimensionId; + mRotF=metaTile.getFrontRotation(); + } + + private RotationMessage(World world, int x,int y,int z, IFrontRotation front) { + mPosX=x; + mPosY=y; + mPosZ=z; + mPosD=world.provider.dimensionId; + mRotF=front.getFrontRotation(); + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); + mPosX = tTag.getInteger("posx"); + mPosY = tTag.getInteger("posy"); + mPosZ = tTag.getInteger("posz"); + mPosD = tTag.getInteger("posd"); + mRotF = tTag.getInteger("rotf"); + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tFXTag = new NBTTagCompound(); + tFXTag.setInteger("posx", mPosX); + tFXTag.setInteger("posy", mPosY); + tFXTag.setInteger("posz", mPosZ); + tFXTag.setInteger("posd", mPosD); + tFXTag.setInteger("rotf", mRotF); + + ByteBufUtils.writeTag(pBuffer, tFXTag); + } + + public static class RotationQuery extends RotationMessage{ + public RotationQuery() { + } + + public RotationQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + super(metaTile); + } + + public RotationQuery(World world, int x,int y,int z, IFrontRotation front) { + super(world,x,y,z,front); + } + } + + public static class RotationData extends RotationMessage{ + public RotationData() { + } + + private RotationData(RotationQuery query){ + mPosX=query.mPosX; + mPosY=query.mPosY; + mPosZ=query.mPosZ; + mPosD=query.mPosD; + mRotF=query.mRotF; + } + + public RotationData(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + super(metaTile); + } + + public RotationData(World world, int x,int y,int z, IFrontRotation front) { + super(world,x,y,z,front); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler<RotationData> { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, RotationData pMessage, MessageContext pCtx) { + if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ + TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); + if(te instanceof IGregTechTileEntity){ + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if(meta instanceof IFrontRotation){ + ((IFrontRotation) meta).forceSetRotationDoRender((byte)pMessage.mRotF); + } + }else if (te instanceof IFrontRotation){ + ((IFrontRotation) te).forceSetRotationDoRender((byte)pMessage.mRotF); + } + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler<RotationQuery> { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, RotationQuery pMessage, MessageContext pCtx) { + World world= DimensionManager.getWorld(pMessage.mPosD); + if(world!=null) { + TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (meta instanceof IFrontRotation) { + pMessage.mRotF=((IFrontRotation) meta).getFrontRotation(); + return new RotationData(pMessage); + } + } else if (te instanceof IFrontRotation) { + pMessage.mRotF=((IFrontRotation) te).getFrontRotation(); + return new RotationData(pMessage); + } + } + return null; + } + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java new file mode 100644 index 0000000000..29a8f0bcf6 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java @@ -0,0 +1,21 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; + +import eu.usrv.yamcore.network.PacketDispatcher; + +import static com.github.technus.tectech.Reference.MODID; + +public class RotationPacketDispatcher extends PacketDispatcher { + public static RotationPacketDispatcher INSTANCE; + + public RotationPacketDispatcher() { + super(MODID); + INSTANCE = this; + registerPackets(); + } + + @Override + public void registerPackets() { + registerMessage(RotationMessage.ServerHandler.class, RotationMessage.RotationQuery.class); + registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java new file mode 100644 index 0000000000..142214f43c --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java @@ -0,0 +1,768 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base.render; + +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +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.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class TT_RenderedTexture implements ITexture,IColorModulationContainer { + private final IIconContainer mIconContainer; + private final boolean mAllowAlpha; + /** + * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!! + * <p/> + * Just set this variable to another different Array instead. + * Otherwise some colored things will get Problems. + */ + public short[] mRGBa; + + public TT_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ TT_RenderedTexture"); + mIconContainer = aIcon; + mAllowAlpha = aAllowAlpha; + mRGBa = aRGBa; + } + + public TT_RenderedTexture(IIconContainer aIcon, short[] aRGBa) { + this(aIcon, aRGBa, true); + } + + public TT_RenderedTexture(IIconContainer aIcon) { + this(aIcon, Dyes._NULL.mRGBa); + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + byte rotation = getRotation(aX, aY, aZ); + renderFaceXPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(153, 153, 153, 255); + renderFaceXPos(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation); + } + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255); + byte rotation = getRotation(aX, aY, aZ); + renderFaceXNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(153, 153, 153, 255); + renderFaceXNeg(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation); + } + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255); + byte rotation = getRotation(aX, aY, aZ); + renderFaceYPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(255, 255, 255, 255); + renderFaceYPos(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation); + } + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255); + byte rotation = getRotation(aX, aY, aZ); + renderFaceYNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(255, 255, 255, 255); + renderFaceYNeg(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation); + } + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + byte rotation = getRotation(aX, aY, aZ); + renderFaceZPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(204, 204, 204, 255); + renderFaceZPos(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation); + } + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255); + byte rotation = getRotation(aX, aY, aZ); + renderFaceZNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(204, 204, 204, 255); + renderFaceZNeg(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation); + } + } + + + /** + * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture + */ + public void renderFaceYNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, byte rotation) { + Tessellator tessellator = Tessellator.instance; + + if (aRenderer.hasOverrideBlockTexture()) { + icon = aRenderer.overrideBlockTexture; + } + + double d3 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D); + double d4 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D); + double d5 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + double d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + d3 = (double) icon.getMaxU(); + d4 = (double) icon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + d5 = (double) icon.getMinV(); + d6 = (double) icon.getMaxV(); + } + + double d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + switch (rotation) { + case 3: + d3 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D); + d4 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + break; + case 1: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + break; + case 2: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + break; + } + + double d11 = x + aRenderer.renderMinX; + double d12 = x + aRenderer.renderMaxX; + double d13 = y + aRenderer.renderMinY; + double d14 = z + aRenderer.renderMinZ; + double d15 = z + aRenderer.renderMaxZ; + + if (aRenderer.renderFromInside) { + d11 = x + aRenderer.renderMaxX; + d12 = x + aRenderer.renderMinX; + } + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + } else { + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + } + } + + /** + * Renders the given texture to the top face of the block. Args: block, x, y, z, texture + */ + public void renderFaceYPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, byte rotation) { + Tessellator tessellator = Tessellator.instance; + + if (aRenderer.hasOverrideBlockTexture()) { + icon = aRenderer.overrideBlockTexture; + } + + double d3 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D); + double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D); + double d5 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + double d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + d3 = (double) icon.getMinU(); + d4 = (double) icon.getMaxU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + d5 = (double) icon.getMinV(); + d6 = (double) icon.getMaxV(); + } + + double d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + switch (rotation) { + case 1: + d3 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D); + d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + break; + case 3: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + break; + case 2: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + break; + } + + double d11 = x + aRenderer.renderMinX; + double d12 = x + aRenderer.renderMaxX; + double d13 = y + aRenderer.renderMaxY; + double d14 = z + aRenderer.renderMinZ; + double d15 = z + aRenderer.renderMaxZ; + + if (aRenderer.renderFromInside) { + d11 = x + aRenderer.renderMaxX; + d12 = x + aRenderer.renderMinX; + } + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + } else { + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + } + } + + /** + * Renders the given texture to the north (z-negative) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceZNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, byte rotation) { + Tessellator tessellator = Tessellator.instance; + + if (aRenderer.hasOverrideBlockTexture()) { + icon = aRenderer.overrideBlockTexture; + } + + double d3 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D); + double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D); + + if (aRenderer.field_152631_f) { + d4 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D); + d3 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D); + } + + double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D); + double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D); + double d7; + + if (aRenderer.flipTexture) { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + d3 = (double) icon.getMinU(); + d4 = (double) icon.getMaxU(); + } + + if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) { + d5 = (double) icon.getMinV(); + d6 = (double) icon.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + switch (rotation) { + case 3: + d3 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D); + d4 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + break; + case 1: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + break; + case 2: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + break; + } + + double d11 = x + aRenderer.renderMinX; + double d12 = x + aRenderer.renderMaxX; + double d13 = y + aRenderer.renderMinY; + double d14 = y + aRenderer.renderMaxY; + double d15 = z + aRenderer.renderMinZ; + + if (aRenderer.renderFromInside) { + d11 = x + aRenderer.renderMaxX; + d12 = x + aRenderer.renderMinX; + } + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d14, d15, d7, d9); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(d12, d14, d15, d3, d5); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(d12, d13, d15, d8, d10); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + tessellator.addVertexWithUV(d11, d13, d15, d4, d6); + } else { + tessellator.addVertexWithUV(d11, d14, d15, d7, d9); + tessellator.addVertexWithUV(d12, d14, d15, d3, d5); + tessellator.addVertexWithUV(d12, d13, d15, d8, d10); + tessellator.addVertexWithUV(d11, d13, d15, d4, d6); + } + } + + /** + * Renders the given texture to the south (z-positive) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceZPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, byte rotation) { + Tessellator tessellator = Tessellator.instance; + + if (aRenderer.hasOverrideBlockTexture()) { + icon = aRenderer.overrideBlockTexture; + } + + double d3 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D); + double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D); + double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D); + double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D); + double d7; + + if (aRenderer.flipTexture) { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + d3 = (double) icon.getMinU(); + d4 = (double) icon.getMaxU(); + } + + if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) { + d5 = (double) icon.getMinV(); + d6 = (double) icon.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + switch (rotation) { + case 1: + d3 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D); + d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + break; + case 3: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + break; + case 2: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + break; + } + + double d11 = x + aRenderer.renderMinX; + double d12 = x + aRenderer.renderMaxX; + double d13 = y + aRenderer.renderMinY; + double d14 = y + aRenderer.renderMaxY; + double d15 = z + aRenderer.renderMaxZ; + + if (aRenderer.renderFromInside) { + d11 = x + aRenderer.renderMaxX; + d12 = x + aRenderer.renderMinX; + } + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d14, d15, d3, d5); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + tessellator.addVertexWithUV(d12, d14, d15, d7, d9); + } else { + tessellator.addVertexWithUV(d11, d14, d15, d3, d5); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.addVertexWithUV(d12, d14, d15, d7, d9); + } + } + + /** + * Renders the given texture to the west (x-negative) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceXNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, byte rotation) { + Tessellator tessellator = Tessellator.instance; + + if (aRenderer.hasOverrideBlockTexture()) { + icon = aRenderer.overrideBlockTexture; + } + + double d3 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D); + double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D); + double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D); + double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D); + double d7; + + if (aRenderer.flipTexture) { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + d3 = (double) icon.getMinU(); + d4 = (double) icon.getMaxU(); + } + + if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) { + d5 = (double) icon.getMinV(); + d6 = (double) icon.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + switch (rotation) { + case 1: + d3 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D); + d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + break; + case 3: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + break; + case 2: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + break; + } + + double d11 = x + aRenderer.renderMinX; + double d12 = y + aRenderer.renderMinY; + double d13 = y + aRenderer.renderMaxY; + double d14 = z + aRenderer.renderMinZ; + double d15 = z + aRenderer.renderMaxZ; + + if (aRenderer.renderFromInside) { + d14 = z + aRenderer.renderMaxZ; + d15 = z + aRenderer.renderMinZ; + } + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d13, d15, d7, d9); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(d11, d12, d14, d8, d10); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + tessellator.addVertexWithUV(d11, d12, d15, d4, d6); + } else { + tessellator.addVertexWithUV(d11, d13, d15, d7, d9); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d11, d12, d14, d8, d10); + tessellator.addVertexWithUV(d11, d12, d15, d4, d6); + } + } + + /** + * Renders the given texture to the east (x-positive) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceXPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, byte rotation) { + Tessellator tessellator = Tessellator.instance; + + if (aRenderer.hasOverrideBlockTexture()) { + icon = aRenderer.overrideBlockTexture; + } + + double d3 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D); + double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.field_152631_f) { + d4 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMinZ) * 16.0D); + d3 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMaxZ) * 16.0D); + } + + double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D); + double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D); + double d7; + + if (aRenderer.flipTexture) { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + d3 = (double) icon.getMinU(); + d4 = (double) icon.getMaxU(); + } + + if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) { + d5 = (double) icon.getMinV(); + d6 = (double) icon.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + switch (rotation) { + case 3: + d3 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D); + d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D); + d4 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D); + d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + break; + case 1: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + break; + case 2: + d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D); + d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D); + d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D); + d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + break; + } + + double d11 = x + aRenderer.renderMaxX; + double d12 = y + aRenderer.renderMinY; + double d13 = y + aRenderer.renderMaxY; + double d14 = z + aRenderer.renderMinZ; + double d15 = z + aRenderer.renderMaxZ; + + if (aRenderer.renderFromInside) { + d14 = z + aRenderer.renderMaxZ; + d15 = z + aRenderer.renderMinZ; + } + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d12, d15, d8, d10); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d12, d14, d4, d6); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(d11, d13, d14, d7, d9); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + tessellator.addVertexWithUV(d11, d13, d15, d3, d5); + } else { + tessellator.addVertexWithUV(d11, d12, d15, d8, d10); + tessellator.addVertexWithUV(d11, d12, d14, d4, d6); + tessellator.addVertexWithUV(d11, d13, d14, d7, d9); + tessellator.addVertexWithUV(d11, d13, d15, d3, d5); + } + } + + @Override + public short[] getRGBA() { + return mRGBa; + } + + @Override + public boolean isValidTexture() { + return mIconContainer != null; + } + + private static byte getRotation(int x, int y, int z) { + World w = Minecraft.getMinecraft().theWorld; + if (w != null) { + TileEntity te = w.getTileEntity(x, y, z); + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (meta instanceof IFrontRotation) { + return ((IFrontRotation) meta).getFrontRotation(); + } + } + } + return 0; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java index fe40178e88..4b7d41494b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -1,24 +1,27 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; -import static com.github.technus.tectech.Util.V; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour { private final float radius, maxRPM, maxRCF, maxForce, maxCapacity; private final byte tier; + private final static String[] DESCRIPTION_I =new String[]{"RPM Input","Fraction Count Input"}; + private final static String[] DESCRIPTION_O =new String[]{"RPM Setting","RCF Setting","Radius [mm]","Max RPM","Max Force [eV/c^2 * m/s]","Max Capacity [eV/c^2]","Max Power Usage[EU/t]","Max Recipe Rime [tick]"}; private static final double[/*tier+5*/][/*outputHatches+2*/] MIXING_FACTORS =new double[][]{ {.45,.85,.95,1,1,}, @@ -43,6 +46,20 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi } @Override + protected void getFullLedDescriptionIn(ArrayList<String> baseDescr, int hatchNo, int paramID) { + if(hatchNo==0) { + baseDescr.add(DESCRIPTION_I[(hatchNo << 1) + paramID]); + } + } + + @Override + protected void getFullLedDescriptionOut(ArrayList<String> baseDescr, int hatchNo, int paramID) { + if(hatchNo<=2) { + baseDescr.add(DESCRIPTION_O[(hatchNo<<1)+paramID]); + } + } + + @Override public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { boolean check=true; @@ -51,6 +68,15 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi te.setParameterOut(2, 0, maxForce * 9.80665);// (eV/c^2 * m/s) te.setParameterOut(2, 1, maxCapacity);// eV/c^2 + for(int i=4;i<=9;i++) { + te.setStatusOfParameterOut(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterOut(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + } + for(int i=1;i<=3;i++) { + te.setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + } + double RPM = parametersToCheckAndFix[0]; if (RPM > maxRPM) { te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); @@ -115,8 +141,8 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi } float excessMass = 0; while (inputMass > maxCapacity) { - cElementalInstanceStack randomStack = stacks[TecTech.Rnd.nextInt(stacks.length)]; - int amountToRemove = TecTech.Rnd.nextInt((int) randomStack.getAmount()) + 1; + cElementalInstanceStack randomStack = stacks[TecTech.RANDOM.nextInt(stacks.length)]; + int amountToRemove = TecTech.RANDOM.nextInt((int) randomStack.getAmount()) + 1; randomStack.amount -= amountToRemove;//mutates the parent InstanceStackMap if (randomStack.amount <= 0) { input.remove(randomStack.definition); @@ -141,7 +167,7 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi //mixing factor... double mixingFactor=Math.min(1d-(RCF/maxRCF)*(1d-MIXING_FACTORS[tier-5][fractionCount-2]),1); if(DEBUG_MODE){ - TecTech.Logger.info("mixingFactor "+mixingFactor); + TecTech.LOGGER.info("mixingFactor "+mixingFactor); } int mEut = (int) (Math.pow(checkedAndFixedParameters[0] / maxRPM, 3f) * V[tier]); @@ -177,11 +203,11 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi } } //if(DEBUG_MODE){ - // TecTech.Logger.info("absMass "+absMassPerOutput); + // TecTech.LOGGER.info("absMass "+absMassPerOutput); //} absMassPerOutput /= fractionCount; if(DEBUG_MODE){ - TecTech.Logger.info("absMassPerOutput "+absMassPerOutput); + TecTech.LOGGER.info("absMassPerOutput "+absMassPerOutput); } nextFraction: @@ -192,10 +218,10 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi double stackMass = Math.abs(stacks[stackNo].getMass()); long amount = (long) (remaining/Math.abs(stacks[stackNo].definition.getMass())); //if(DEBUG_MODE){ - // TecTech.Logger.info("stackMass "+stackMass); - // TecTech.Logger.info("defMass "+stacks[stackNo].definition.getMass()); - // TecTech.Logger.info("remaining "+remaining); - // TecTech.Logger.info("amountToMoveAvailable "+amount+"/"+stacks[stackNo].amount); + // TecTech.LOGGER.info("stackMass "+stackMass); + // TecTech.LOGGER.info("defMass "+stacks[stackNo].definition.getMass()); + // TecTech.LOGGER.info("remaining "+remaining); + // TecTech.LOGGER.info("amountToMoveAvailable "+amount+"/"+stacks[stackNo].amount); //} if (stackMass == 0) { addRandomly(stacks[stackNo], outputs, fractionCount); @@ -211,8 +237,8 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi outputs[fraction].putUnify(clone); stacks[stackNo].amount-=amount; //if(DEBUG_MODE){ - // TecTech.Logger.info("remainingAfter "+remaining); - // TecTech.Logger.info("amountCloneAfter "+clone.amount+"/"+stacks[stackNo].amount); + // TecTech.LOGGER.info("remainingAfter "+remaining); + // TecTech.LOGGER.info("amountCloneAfter "+clone.amount+"/"+stacks[stackNo].amount); //} } else { continue nextFraction; @@ -246,8 +272,8 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi } int remainingAmount = (int) (me.amount % fractionCount); while (remainingAmount > 0) { - int amountToAdd = TecTech.Rnd.nextInt(remainingAmount) + 1; - stacks[TecTech.Rnd.nextInt(fractionCount)].amount += amountToAdd; + int amountToAdd = TecTech.RANDOM.nextInt(remainingAmount) + 1; + stacks[TecTech.RANDOM.nextInt(fractionCount)].amount += amountToAdd; remainingAmount -= amountToAdd; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java index 236b79c85b..9fe54588bc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Electrolyzer implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Electrolyzer extends GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Electrolyzer(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java index 1d28db92c8..8c912dd38d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java @@ -1,18 +1,20 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; -import static com.github.technus.tectech.Util.V; +import java.util.ArrayList; + +import static com.github.technus.tectech.CommonValues.V; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_ElectromagneticSeparator extends GT_MetaTileEntity_EM_machine.Behaviour { private final byte tier; private final int ticks; private final byte precisionFull; @@ -20,6 +22,8 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ private final float maxCapacity; private final long maxCharge; private final int offsetMax; + private final static String[] DESCRIPTION_I =new String[]{"Full Precision Input [e/3]","Minimal Precision Input [e/3]","Offset Input [e/3]",null}; + private final static String[] DESCRIPTION_O =new String[]{"Full Precision Limit [e/3]","Minimal Precision Limit [e/3]","Offset Limit [e/3]",null,"Max Charge [e/3]","Max Capacity [eV/c^2]","Max Power Usage[EU/t]","Max Recipe Rime [tick]"}; public Behaviour_ElectromagneticSeparator(int desiredTier){ tier=(byte) desiredTier; @@ -65,17 +69,48 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ } @Override + protected void getFullLedDescriptionIn(ArrayList<String> baseDescr, int hatchNo, int paramID) { + if(hatchNo<=1) { + String desc=DESCRIPTION_I[(hatchNo << 1) + paramID]; + if(desc!=null){ + baseDescr.add(desc); + } + } + } + + @Override + protected void getFullLedDescriptionOut(ArrayList<String> baseDescr, int hatchNo, int paramID) { + if(hatchNo<=3){ + String desc=DESCRIPTION_O[(hatchNo<<1)+paramID]; + if(desc!=null){ + baseDescr.add(desc); + } + } + } + + @Override public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { boolean check=true; te.setParameterOut(0,0,precisionFull); te.setParameterOut(0,1,precisionMinimal); te.setParameterOut(1,0,offsetMax); + te.setStatusOfParameterOut(1,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); te.setParameterOut(2,0,maxCharge); te.setParameterOut(2,1,maxCapacity); te.setParameterOut(3,0,V[tier]); te.setParameterOut(3,1,ticks); + for(int i=4;i<=9;i++) { + te.setStatusOfParameterOut(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterOut(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + } + te.setStatusOfParameterIn(1, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + for(int i=2;i<=3;i++) { + te.setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + } + double full=parametersToCheckAndFix[0]; if(Double.isInfinite(full) && full>0) { te.setStatusOfParameterIn(0,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); @@ -152,8 +187,8 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ } float excessMass = 0; while (inputMass > maxCapacity) { - cElementalInstanceStack randomStack = stacks[TecTech.Rnd.nextInt(stacks.length)]; - int amountToRemove = TecTech.Rnd.nextInt((int) randomStack.getAmount()) + 1; + cElementalInstanceStack randomStack = stacks[TecTech.RANDOM.nextInt(stacks.length)]; + int amountToRemove = TecTech.RANDOM.nextInt((int) randomStack.getAmount()) + 1; randomStack.amount -= amountToRemove;//mutates the parent InstanceStackMap if (randomStack.amount <= 0) { input.remove(randomStack.definition); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java index 1cca03ec17..bae032cd9e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_PrecisionLaser implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_PrecisionLaser extends GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_PrecisionLaser(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java index 09249a3d95..4f6d555fdc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Recycler implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Recycler extends GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Recycler(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java index 020a71da5c..32d8b81fdd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Scanner implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Scanner extends GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Scanner(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 032d4e48a8..46e4ede660 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -3,7 +3,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; @@ -18,10 +18,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; +import java.util.ArrayList; import java.util.BitSet; import java.util.HashMap; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -32,6 +33,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa public static final String machine = "EM Machinery"; + private Behaviour currentBehaviour; + //region structure private static final String[][] shape = new String[][]{ {"B0", "A ", "0 - 0", "A ", "B0",}, @@ -73,7 +76,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), this,hintsOnly); } @Override @@ -87,7 +90,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { if(aBaseMetaTileEntity.isServerSide()) { quantumStuff(aBaseMetaTileEntity.isActive()); } @@ -95,11 +98,36 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if(aBaseMetaTileEntity.isActive() && (aTick & 0x2)==0 && aBaseMetaTileEntity.isClientSide()){ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2+aBaseMetaTileEntity.getXCoord(); - int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY*2+aBaseMetaTileEntity.getYCoord(); - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*2+aBaseMetaTileEntity.getZCoord(); - aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir,yDir,zDir,xDir,yDir,zDir); + if(aBaseMetaTileEntity.isClientSide() && (aTick & 0x2)==0){ + currentBehaviour=GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1])); + if(aBaseMetaTileEntity.isActive()){ + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2+aBaseMetaTileEntity.getXCoord(); + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY*2+aBaseMetaTileEntity.getYCoord(); + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*2+aBaseMetaTileEntity.getZCoord(); + aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir,yDir,zDir,xDir,yDir,zDir); + } + } + } + + private boolean setCurrentBehaviour(Behaviour newBehaviour){ + boolean changed=currentBehaviour!=newBehaviour; + if(changed){ + setDefaultParametersAndStatuses(); + } + currentBehaviour=newBehaviour; + return changed; + } + + private void setDefaultParametersAndStatuses() { + for (int i = 0; i <= 3; i++) { + setStatusOfParameterIn(i, 0, STATUS_NEUTRAL); + setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); + } + for (int i = 0; i <= 9; i++) { + setStatusOfParameterOut(i, 0, STATUS_NEUTRAL); + setStatusOfParameterOut(i, 1, STATUS_NEUTRAL); + setParameterOut(i, 0, 0); + setParameterOut(i, 1, 0); } } @@ -111,21 +139,20 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkRecipe_EM(ItemStack itemStack) { - Behaviour currentBehaviour = GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(itemStack)); - //TecTech.Logger.info("Looking for "+new Util.TT_ItemStack(itemStack).toString()); - if (currentBehaviour == null) { - setStatusOfParameterIn(0,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - setStatusOfParameterIn(0,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - setStatusOfParameterIn(1,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - setStatusOfParameterIn(2,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - setStatusOfParameterIn(2,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - setStatusOfParameterIn(3,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - setStatusOfParameterIn(3,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + setCurrentBehaviour(GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(itemStack))); + if(currentBehaviour==null){ return false; } //mux input - double[] parameters = new double[]{getParameterIn(0, 0), getParameterIn(0, 1), getParameterIn(1, 0), getParameterIn(1, 1), getParameterIn(2, 0), getParameterIn(2, 1), getParameterIn(3, 0), getParameterIn(3, 1)}; + double[] parameters = new double[]{ + getParameterIn(0, 0), + getParameterIn(0, 1), + getParameterIn(1, 0), + getParameterIn(1, 1), + getParameterIn(2, 0), + getParameterIn(2, 1), + getParameterIn(3, 0), + getParameterIn(3, 1)}; if (!currentBehaviour.setAndCheckParametersOutAndStatuses(this, parameters)) { return false; } @@ -195,7 +222,9 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public void outputAfterRecipe_EM() { - if (outputEM == null) return; + if (setCurrentBehaviour(GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1])))) { + return; + } cElementalInstanceStackMap[] handles = new cElementalInstanceStackMap[6]; int pointer = getParameterInInt(7, 0) - 1; if (pointer >= 0 && pointer < eOutputHatches.size()) { @@ -319,19 +348,88 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } } } + setCurrentBehaviour(GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1]))); + if (currentBehaviour == null) { + setDefaultParametersAndStatuses(); + } else { + double[] parameters = new double[]{ + getParameterIn(0, 0), + getParameterIn(0, 1), + getParameterIn(1, 0), + getParameterIn(1, 1), + getParameterIn(2, 0), + getParameterIn(2, 1), + getParameterIn(3, 0), + getParameterIn(3, 1)}; + currentBehaviour.setAndCheckParametersOutAndStatuses(this,parameters); + } } private static final HashMap<Util.TT_ItemStack, Behaviour> map = new HashMap<>(); public static void registerBehaviour(Behaviour behaviour, ItemStack is) { map.put(new Util.TT_ItemStack(is), behaviour); - TecTech.Logger.info("Registered EM machine behaviour "+behaviour.getClass().getSimpleName()+' '+new Util.TT_ItemStack(is).toString()); + TecTech.LOGGER.info("Registered EM machine behaviour "+behaviour.getClass().getSimpleName()+' '+new Util.TT_ItemStack(is).toString()); + } + + public static abstract class Behaviour { + public Behaviour(){} + + /** + * handle parameters pre recipe, and cyclically + * this shouldn't write to input parameters! only to the provided array and/or output parameters + * @param te this + * @param parametersToCheckAndFix array of 6 parameters to pass to the process method (can be modified) + * this allows to pass different numbers if u want to employ automatic parameter correction here + * @return return true if machine can start with current parameters, false if not + */ + public abstract boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix); + + /** + * do recipe handling + * @param inputs from muxed inputs + * @param checkedAndFixedParameters array passed from previous method! + * @return null if recipe should not start, control object to set machine state and start recipe + */ + public abstract MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters); + + /** + * get input param description, only for 4 first hatches + * @param baseDescr + * @param hatchNo + * @param paramID + */ + protected void getFullLedDescriptionIn(ArrayList<String> baseDescr, int hatchNo, int paramID){} + + /** + * get output param description + * @param baseDescr + * @param hatchNo + * @param paramID + */ + protected void getFullLedDescriptionOut(ArrayList<String> baseDescr, int hatchNo, int paramID){} } - public interface Behaviour { - boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix); + @Override + public ArrayList<String> getFullLedDescriptionIn(int hatchNo, int paramID) { + ArrayList<String> base=super.getFullLedDescriptionIn(hatchNo, paramID); + if(hatchNo>=7){ + base.add("Output mux "+((hatchNo-7)*2+paramID+1)); + }else if(hatchNo>=4){ + base.add("Input mux "+((hatchNo-4)*2+paramID+1)); + }else if(currentBehaviour!=null){ + currentBehaviour.getFullLedDescriptionIn(base,hatchNo,paramID); + } + return base; + } - MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters); + @Override + public ArrayList<String> getFullLedDescriptionOut(int hatchNo, int paramID) { + ArrayList<String> base=super.getFullLedDescriptionOut(hatchNo, paramID); + if(currentBehaviour!=null){ + currentBehaviour.getFullLedDescriptionOut(base,hatchNo,paramID); + } + return base; } private void quantumStuff(boolean shouldExist){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index ded80ee73e..5234de7129 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -9,7 +8,6 @@ import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IColoredTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; @@ -30,7 +28,7 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; /** * Created by Tec on 26.02.2017. */ -public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConnectsToDataPipe { +public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConnectsToDataPipe { private static Textures.BlockIcons.CustomIcon EMpipe; private static Textures.BlockIcons.CustomIcon EMbar; public byte connectionCount = 0; @@ -111,54 +109,49 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConn if ((aTick & 31) == 31) { mConnections = 0; connectionCount = 0; + byte myColor=aBaseMetaTileEntity.getColorization(); if (aBaseMetaTileEntity.getColorization() < 0) { return; } for (byte b0 = 0, b1; b0 < 6; b0++) { b1 = GT_Utility.getOppositeSide(b0); - //if (!aBaseMetaTileEntity.getCoverBehaviorAtSide(b0).alwaysLookConnected(b0, aBaseMetaTileEntity.getCoverIDAtSide(b0), aBaseMetaTileEntity.getCoverDataAtSide(b0), aBaseMetaTileEntity)) { TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(b0); - if (tTileEntity instanceof IColoredTileEntity) { - //if (aBaseMetaTileEntity.getColorization() >= 0) { - byte tColor = ((IColoredTileEntity) tTileEntity).getColorization(); - if (tColor != aBaseMetaTileEntity.getColorization()) { + if (tTileEntity instanceof IConnectsToDataPipe) { + byte tColor = ((IConnectsToDataPipe) tTileEntity).getColorization(); + if (tColor != myColor) { continue; } - //} - } - if (tTileEntity instanceof iConnectsToDataPipe && ((iConnectsToDataPipe) tTileEntity).canConnect(b1)) { - mConnections |= 1 << b0; - connectionCount++; - } else if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof iConnectsToDataPipe) { - if (//((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(b1).alwaysLookConnected(b1, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(b1), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(b1), ((IGregTechTileEntity) tTileEntity)) || - ((iConnectsToDataPipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(b1)) { + if(((IConnectsToDataPipe) tTileEntity).canConnectData(b1)){ mConnections |= 1 << b0; connectionCount++; } + }else if(tTileEntity instanceof IGregTechTileEntity){ + IMetaTileEntity meta=((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if(meta instanceof IConnectsToDataPipe){ + byte tColor = ((IConnectsToDataPipe) meta).getColorization(); + if (tColor != myColor) { + continue; + } + if(((IConnectsToDataPipe) meta).canConnectData(b1)){ + mConnections |= 1 << b0; + connectionCount++; + } + } } - //} - //else { - // mConnections |= (1 << b0); - // if (mOld != mConnections) { - // connectionCount++; - // mOld = mConnections; - // } - //} } } - } else if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) { aBaseMetaTileEntity.issueTextureUpdate(); } } @Override - public boolean canConnect(byte side) { + public boolean canConnectData(byte side) { return true; } @Override - public iConnectsToDataPipe getNext(iConnectsToDataPipe source) { + public IConnectsToDataPipe getNext(IConnectsToDataPipe source) { if (connectionCount != 2) { return null; } @@ -166,18 +159,21 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConn if ((mConnections & 1 << b) == 0) { continue;//if not connected continue } - IGregTechTileEntity next = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(b); - if (next == null) { - continue; - } - IMetaTileEntity meta = next.getMetaTileEntity(); - if (meta instanceof iConnectsToDataPipe && meta != source) { - if (meta instanceof GT_MetaTileEntity_Hatch_InputData) { - return (iConnectsToDataPipe) meta; + TileEntity next = getBaseMetaTileEntity().getTileEntityAtSide(b); + if (next instanceof IConnectsToDataPipe && next != source) { + if(((IConnectsToDataPipe) next).isDataInputFacing(GT_Utility.getOppositeSide(b))){ + return (IConnectsToDataPipe) next; } - if (meta instanceof GT_MetaTileEntity_Pipe_Data && - ((GT_MetaTileEntity_Pipe_Data) meta).connectionCount == 2) { - return (iConnectsToDataPipe) meta; + }else if(next instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) next).getMetaTileEntity(); + if (meta instanceof IConnectsToDataPipe && meta != source) { + if (meta instanceof GT_MetaTileEntity_Pipe_Data && + ((GT_MetaTileEntity_Pipe_Data) meta).connectionCount == 2) { + return (IConnectsToDataPipe) meta; + } + if (((IConnectsToDataPipe) meta).isDataInputFacing(GT_Utility.getOppositeSide(b))) { + return (IConnectsToDataPipe) meta; + } } } } @@ -231,4 +227,14 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConn } return 0.375f; } + + @Override + public boolean isDataInputFacing(byte side) { + return true; + } + + @Override + public byte getColorization() { + return getBaseMetaTileEntity().getColorization(); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index 3d1b5f6fb9..6b7b36fb54 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -29,7 +29,7 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; /** * Created by Tec on 26.02.2017. */ -public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements iConnectsToEMpipe { +public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnectsToElementalPipe { private static Textures.BlockIcons.CustomIcon EMpipe; private static Textures.BlockIcons.CustomIcon EMcandy; public byte connectionCount = 0; @@ -125,12 +125,12 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements iConnec } //} } - if (tTileEntity instanceof iConnectsToEMpipe && ((iConnectsToEMpipe) tTileEntity).canConnect(b1)) { + if (tTileEntity instanceof IConnectsToElementalPipe && ((IConnectsToElementalPipe) tTileEntity).canConnect(b1)) { mConnections |= 1 << b0; connectionCount++; - } else if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof iConnectsToEMpipe) { + } else if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IConnectsToElementalPipe) { if (//((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(b1).alwaysLookConnected(b1, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(b1), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(b1), ((IGregTechTileEntity) tTileEntity)) || - ((iConnectsToEMpipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(b1)) { + ((IConnectsToElementalPipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(b1)) { mConnections |= 1 << b0; connectionCount++; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java new file mode 100644 index 0000000000..6d4be98634 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -0,0 +1,203 @@ +package com.github.technus.tectech.thing.metaTileEntity.pipe; + +import com.github.technus.tectech.CommonValues; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IColoredTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.MetaPipeEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import static gregtech.api.enums.Dyes.MACHINE_METAL; + +public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements IConnectsToEnergyTunnel { + private static Textures.BlockIcons.CustomIcon EMpipe; + private static Textures.BlockIcons.CustomIcon EMcandy; + public byte connectionCount = 0; + + public GT_MetaTileEntity_Pipe_Energy(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 0); + } + + public GT_MetaTileEntity_Pipe_Energy(String aName) { + super(aName, 0); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_Pipe_Energy(mName); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + EMpipe = new Textures.BlockIcons.CustomIcon("iconsets/EM_LASER"); + EMcandy = new Textures.BlockIcons.CustomIcon("iconsets/EM_CANDY"); + super.registerIcons(aBlockIconRegister); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public void loadNBTData(NBTTagCompound nbtTagCompound) { + } + + @Override + public void saveNBTData(NBTTagCompound nbtTagCompound) { + } + + @Override + public boolean renderInside(byte b) { + return false; + } + + @Override + public byte getTileEntityBaseType() { + return 4; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + "Energy tunneling device.", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Not a portal!!!", + EnumChatFormatting.AQUA + "Must be painted to work", + EnumChatFormatting.AQUA + "Do not cross,split or turn" + }; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + onPostTick(aBaseMetaTileEntity, 31); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if ((aTick & 31) == 31) { + mConnections = 0; + connectionCount = 0; + if (aBaseMetaTileEntity.getColorization() < 0) { + return; + } + for (byte b0 = 0, b1; b0 < 6; b0++) { + b1 = GT_Utility.getOppositeSide(b0); + //if (!aBaseMetaTileEntity.getCoverBehaviorAtSide(b0).alwaysLookConnected(b0, aBaseMetaTileEntity.getCoverIDAtSide(b0), aBaseMetaTileEntity.getCoverDataAtSide(b0), aBaseMetaTileEntity)) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(b0); + if (tTileEntity instanceof IColoredTileEntity) { + //if (aBaseMetaTileEntity.getColorization() >= 0) { + byte tColor = ((IColoredTileEntity) tTileEntity).getColorization(); + if (tColor != aBaseMetaTileEntity.getColorization()) { + continue; + } + //} + } + if (tTileEntity instanceof IConnectsToEnergyTunnel && ((IConnectsToEnergyTunnel) tTileEntity).canConnect(b1)) { + mConnections |= 1 << b0; + connectionCount++; + } else if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IConnectsToEnergyTunnel) { + if (//((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(b1).alwaysLookConnected(b1, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(b1), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(b1), ((IGregTechTileEntity) tTileEntity)) || + ((IConnectsToEnergyTunnel) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(b1)) { + mConnections |= 1 << b0; + connectionCount++; + } + } + //} + //else { + // mConnections |= (1 << b0); + // if (mOld != mConnections) { + // connectionCount++; + // mOld = mConnections; + // } + //} + } + } + + } else if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) { + aBaseMetaTileEntity.issueTextureUpdate(); + } + } + + @Override + public boolean canConnect(byte side) { + return true; + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + float tSpace = (1f - 0.5f)/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & 1 << ForgeDirection.DOWN.ordinal()) != 0) { + tSide0 = 0f; + } + if((tConn & 1 << ForgeDirection.UP.ordinal()) != 0) { + tSide1 = 1f; + } + if((tConn & 1 << ForgeDirection.NORTH.ordinal()) != 0) { + tSide2 = 0f; + } + if((tConn & 1 << ForgeDirection.SOUTH.ordinal()) != 0) { + tSide3 = 1f; + } + if((tConn & 1 << ForgeDirection.WEST.ordinal()) != 0) { + tSide4 = 0f; + } + if((tConn & 1 << ForgeDirection.EAST.ordinal()) != 0) { + tSide5 = 1f; + } + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); + } + + @Override + public float getThickNess() { + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) { + return 0.0625F; + } + return 0.5f; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToDataPipe.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToDataPipe.java new file mode 100644 index 0000000000..def0795ba3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToDataPipe.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.thing.metaTileEntity.pipe; + +/** + * Created by Tec on 26.02.2017. + */ +public interface IConnectsToDataPipe { + boolean canConnectData(byte side); + + IConnectsToDataPipe getNext(IConnectsToDataPipe source); + + boolean isDataInputFacing(byte side); + + byte getColorization(); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/iConnectsToDataPipe.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToElementalPipe.java index 67db2ff5bb..5841d3d010 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/iConnectsToDataPipe.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToElementalPipe.java @@ -3,8 +3,6 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; /** * Created by Tec on 26.02.2017. */ -public interface iConnectsToDataPipe { +public interface IConnectsToElementalPipe { boolean canConnect(byte side); - - iConnectsToDataPipe getNext(iConnectsToDataPipe source); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/iConnectsToEMpipe.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToEnergyTunnel.java index d8fd912455..4a720d067e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/iConnectsToEMpipe.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToEnergyTunnel.java @@ -3,6 +3,6 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; /** * Created by Tec on 26.02.2017. */ -public interface iConnectsToEMpipe { +public interface IConnectsToEnergyTunnel { boolean canConnect(byte side); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java new file mode 100644 index 0000000000..f2648d2c2f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java @@ -0,0 +1,205 @@ +package com.github.technus.tectech.thing.metaTileEntity.single; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_BuckConverter; +import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_BuckConverter; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +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.EnumChatFormatting; + +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_POWER_TT; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; + +public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMachineBlock { + private static GT_RenderedTexture BUCK,BUCK_ACTIVE; + public int EUT=0,AMP=0; + + public GT_MetaTileEntity_BuckConverter(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "Electronic voltage regulator"); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_BuckConverter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BuckConverter(mName, mTier, mDescription, mTextures); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + BUCK = new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("iconsets/BUCK")); + BUCK_ACTIVE = new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("iconsets/BUCK_ACTIVE")); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1], aSide == aFacing ? (aActive?BUCK_ACTIVE:BUCK) : + (aSide==GT_Utility.getOppositeSide(aFacing)? + OVERLAYS_ENERGY_IN_POWER_TT[mTier]: + (aActive ? OVERLAYS_ENERGY_OUT_POWER_TT[mTier] : OVERLAYS_ENERGY_IN_POWER_TT[mTier]))}; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return null; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_BuckConverter(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BuckConverter(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("eEUT",EUT); + aNBT.setInteger("eAMP",AMP); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + EUT=aNBT.getInteger("eEUT"); + AMP=aNBT.getInteger("eAMP"); + getBaseMetaTileEntity().setActive((long)AMP*EUT >=0); + } + + @Override + public boolean isSimpleMachine() { + return false; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && (aTick & 0xF) == 0) { + if(aBaseMetaTileEntity.isActive()) { + aBaseMetaTileEntity.decreaseStoredEnergyUnits(CommonValues.V[mTier] >> 2, true); + } + } + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_GENERAL, mDescription, + EnumChatFormatting.BLUE + "Adjustable step down transformer", + EnumChatFormatting.BLUE + "Switching power supply..." + }; + } + + @Override + public boolean isElectric() { + return true; + } + + @Override + public boolean isEnetOutput() { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public boolean isInputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getBackFacing(); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return getBaseMetaTileEntity().isActive() && aSide != getBaseMetaTileEntity().getFrontFacing() && aSide != getBaseMetaTileEntity().getBackFacing(); + } + + @Override + public long maxAmperesIn() { + return 2; + } + + @Override + public long maxAmperesOut() { + return getBaseMetaTileEntity().isActive()?Math.min(Math.abs(AMP),64):0; + } + + @Override + public long maxEUInput() { + return CommonValues.V[mTier]; + } + + @Override + public long maxEUOutput() { + return getBaseMetaTileEntity().isActive()?Math.min(Math.abs(EUT),maxEUInput()):0; + } + + @Override + public long maxEUStore() { + return CommonValues.V[mTier]<<4; + } + + @Override + public long getMinimumStoredEU() { + return CommonValues.V[mTier]<<2; + } + + @Override + public int getProgresstime() { + return (int) getBaseMetaTileEntity().getUniversalEnergyStored(); + } + + @Override + public int maxProgresstime() { + return (int) getBaseMetaTileEntity().getUniversalEnergyCapacity(); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java new file mode 100644 index 0000000000..6612167e5f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java @@ -0,0 +1,318 @@ +package com.github.technus.tectech.thing.metaTileEntity.single; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DataReader; +import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DataReader; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.FontRenderer; +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.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.Reference.MODID; + +/** + * Created by Tec on 23.03.2017. + */ +public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine { + private static final HashMap<Util.TT_ItemStack,ArrayList<DataRender>> RENDER_REGISTRY =new HashMap<>(); + private static GT_RenderedTexture READER_ONLINE, READER_OFFLINE; + + public GT_MetaTileEntity_DataReader(int aID, String aName, String aNameRegional, int aTier) { + super(aID,aName,aNameRegional,aTier,1,"Reads Data Sticks and Orbs",1,1,"dataReader.png",""); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_DataReader(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName,aTier,1,aDescription,aTextures,1,1,"dataReader.png",""); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_DataReader(mName, mTier, mDescription, mTextures); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + READER_ONLINE = new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("iconsets/READER_ONLINE")); + READER_OFFLINE = new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("iconsets/READER_OFFLINE")); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if(aBaseMetaTileEntity.getWorld()==null){ + if(aSide==aFacing){ + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], aActive ? READER_ONLINE : READER_OFFLINE}; + } + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + } + if(aSide==mMainFacing){ + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], aActive ? READER_ONLINE : READER_OFFLINE}; + }else if(aSide==aFacing){ + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return null; + } + + @Override + public int checkRecipe() { + if(getOutputAt(0)!=null){ + return DID_NOT_FIND_RECIPE; + } + ItemStack input=getInputAt(0); + ArrayList<DataRender> renders=getRenders(new Util.TT_ItemStack(input)); + for(DataRender render:renders){ + if(render.canRender(input,mTier)){ + mOutputItems[0]=input.copy(); + input.stackSize-=1; + calculateOverclockedNess(render.getReadingEUt(),render.getReadingTime()); + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + return DID_NOT_FIND_RECIPE; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + aBaseMetaTileEntity.setActive(getOutputAt(0)!=null || mMaxProgresstime>0); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_DataReader(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_DataReader(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : ""); + } + + @Override + public boolean isSimpleMachine() { + return false; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_GENERAL, mDescription, + EnumChatFormatting.BLUE + "Power it up and", + EnumChatFormatting.BLUE + "Put the data storage in" + }; + } + + @Override + public boolean isElectric() { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public boolean isInputFacing(byte aSide) { + return aSide!=getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide!=getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public long maxEUInput() { + return V[mTier]; + } + + @Override + public long maxEUStore() { + return maxEUInput()*16L; + } + + @Override + public long getMinimumStoredEU() { + return maxEUInput()*4L; + } + + public static void addDataRender(Util.TT_ItemStack stack,DataRender render){ + ArrayList<DataRender> renders=RENDER_REGISTRY.get(stack); + if(renders==null){ + RENDER_REGISTRY.put(stack,renders=new ArrayList<>()); + } + if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { + render.loadResources(); + } + renders.add(render); + } + + public static ArrayList<DataRender> getRenders(Util.TT_ItemStack stack){ + return RENDER_REGISTRY.get(stack); + } + + public interface DataRender{ + @SideOnly(Side.CLIENT) + void loadResources(); + @SideOnly(Side.CLIENT) + void initRender(ItemStack itemStack); + @SideOnly(Side.CLIENT) + void renderTooltips(ItemStack itemStack,int mouseX,int mouseY,GT_GUIContainer_DataReader gui); + @SideOnly(Side.CLIENT) + void renderForeground(ItemStack itemStack,int mouseX,int mouseY,GT_GUIContainer_DataReader gui, FontRenderer font); + @SideOnly(Side.CLIENT) + void renderBackgroundOverlay(ItemStack itemStack, int mouseX, int mouseY, int X, int Y, GT_GUIContainer_DataReader gui); + boolean canRender(ItemStack itemStack, byte tier); + int getReadingEUt(); + int getReadingTime(); + } + + public static void run(){ + addDataRender(new Util.TT_ItemStack(ItemList.Tool_DataStick.get(1)),new DataRender() { + @SideOnly(Side.CLIENT) + private ResourceLocation bg; + @SideOnly(Side.CLIENT) + private HashMap<GT_Slot_Holo,ItemStack> slots; + private HashMap<GT_Slot_Holo,ItemStack[]> slots2; + + @Override + @SideOnly(Side.CLIENT) + public void loadResources() { + bg =new ResourceLocation(MODID+":textures/gui/assLineRender.png"); + } + + @Override + public void initRender(ItemStack itemStack) { + slots=new HashMap<>(); + slots2=new HashMap<>(); + + slots.put(new GT_Slot_Holo(null,0,143,55,false,false,1),ItemList.Tool_DataStick.getWithName(1,"Research data")); + ItemStack output=ItemStack.loadItemStackFromNBT(itemStack.stackTagCompound.getCompoundTag("output")); + if(output!=null){ + slots.put(new GT_Slot_Holo(null,0,143,19,false,false,64),output); + } + + for (int i = 0; i < 16; i++) { + ArrayList<ItemStack> array=new ArrayList<>(); + ItemStack input=ItemStack.loadItemStackFromNBT(itemStack.stackTagCompound.getCompoundTag(Integer.toString(i))); + if(input!=null){ + array.add(input); + } + for (int k = 0; k < itemStack.stackTagCompound.getInteger("a"+i); k++) { + input=ItemStack.loadItemStackFromNBT(itemStack.stackTagCompound.getCompoundTag("a" + i + ":" + k)); + if(input!=null){ + array.add(input); + } + } + if(array.size()>0){ + slots2.put(new GT_Slot_Holo(null,0,17+(i&0x3)*18,19+(i>>2)*18,false,false,64), + array.toArray(new ItemStack[0])); + } + } + for (int i = 0; i < 4; i++) { + FluidStack fs=FluidStack.loadFluidStackFromNBT(itemStack.stackTagCompound.getCompoundTag("f"+i)); + if(fs!=null){ + slots.put(new GT_Slot_Holo(null,0,107,19+i*18,false,false,1), + GT_Utility.getFluidDisplayStack(fs, true)); + } + } + } + + @Override + public void renderTooltips(ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui) { + for(Map.Entry<GT_Slot_Holo,ItemStack> entry:slots.entrySet()){ + gui.renderTooltipSimple(mouseX, mouseY, entry.getKey(),entry.getValue()); + } + int time=(int)(System.currentTimeMillis()/2000); + for(Map.Entry<GT_Slot_Holo,ItemStack[]> entry:slots2.entrySet()){ + gui.renderTooltipSimple(mouseX, mouseY, entry.getKey(),entry.getValue()[time%entry.getValue().length]); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void renderForeground(ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui, FontRenderer font) { + int time=itemStack.stackTagCompound.getInteger("time"); + int EUt=itemStack.stackTagCompound.getInteger("eu"); + font.drawString("Assembly Line Recipe", 7, 8, 0x80a0ff); + font.drawString(GT_Utility.trans("152","Total: ") + ((long)time * EUt) + " EU",7,93, 0x80a0ff); + font.drawString(GT_Utility.trans("153","Usage: ") + EUt + " EU/t",7,103, 0x80a0ff); + font.drawString(GT_Utility.trans("154","Voltage: ") + EUt + " EU",7,113, 0x80a0ff); + font.drawString(GT_Utility.trans("155","Amperage: ") + 1 ,7,123, 0x80a0ff); + font.drawString( GT_Utility.trans("158","Time: ")+String.format("%.2f " + GT_Utility.trans("161"," secs"), 0.05F * time), 7,133, 0x80a0ff); + + for(Map.Entry<GT_Slot_Holo,ItemStack> entry:slots.entrySet()){ + gui.renderItemSimple(entry.getKey(),entry.getValue()); + } + time=(int)(System.currentTimeMillis()/2000); + for(Map.Entry<GT_Slot_Holo,ItemStack[]> entry:slots2.entrySet()){ + gui.renderItemSimple(entry.getKey(),entry.getValue()[time%entry.getValue().length]); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void renderBackgroundOverlay(ItemStack itemStack, int mouseX, int mouseY, int X, int Y, GT_GUIContainer_DataReader gui) { + //176/83 + gui.mc.getTextureManager().bindTexture(bg); + gui.drawTexturedModalRect(X,Y,0,0,176, 151); + } + + @Override + public boolean canRender(ItemStack itemStack,byte tier) { + NBTTagCompound nbtTagCompound=itemStack.stackTagCompound; + if(nbtTagCompound!=null && nbtTagCompound.hasKey("output")){ + return true; + } + return false; + } + + @Override + public int getReadingEUt() { + return (int)V[4]; + } + + @Override + public int getReadingTime() { + return 128; + } + }); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java index dd50ba289d..92ac88b180 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java @@ -1,8 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import com.github.technus.tectech.CommonValues; -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.Util; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPowerGenerator; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPowerGenerator; import cpw.mods.fml.relauncher.Side; @@ -20,6 +19,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_POWER_TT; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; + /** * Created by Tec on 23.03.2017. */ @@ -30,6 +33,7 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie public GT_MetaTileEntity_DebugPowerGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 0, "Power from nothing"); + Util.setTier(aTier,this); } public GT_MetaTileEntity_DebugPowerGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -50,7 +54,7 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], aSide != aFacing ? aActive? GT_MetaTileEntity_Hatch_DynamoMulti.overlay[mTier]: GT_MetaTileEntity_Hatch_EnergyMulti.overlay[mTier] : GENNY}; + return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1], aSide != aFacing ? aActive? OVERLAYS_ENERGY_OUT_POWER_TT[mTier]: OVERLAYS_ENERGY_IN_POWER_TT[mTier] : GENNY}; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index 653fcd6a3e..2e2e4f032a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugStructureWriter; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugStructureWriter; import cpw.mods.fml.relauncher.Side; @@ -32,6 +33,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti public GT_MetaTileEntity_DebugStructureWriter(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 0, "Scans Blocks Around"); + Util.setTier(aTier,this); } public GT_MetaTileEntity_DebugStructureWriter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -104,7 +106,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti if (aBaseMetaTileEntity.isAllowedToWork()) { result = StructureWriter(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); for (String s : result) { - TecTech.Logger.info(s); + TecTech.LOGGER.info(s); } aBaseMetaTileEntity.disableWorking(); } @@ -114,7 +116,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { result = StructureWriter(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); for (String s : result) { - TecTech.Logger.info(s); + TecTech.LOGGER.info(s); } } @@ -125,7 +127,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti } aBaseMetaTileEntity.openGUI(aPlayer); //if (TecTechConfig.DEBUG_MODE && aPlayer.getHeldItem() != null) - // TecTech.Logger.info("UnlocalizedName: " + getUniqueIdentifier(aPlayer.getHeldItem())); + // TecTech.LOGGER.info("UnlocalizedName: " + getUniqueIdentifier(aPlayer.getHeldItem())); return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java new file mode 100644 index 0000000000..ca2ff72f20 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java @@ -0,0 +1,225 @@ +package com.github.technus.tectech.thing.metaTileEntity.single; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +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.EnumChatFormatting; + +import static com.github.technus.tectech.CommonValues.RECIPE_AT; + +/** + * Created by Tec on 23.03.2017. + */ +public class GT_MetaTileEntity_OwnerDetector extends GT_MetaTileEntity_TieredMachineBlock { + private static GT_RenderedTexture OWNER_ONLINE,OWNER_OFFLINE; + private String uuid; + private boolean interdimensional=true; + + public GT_MetaTileEntity_OwnerDetector(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "Screwdrive to change mode"); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_OwnerDetector(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_OwnerDetector(mName, mTier, mDescription, mTextures); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + OWNER_ONLINE = new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("iconsets/OWNER_ONLINE")); + OWNER_OFFLINE = new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("iconsets/OWNER_OFFLINE")); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], aActive ? OWNER_ONLINE : OWNER_OFFLINE}; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return null; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setString("eUUID",uuid); + aNBT.setBoolean("eInterDim",interdimensional); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + uuid=aNBT.getString("eUUID"); + interdimensional=aNBT.getBoolean("eInterDim"); + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + if(aBaseMetaTileEntity.isServerSide()) { + if (uuid == null || uuid.length() == 0) { + String name = aBaseMetaTileEntity.getOwnerName(); + if (!("Player".equals(name))) { + uuid= TecTech.proxy.getUUID(name); + } + } + } + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && aTick%20==RECIPE_AT) { + boolean detected=TecTech.proxy.isOnlineUUID(uuid) || (uuid!=null && uuid.length()>0 && TecTech.proxy.isOnlineName(aBaseMetaTileEntity.getOwnerName())); + aBaseMetaTileEntity.setActive(detected); + aBaseMetaTileEntity.setGenericRedstoneOutput(detected); + byte value=(byte)(detected?15:0); + for(byte b=0;b<6;b++){ + aBaseMetaTileEntity.setStrongOutputRedstoneSignal(b,value); + } + } + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + interdimensional^=true; + GT_Utility.sendChatToPlayer(aPlayer,interdimensional?"Running interdimensional scan":"Running local dimension scan"); + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_GENERAL, mDescription, + EnumChatFormatting.BLUE + "Looks for his pa", + EnumChatFormatting.BLUE + "Emits signal when happy" + }; + } + + @Override + public boolean isElectric() { + return false; + } + + @Override + public boolean isEnetOutput() { + return false; + } + + @Override + public boolean isEnetInput() { + return false; + } + + @Override + public boolean isInputFacing(byte aSide) { + return false; + } + + @Override + public boolean isOutputFacing(byte aSide) { + return false; + } + + @Override + public long maxAmperesIn() { + return 0; + } + + @Override + public long maxAmperesOut() { + return 0; + } + + @Override + public long maxEUInput() { + return Integer.MAX_VALUE; + } + + @Override + public long maxEUOutput() { + return 0; + } + + @Override + public long maxEUStore() { + return 0; + } + + @Override + public long getMinimumStoredEU() { + return 0; + } + + @Override + public int getProgresstime() { + return interdimensional?1:0; + } + + @Override + public int maxProgresstime() { + return 1; + } + + @Override + public boolean hasSidedRedstoneOutputBehavior() { + return true; + } + + @Override + public boolean allowGeneralRedstoneOutput() { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java new file mode 100644 index 0000000000..f32fc270e9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java @@ -0,0 +1,74 @@ +package com.github.technus.tectech.thing.metaTileEntity.single; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; +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_Transformer; + +import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.*; + +public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_Transformer { + public GT_MetaTileEntity_WetTransformer(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID,aName,aNameRegional,aTier,aDescription); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_WetTransformer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName,aTier,aDescription,aTextures); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_WetTransformer(mName, mTier, mDescription, mTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[12][17][]; + for (byte b = -1; b < 16; b++) { + rTextures[0][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; + rTextures[1][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; + rTextures[2][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; + rTextures[3][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; + rTextures[4][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; + rTextures[5][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; + rTextures[6][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; + rTextures[7][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; + rTextures[8][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; + rTextures[9][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; + rTextures[10][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; + rTextures[11][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; + } + return rTextures; + } + + @Override + public String[] getDescription() { + return new String[]{mDescription, "Accepts 16A and outputs 64A", CommonValues.TEC_MARK_GENERAL}; + } + + @Override + public long getMinimumStoredEU() { + return V[mTier + 1]; + } + + @Override + public long maxEUStore() { + return 512L + V[mTier + 1] * 128L; + } + + + @Override + public long maxAmperesOut() { + return getBaseMetaTileEntity().isAllowedToWork() ? 64 : 16; + } + + @Override + public long maxAmperesIn() { + return getBaseMetaTileEntity().isAllowedToWork() ? 16 : 64; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_BuckConverter.java new file mode 100644 index 0000000000..2f0325c776 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_BuckConverter.java @@ -0,0 +1,151 @@ +package com.github.technus.tectech.thing.metaTileEntity.single.gui; + +import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_BuckConverter; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_BuckConverter + extends GT_ContainerMetaTile_Machine { + public int EUT=0,AMP=0; + + public GT_Container_BuckConverter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); + } + + @Override + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex < 0) { + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); + if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { + GT_MetaTileEntity_BuckConverter buck = (GT_MetaTileEntity_BuckConverter) mTileEntity.getMetaTileEntity(); + switch (aSlotIndex) { + case 0: + buck.EUT -= aShifthold == 1 ? 512 : 64; + break; + case 1: + buck.EUT /= aShifthold == 1 ? 512 : 64; + break; + case 2: + buck.AMP -= aShifthold == 1 ? 512 : 64; + break; + case 3: + buck.AMP /= aShifthold == 1 ? 512 : 64; + break; + case 4: + buck.EUT -= aShifthold == 1 ? 16 : 1; + break; + case 5: + buck.EUT /= aShifthold == 1 ? 16 : 2; + break; + case 6: + buck.AMP -= aShifthold == 1 ? 16 : 1; + break; + case 7: + buck.AMP /= aShifthold == 1 ? 16 : 2; + break; + case 8: + buck.EUT += aShifthold == 1 ? 512 : 64; + break; + case 9: + buck.EUT *= aShifthold == 1 ? 512 : 64; + break; + case 10: + buck.AMP += aShifthold == 1 ? 512 : 64; + break; + case 11: + buck.AMP *= aShifthold == 1 ? 512 : 64; + break; + case 12: + buck.EUT += aShifthold == 1 ? 16 : 1; + break; + case 13: + buck.EUT *= aShifthold == 1 ? 16 : 2; + break; + case 14: + buck.AMP += aShifthold == 1 ? 16 : 1; + break; + case 15: + buck.AMP *= aShifthold == 1 ? 16 : 2; + break; + default: return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + buck.getBaseMetaTileEntity().setActive((long)AMP*EUT>=0); + return null; + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { + return; + } + + GT_MetaTileEntity_BuckConverter buck = (GT_MetaTileEntity_BuckConverter) mTileEntity.getMetaTileEntity(); + EUT=buck.EUT; + AMP=buck.AMP; + buck.getBaseMetaTileEntity().setActive((long)AMP*EUT>=0); + + for (Object crafter : crafters) { + ICrafting var1 = (ICrafting) crafter; + var1.sendProgressBarUpdate(this, 100, EUT & 0xFFFF); + var1.sendProgressBarUpdate(this, 101, EUT >>> 16); + var1.sendProgressBarUpdate(this, 102, AMP & 0xFFFF); + var1.sendProgressBarUpdate(this, 103, AMP >>> 16); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100: + EUT = EUT & 0xFFFF0000 | par2; + break; + case 101: + EUT = EUT & 0xFFFF | par2 << 16; + break; + case 102: + AMP = AMP & 0xFFFF0000 | par2; + break; + case 103: + AMP = AMP & 0xFFFF | par2 << 16; + break; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java new file mode 100644 index 0000000000..983ee2580e --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java @@ -0,0 +1,100 @@ +package com.github.technus.tectech.thing.metaTileEntity.single.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_Container_BasicTank; +import gregtech.api.gui.GT_Slot_Output; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; + +public class GT_Container_DataReader extends GT_Container_BasicTank { + public boolean mStuttering = false; + + public GT_Container_DataReader(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + //this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 0, 8, 63, false, true, 1)); + //this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 0, 26, 63, false, true, 1)); + //this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 107, 63)); + + int tStartIndex = ((GT_MetaTileEntity_BasicMachine)this.mTileEntity.getMetaTileEntity()).getInputSlot(); + this.addSlotToContainer(new Slot(this.mTileEntity, tStartIndex, 53, 153)); + + tStartIndex = ((GT_MetaTileEntity_BasicMachine)this.mTileEntity.getMetaTileEntity()).getOutputSlot(); + this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, tStartIndex, 107, 153)); + + this.addSlotToContainer(new Slot(this.mTileEntity, 1, 17, 153)); + //this.addSlotToContainer(new Slot(this.mTileEntity, 3, 125, 63)); + //this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex, 53, 63)); + } + + @Override + protected void bindPlayerInventory(InventoryPlayer aInventoryPlayer) { + int i; + for(i = 0; i < 3; ++i) { + for(int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 174 + i * 18)); + } + } + + for(i = 0; i < 9; ++i) { + this.addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 232)); + } + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { + this.mStuttering = ((GT_MetaTileEntity_BasicMachine)this.mTileEntity.getMetaTileEntity()).mStuttering; + + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; + var1.sendProgressBarUpdate(this, 102, this.mStuttering ? 1 : 0); + } + + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch(par1) { + case 102: + this.mStuttering = par2 != 0; + } + + } + + @Override + public int getSlotStartIndex() { + return 0; + } + + @Override + public int getShiftClickStartIndex() { + return 0; + } + + @Override + public int getSlotCount() { + return 3; + } + + @Override + public int getShiftClickSlotCount() { + return 1; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java index 9d7c5293b3..b4cea250ed 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java @@ -118,6 +118,7 @@ public class GT_Container_DebugPowerGenerator GT_MetaTileEntity_DebugPowerGenerator dpg = (GT_MetaTileEntity_DebugPowerGenerator) mTileEntity.getMetaTileEntity(); EUT=dpg.EUT; AMP=dpg.AMP; + dpg.producing =(long)AMP*EUT>=0; for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java new file mode 100644 index 0000000000..946006c8fa --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java @@ -0,0 +1,35 @@ +package com.github.technus.tectech.thing.metaTileEntity.single.gui; + +import com.github.technus.tectech.Util; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +import static com.github.technus.tectech.CommonValues.VN; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +public class GT_GUIContainer_BuckConverter extends GT_GUIContainerMetaTile_Machine { + public GT_GUIContainer_BuckConverter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_BuckConverter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString("Buck Converter", 46, 8, 16448255); + if (mContainer != null) { + GT_Container_BuckConverter buck = (GT_Container_BuckConverter) mContainer; + fontRendererObj.drawString("EUT: " + buck.EUT, 46, 24, 16448255); + fontRendererObj.drawString("TIER: " + VN[Util.getTier(buck.EUT<0?-buck.EUT:buck.EUT)], 46, 32, 16448255); + fontRendererObj.drawString("AMP: " + buck.AMP, 46, 40, 16448255); + fontRendererObj.drawString("SUM: " + (long)buck.AMP*buck.EUT, 46, 48, 16448255); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java new file mode 100644 index 0000000000..97e7601b67 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java @@ -0,0 +1,265 @@ +package com.github.technus.tectech.thing.metaTileEntity.single.gui; + +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DataReader; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import java.util.ArrayList; +import java.util.List; + +public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine { + public final String mName; + public final String mNEI; + public final byte mProgressBarDirection; + public final byte mProgressBarAmount; + private ItemStack stack=null; + + public GT_GUIContainer_DataReader(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, String aNEI) { + this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1); + } + + public GT_GUIContainer_DataReader(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) { + super(new GT_Container_DataReader(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/basicmachines/" + aTextureFile); + this.mProgressBarDirection = aProgressBarDirection; + this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount); + this.mName = aName; + this.mNEI = aNEI; + ySize = 256; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float par3) { + super.drawScreen(mouseX, mouseY, par3); + if (mContainer != null) { + if (mContainer.mTileEntity != null && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { + GT_MetaTileEntity_DataReader reader = (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); + renderDataTooltips(mouseX,mouseY,reader.mTier); + } + } + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { + if (mContainer != null) { + if (mContainer.mTileEntity != null && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { + GT_MetaTileEntity_DataReader reader = (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); + if (renderDataFG(mouseX, mouseY, reader.mTier)) { + return; + } + } + } + fontRendererObj.drawString(mName, 7, 8, 0xfafaff); + } + + protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY) { + super.drawGuiContainerBackgroundLayer(par1, mouseX, mouseY); + 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) { + if (((GT_Container_DataReader) this.mContainer).mStuttering) { + this.drawTexturedModalRect(x + 127, y + 152, 176, 54, 18, 18); + } + + if (this.mContainer.mMaxProgressTime > 0) { + int tSize = this.mProgressBarDirection < 2 ? 20 : 18; + int tProgress = Math.max(1, Math.min(tSize * this.mProgressBarAmount, (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime * tSize * this.mProgressBarAmount / this.mContainer.mMaxProgressTime)) % (tSize + 1); + switch (this.mProgressBarDirection) { + case 0: + this.drawTexturedModalRect(x + 78, y + 152, 176, 0, tProgress, 18); + break; + case 1: + this.drawTexturedModalRect(x + 78 + 20 - tProgress, y + 152, 196 - tProgress, 0, tProgress, 18); + break; + case 2: + this.drawTexturedModalRect(x + 78, y + 152, 176, 0, 20, tProgress); + break; + case 3: + this.drawTexturedModalRect(x + 78, y + 152 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); + break; + case 4: + tProgress = 20 - tProgress; + this.drawTexturedModalRect(x + 78, y + 152, 176, 0, tProgress, 18); + break; + case 5: + tProgress = 20 - tProgress; + this.drawTexturedModalRect(x + 78 + 20 - tProgress, y + 152, 196 - tProgress, 0, tProgress, 18); + break; + case 6: + tProgress = 18 - tProgress; + this.drawTexturedModalRect(x + 78, y + 152, 176, 0, 20, tProgress); + break; + case 7: + tProgress = 18 - tProgress; + this.drawTexturedModalRect(x + 78, y + 152 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); + } + } + } + if (mContainer != null) { + if (mContainer.mTileEntity != null && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { + GT_MetaTileEntity_DataReader reader = (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); + renderDataBG(reader.getStackInSlot(reader.getOutputSlot()), mouseX, mouseY, x, y, reader.mTier); + } + } + } + + private void renderDataBG(ItemStack thing, int mouseX, int mouseY, int x, int y, byte mTier) { + if (thing != null) { + ArrayList<GT_MetaTileEntity_DataReader.DataRender> renders = GT_MetaTileEntity_DataReader.getRenders(new Util.TT_ItemStack(thing)); + for (GT_MetaTileEntity_DataReader.DataRender render : renders) { + if (render.canRender(thing, mTier)) { + if (!GT_Utility.areStacksEqual(stack, thing, false)) { + render.initRender(thing); + } + render.renderBackgroundOverlay(thing, mouseX, mouseY, x, y, this); + break; + } + } + } + stack=thing; + } + + private boolean renderDataFG(int mouseX, int mouseY, byte mTier) { + if(stack==null){ + return false; + } + ArrayList<GT_MetaTileEntity_DataReader.DataRender> renders = GT_MetaTileEntity_DataReader.getRenders(new Util.TT_ItemStack(stack)); + for (GT_MetaTileEntity_DataReader.DataRender render : renders) { + if (render.canRender(stack, mTier)) { + render.renderForeground(stack, mouseX, mouseY, this, fontRendererObj); + return true; + } + } + return false; + } + + private boolean renderDataTooltips(int mouseX, int mouseY, byte mTier) { + if(stack==null){ + return false; + } + ArrayList<GT_MetaTileEntity_DataReader.DataRender> renders = GT_MetaTileEntity_DataReader.getRenders(new Util.TT_ItemStack(stack)); + for (GT_MetaTileEntity_DataReader.DataRender render : renders) { + if (render.canRender(stack, mTier)) { + render.renderTooltips(stack, mouseX, mouseY, this); + return true; + } + } + return false; + } + + public void renderItemSimple(GT_Slot_Holo slot, ItemStack itemStack) { + int x = slot.xDisplayPosition; + int y = slot.yDisplayPosition; + this.zLevel = 100.0F; + itemRender.zLevel = 100.0F; + + if (itemStack == null) { + IIcon iicon = slot.getBackgroundIconIndex(); + + if (iicon != null) { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); // Forge: Blending needs to be enabled for this. + this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); + this.drawTexturedModelRectFromIcon(x, y, iicon, 16, 16); + GL11.glDisable(GL11.GL_BLEND); // Forge: And clean that up + GL11.glEnable(GL11.GL_LIGHTING); + } + } + GL11.glEnable(GL11.GL_DEPTH_TEST); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemStack, x, y); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemStack, x, y); + + itemRender.zLevel = 0.0F; + this.zLevel = 0.0F; + } + + public void renderTooltipSimple(int mouseX, int mouseY, GT_Slot_Holo slot, ItemStack itemStack) { + int x = slot.xDisplayPosition + (width - xSize) / 2; + int y = slot.yDisplayPosition + (height - ySize) / 2; + if (mouseX >= x && mouseY >= y && mouseX <= x+16 && mouseY <= y+16 ) { + List strings=itemStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + if(strings.size()>0){ + strings.set(0,itemStack.getRarity().rarityColor+(String)strings.get(0)); + } + hoveringText(strings, mouseX, mouseY, fontRendererObj); + } + } + + private void hoveringText(List strings, int x, int y, FontRenderer font) { + if (!strings.isEmpty()) { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + //RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + int k = 0; + + for (Object aP_146283_1_ : strings) { + String s = (String) aP_146283_1_; + int l = font.getStringWidth(s); + + if (l > k) { + k = l; + } + } + + int x2 = x + 12; + int y2 = y - 12; + int i1 = 8; + + if (strings.size() > 1) { + i1 += 2 + (strings.size() - 1) * 10; + } + + if (x2 + k > this.width) { + x2 -= 28 + k; + } + + if (y2 + i1 + 6 > this.height) { + y2 = this.height - i1 - 6; + } + + //this.zLevel = 300.0F; + //itemRender.zLevel = 300.0F; + int j1 = 0xf0001040;//bg + this.drawGradientRect(x2 - 3, y2 - 4, x2 + k + 3, y2 - 3, j1, j1); + this.drawGradientRect(x2 - 3, y2 + i1 + 3, x2 + k + 3, y2 + i1 + 4, j1, j1); + this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 + i1 + 3, j1, j1); + this.drawGradientRect(x2 - 4, y2 - 3, x2 - 3, y2 + i1 + 3, j1, j1); + this.drawGradientRect(x2 + k + 3, y2 - 3, x2 + k + 4, y2 + i1 + 3, j1, j1); + int k1 = 0x500040ff;//border bright + int l1 = (k1 & 0xfefefe) >> 1 | k1 & 0xff000000;//border dark??? + this.drawGradientRect(x2 - 3, y2 - 3 + 1, x2 - 3 + 1, y2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(x2 + k + 2, y2 - 3 + 1, x2 + k + 3, y2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 - 3 + 1, k1, k1); + this.drawGradientRect(x2 - 3, y2 + i1 + 2, x2 + k + 3, y2 + i1 + 3, l1, l1); + + for (int i2 = 0; i2 < strings.size(); ++i2) { + String s1 = (String) strings.get(i2); + font.drawStringWithShadow(s1, x2, y2, -1); + + if (i2 == 0) { + y2 += 2; + } + + y2 += 10; + } + + //this.zLevel = 0.0F; + //itemRender.zLevel = 0.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + //RenderHelper.enableStandardItemLighting(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java index 9e6dcf1f09..ad3839e80a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java @@ -5,7 +5,7 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -import static com.github.technus.tectech.Util.VN; +import static com.github.technus.tectech.CommonValues.VN; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; public class GT_GUIContainer_DebugPowerGenerator extends GT_GUIContainerMetaTile_Machine { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java index 340a25b5be..0f64c83d5e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java @@ -20,7 +20,7 @@ public class GT_GUIContainer_DebugStructureWriter extends GT_GUIContainerMetaTil return; } fontRendererObj.drawString(dsw.size ? "Structure size" : "My position", 46, 16, 16448255); - fontRendererObj.drawString(dsw.size ? "(Changing scan size)" : "(Moving origin point)", 46,24, 16448255); + fontRendererObj.drawString(dsw.size ? "(Changing scan size)" : "(Moving origin)", 46,24, 16448255); fontRendererObj.drawString("A: " + dsw.numbers[dsw.size ? 3 : 0], 46, 32, 16448255); fontRendererObj.drawString("B: " + dsw.numbers[dsw.size ? 4 : 1], 46, 40, 16448255); fontRendererObj.drawString("C: " + dsw.numbers[dsw.size ? 5 : 2], 46, 48, 16448255); diff --git a/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java b/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java index e9d8694957..4d66b28ca6 100644 --- a/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java +++ b/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.thing.tileEntity; -import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.Reference; import ic2.api.energy.event.EnergyTileUnloadEvent; import ic2.core.IC2; import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/BUCK.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BUCK.png Binary files differnew file mode 100644 index 0000000000..6aa75eff68 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BUCK.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/BUCK_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BUCK_ACTIVE.png Binary files differnew file mode 100644 index 0000000000..b8333cd837 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/BUCK_ACTIVE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER.png Binary files differindex 910d8cf7cd..187394cf54 100644 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER.png +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE.png Binary files differindex b9efef601a..9d3bfe7284 100644 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE.png +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE_SLAVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE_SLAVE.png Binary files differnew file mode 100644 index 0000000000..e76cd31b5e --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE_SLAVE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE_SLAVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE_SLAVE.png.mcmeta new file mode 100644 index 0000000000..97596ba817 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_ACTIVE_SLAVE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_SLAVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_SLAVE.png Binary files differnew file mode 100644 index 0000000000..58cb0a9573 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_SLAVE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_SLAVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_SLAVE.png.mcmeta new file mode 100644 index 0000000000..5e86a7cd5f --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_COLLIDER_SLAVE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":8 + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_BOTTOM.png Binary files differnew file mode 100644 index 0000000000..af2b3b2037 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_BOTTOM.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_SIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_SIDE.png Binary files differnew file mode 100644 index 0000000000..af2b3b2037 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_SIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_TOP.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_TOP.png Binary files differnew file mode 100644 index 0000000000..af2b3b2037 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_MAXV_TOP.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_BOTTOM.png Binary files differnew file mode 100644 index 0000000000..ad519ab78d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_BOTTOM.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_SIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_SIDE.png Binary files differnew file mode 100644 index 0000000000..ad519ab78d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_SIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_TOP.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_TOP.png Binary files differnew file mode 100644 index 0000000000..ad519ab78d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_OPV_TOP.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_BOTTOM.png Binary files differnew file mode 100644 index 0000000000..27a092adf4 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_BOTTOM.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_SIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_SIDE.png Binary files differnew file mode 100644 index 0000000000..27a092adf4 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_SIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_TOP.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_TOP.png Binary files differnew file mode 100644 index 0000000000..27a092adf4 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UEV_TOP.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_BOTTOM.png Binary files differnew file mode 100644 index 0000000000..a2d780dc32 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_BOTTOM.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_SIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_SIDE.png Binary files differnew file mode 100644 index 0000000000..a2d780dc32 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_SIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_TOP.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_TOP.png Binary files differnew file mode 100644 index 0000000000..a2d780dc32 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UIV_TOP.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_BOTTOM.png Binary files differnew file mode 100644 index 0000000000..a401c3900d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_BOTTOM.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_SIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_SIDE.png Binary files differnew file mode 100644 index 0000000000..a401c3900d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_SIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_TOP.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_TOP.png Binary files differnew file mode 100644 index 0000000000..a401c3900d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UMV_TOP.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_BOTTOM.png Binary files differnew file mode 100644 index 0000000000..a3564826ac --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_BOTTOM.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_SIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_SIDE.png Binary files differnew file mode 100644 index 0000000000..a3564826ac --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_SIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_TOP.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_TOP.png Binary files differnew file mode 100644 index 0000000000..a3564826ac --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_UXV_TOP.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_IN_POWER.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_IN_POWER.png Binary files differnew file mode 100644 index 0000000000..02393fe829 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_IN_POWER.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_OUT_POWER.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_OUT_POWER.png Binary files differnew file mode 100644 index 0000000000..399b32696d --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_OUT_POWER.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OWNER_OFFLINE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OWNER_OFFLINE.png Binary files differnew file mode 100644 index 0000000000..ebf319261a --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OWNER_OFFLINE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OWNER_ONLINE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OWNER_ONLINE.png Binary files differnew file mode 100644 index 0000000000..ba8786cf7e --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OWNER_ONLINE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_OFFLINE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_OFFLINE.png Binary files differnew file mode 100644 index 0000000000..ee04fde165 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_OFFLINE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_OFFLINE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_OFFLINE.png.mcmeta new file mode 100644 index 0000000000..5e86a7cd5f --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_OFFLINE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":8 + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_ONLINE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_ONLINE.png Binary files differnew file mode 100644 index 0000000000..cfb2f8aaa7 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_ONLINE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_ONLINE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_ONLINE.png.mcmeta new file mode 100644 index 0000000000..5e86a7cd5f --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/READER_ONLINE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":8 + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png Binary files differnew file mode 100644 index 0000000000..57a9b85ce9 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png diff --git a/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png b/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png Binary files differindex 95aa09beae..e67f96e34e 100644 --- a/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png +++ b/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 20160069e4..ccb17a8a0c 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -4,8 +4,10 @@ tile.quantumStuff.name=Quantum Stuff item.em.debugContainer.name=Debug EM Container item.em.definitionContainer.name=EM Recipe Hint item.em.definitionScanStorage.name=EM Scan Storage -item.em.debugBuilder.name=Multiblock Machine Blueprint +item.em.constructable.name=Multiblock Machine Blueprint +item.em.frontRotate.name=Front Rotation Scrench item.em.parametrizerMemoryCard.name=Parametrizer Memory Card +item.em.EuMeterGT.name=GT EU meter death.attack.microwaving=%1$s was dehydrated by radiation. death.attack.microwaving.player=%1$s was dehydrated by radiation while fighting %2$s. diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang new file mode 100644 index 0000000000..5359f04e9b --- /dev/null +++ b/src/main/resources/assets/tectech/lang/zh_CN.lang @@ -0,0 +1,13 @@ +itemGroup.TecTech=泛次元钛克科技黑洞研究所 +tile.quantumGlass.name=量子玻璃 +tile.quantumStuff.name=量子物质 +item.em.debugContainer.name=调试用 EM容器 +item.em.definitionContainer.name=EM配方指引 +item.em.debugBuilder.name=多方块机器蓝图 +item.em.parametrizerMemoryCard.name=参量机记忆卡 + +death.attack.microwaving=%1$s 被辐射脱水 +death.attack.microwaving.player=%1$s 在与 %2$s 战斗中被辐射脱水 + +death.attack.elementalPollution=%1$s 被蒸发了 +death.attack.elementalPollution.player=%1$s 在与 %2$s 战斗中被蒸发了 diff --git a/src/main/resources/assets/tectech/sounds.json b/src/main/resources/assets/tectech/sounds.json index c4049f5f02..e23f1c1196 100644 --- a/src/main/resources/assets/tectech/sounds.json +++ b/src/main/resources/assets/tectech/sounds.json @@ -4,6 +4,11 @@ "subtitle": "tectech.subtitle.microwave_ding", "sounds": [{"name": "microwave_ding","stream": false}] }, + "fx_scan": { + "category": "block", + "subtitle": "tectech.subtitle.fx_scan", + "sounds": [{"name": "fx_scan","stream": false}] + }, "fx_alarm": { "category": "block", "subtitle": "tectech.subtitle.fx_alarm", diff --git a/src/main/resources/assets/tectech/sounds/fx_scan.ogg b/src/main/resources/assets/tectech/sounds/fx_scan.ogg Binary files differnew file mode 100644 index 0000000000..0b50e0ca76 --- /dev/null +++ b/src/main/resources/assets/tectech/sounds/fx_scan.ogg diff --git a/src/main/resources/assets/tectech/textures/gui/assLineRender.png b/src/main/resources/assets/tectech/textures/gui/assLineRender.png Binary files differnew file mode 100644 index 0000000000..cc1cd35a7d --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/assLineRender.png diff --git a/src/main/resources/assets/tectech/textures/items/itemDebugBuilder.png b/src/main/resources/assets/tectech/textures/items/itemConstructable.png Binary files differindex dd2b6911c9..dd2b6911c9 100644 --- a/src/main/resources/assets/tectech/textures/items/itemDebugBuilder.png +++ b/src/main/resources/assets/tectech/textures/items/itemConstructable.png diff --git a/src/main/resources/assets/tectech/textures/items/itemEuMeterGT.png b/src/main/resources/assets/tectech/textures/items/itemEuMeterGT.png Binary files differnew file mode 100644 index 0000000000..a3297c5dd4 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/items/itemEuMeterGT.png diff --git a/src/main/resources/assets/tectech/textures/items/itemFrontRotate.png b/src/main/resources/assets/tectech/textures/items/itemFrontRotate.png Binary files differnew file mode 100644 index 0000000000..2d5d2b2ad9 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/items/itemFrontRotate.png diff --git a/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardLocked.png b/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardLocked.png Binary files differindex 0ef5e35895..2bdbb54ab7 100644 --- a/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardLocked.png +++ b/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardLocked.png diff --git a/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardUnlocked.png b/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardUnlocked.png Binary files differindex 1a4c0dc9bc..b61a1725af 100644 --- a/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardUnlocked.png +++ b/src/main/resources/assets/tectech/textures/items/itemParametrizerMemoryCardUnlocked.png diff --git a/src/main/resources/com/github/technus/tectech/elementalMatter/definitions/complex/atom/energyLevels.csv b/src/main/resources/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/energyLevels.csv index 484768d8b7..484768d8b7 100644 --- a/src/main/resources/com/github/technus/tectech/elementalMatter/definitions/complex/atom/energyLevels.csv +++ b/src/main/resources/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/energyLevels.csv diff --git a/src/main/resources/com/github/technus/tectech/elementalMatter/definitions/complex/atom/nuclides.csv b/src/main/resources/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/nuclides.csv index 495aee32bf..495aee32bf 100644 --- a/src/main/resources/com/github/technus/tectech/elementalMatter/definitions/complex/atom/nuclides.csv +++ b/src/main/resources/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/nuclides.csv diff --git a/src/main/resources/com/github/technus/tectech/elementalMatter/definitions/complex/atom/nuclidesTable.csv b/src/main/resources/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/nuclidesTable.csv index 783276227a..783276227a 100644 --- a/src/main/resources/com/github/technus/tectech/elementalMatter/definitions/complex/atom/nuclidesTable.csv +++ b/src/main/resources/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/nuclidesTable.csv |