diff --git a/dependencies.gradle b/dependencies.gradle index 7ede0a91b55..5ca969b15e8 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -34,62 +34,62 @@ * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph */ dependencies { - api("com.github.GTNewHorizons:StructureLib:1.3.5:dev") + api("com.github.GTNewHorizons:StructureLib:1.4.0:dev") api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - api("com.github.GTNewHorizons:NotEnoughItems:2.6.46-GTNH:dev") + api("com.github.GTNewHorizons:NotEnoughItems:2.7.0-GTNH:dev") api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev") - api("com.github.GTNewHorizons:GTNHLib:0.5.20:dev") - api("com.github.GTNewHorizons:ModularUI:1.2.13:dev") - api("com.github.GTNewHorizons:ModularUI2:2.1.14-1.7.10:dev") + api("com.github.GTNewHorizons:GTNHLib:0.5.23:dev") + api("com.github.GTNewHorizons:ModularUI:1.2.17:dev") + api("com.github.GTNewHorizons:ModularUI2:2.1.16-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.2:dev") - api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-477-GTNH:dev") - api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.48-gtnh:dev") + api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-503-GTNH:dev") + api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.0-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") compileOnlyApi('com.github.GTNewHorizons:ThaumicTinkerer:2.10.2:dev') - compileOnlyApi("com.github.GTNewHorizons:Mobs-Info:0.4.6-GTNH:dev") + compileOnlyApi("com.github.GTNewHorizons:Mobs-Info:0.5.0-GTNH:dev") compileOnlyApi("com.github.GTNewHorizons:Navigator:1.0.15:dev") implementation('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive=false} // Required to prevent an older bauble api from Extra Utilities from loading first in the javac classpath compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive=false} - devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.9.1-GTNH:dev") + devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.10.0-GTNH:dev") - compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.54:dev") + compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.57:dev") - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta20:api') { transitive = false } - compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.3:dev") { transitive = false } + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta27:api') { transitive = false } + compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.4:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.39:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.22:dev") { transitive = false } - compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.9.17:dev") { transitive = false } + compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.10.0:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.10.5-GTNH:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.15.15:dev") { transitive = false } compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.27:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:ThaumicBases:1.7.7:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:ThaumicBases:1.8.0:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:EnderCore:0.4.6:dev") { transitive = false } compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.28:dev') { transitive = false } - compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.96-GTNH:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.100-GTNH:dev") { transitive = false } - compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.5-GTNH:dev") { transitive = false } - implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.14-GTNH:dev") + compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.8-GTNH:dev") { transitive = false } + implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.16-GTNH:dev") - compileOnly("com.github.GTNewHorizons:Chisel:2.15.3-GTNH:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Chisel:2.16.0-GTNH:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:Translocators:1.2.1:dev") { transitive = false } compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false } compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false } - implementation("com.github.GTNewHorizons:Hodgepodge:2.5.79:dev") - compileOnly('com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev') { transitive = false } + implementation("com.github.GTNewHorizons:Hodgepodge:2.6.4:dev") + compileOnly('com.github.GTNewHorizons:Botania:1.12.1-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:HoloInventory:2.4.13-GTNH:dev') { transitive = false } compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384") compileOnly rfg.deobf('curse.maven:minefactory-reloaded-66672:2366150') - compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.27-GTNH:dev") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.1-GTNH:dev") {transitive = false} // https://www.curseforge.com/minecraft/mc-mods/advancedsolarpanels compileOnlyApi rfg.deobf('curse.maven:advsolar-362768:2885953') compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.27-GTNH:dev') {transitive = false} - compileOnly("com.github.GTNewHorizons:BloodMagic:1.6.7:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:BloodMagic:1.6.9:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.0:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.7.0-GTNH:dev") { transitive = false } compileOnly rfg.deobf("curse.maven:biomes-o-plenty-220318:2499612") @@ -97,13 +97,13 @@ dependencies { compileOnly('com.github.GTNewHorizons:SC2:2.2.0:dev') {transitive=false} compileOnly('com.github.GTNewHorizons:Binnie:2.4.4:dev') {transitive = false} compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false} - compileOnly('com.github.GTNewHorizons:BlockRenderer6343:1.2.14:dev'){transitive=false} + devOnlyNonPublishable('com.github.GTNewHorizons:BlockRenderer6343:1.2.16:dev'){transitive=false} compileOnly("com.google.auto.value:auto-value-annotations:1.10.1") { transitive = false } annotationProcessor("com.google.auto.value:auto-value:1.10.1") // For testing forestry integration (iApiary, combs, tree growth simulator) - // runtimeOnlyNonPublishable("com.github.GTNewHorizons:ForestryMC:4.9.17:dev") + // runtimeOnlyNonPublishable("com.github.GTNewHorizons:ForestryMC:4.10.0:dev") // runtimeOnlyNonPublishable('com.github.GTNewHorizons:neiaddons:1.16.0:dev') // runtimeOnlyNonPublishable('com.github.GTNewHorizons:MagicBees:2.8.5-GTNH:dev') // runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.4.4:dev') diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c3521197d7..a4b76b9530d 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 09523c0e549..e2847c82004 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index aa612ade0ce..0147a994492 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30' } diff --git a/src/main/java/bartworks/API/recipe/BacterialVatFrontend.java b/src/main/java/bartworks/API/recipe/BacterialVatFrontend.java index afca4274d9f..b310ad576ff 100644 --- a/src/main/java/bartworks/API/recipe/BacterialVatFrontend.java +++ b/src/main/java/bartworks/API/recipe/BacterialVatFrontend.java @@ -11,6 +11,7 @@ import com.gtnewhorizons.modularui.api.math.Alignment; import bartworks.common.tileentities.multis.MTEBioVat; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.recipe.RecipeMapFrontend; @@ -79,12 +80,14 @@ private static class BacterialVatSpecialValueFormatter implements INEISpecialInf @Override public List format(RecipeDisplayInfo recipeInfo) { int[] tSpecialA = MTEBioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue); - String glassTier = StatCollector.translateToLocalFormatted("nei.biovat.0.name", tSpecialA[0]); - String sievert; - if (tSpecialA[2] == 1) { - sievert = StatCollector.translateToLocalFormatted("nei.biovat.1.name", tSpecialA[3]); - } else { - sievert = StatCollector.translateToLocalFormatted("nei.biovat.2.name", tSpecialA[3]); + String glassTier = StatCollector.translateToLocalFormatted("nei.biovat.0.name", GTValues.VN[tSpecialA[0]]); + String sievert = ""; + if (!(tSpecialA[3] == 0)) { + if (tSpecialA[2] == 1) { + sievert = StatCollector.translateToLocalFormatted("nei.biovat.1.name", tSpecialA[3]); + } else { + sievert = StatCollector.translateToLocalFormatted("nei.biovat.2.name", tSpecialA[3]); + } } return Arrays.asList(glassTier, sievert); } diff --git a/src/main/java/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/bartworks/common/commands/ClearCraftingCache.java deleted file mode 100644 index 24f82d90d84..00000000000 --- a/src/main/java/bartworks/common/commands/ClearCraftingCache.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package bartworks.common.commands; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; - -import gregtech.mixin.hooks.BWCoreStaticReplacementMethodes; - -public class ClearCraftingCache extends CommandBase { - - @Override - public String getCommandName() { - return "bwclr"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "bwclr"; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); - sender.addChatMessage(new ChatComponentText("Recipe Cache cleared ")); - } -} diff --git a/src/main/java/bartworks/common/commands/GetWorkingDirectory.java b/src/main/java/bartworks/common/commands/GetWorkingDirectory.java deleted file mode 100644 index b52e067deaf..00000000000 --- a/src/main/java/bartworks/common/commands/GetWorkingDirectory.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package bartworks.common.commands; - -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; - -public class GetWorkingDirectory extends CommandBase { - - @Override - public String getCommandName() { - return "bwgwd"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "bwgwd"; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - sender.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); - } -} diff --git a/src/main/java/bartworks/common/commands/RunGC.java b/src/main/java/bartworks/common/commands/RunGC.java deleted file mode 100644 index 079e4083d8b..00000000000 --- a/src/main/java/bartworks/common/commands/RunGC.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package bartworks.common.commands; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; - -public class RunGC extends CommandBase { - - @Override - public String getCommandName() { - return "bwgc"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "bwgc"; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - Runtime.getRuntime() - .gc(); - sender.addChatMessage(new ChatComponentText("Ran GC!")); - } -} diff --git a/src/main/java/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/bartworks/common/loaders/BioRecipeLoader.java index 84f603a8b3e..8d0f975e3e5 100644 --- a/src/main/java/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/bartworks/common/loaders/BioRecipeLoader.java @@ -15,10 +15,12 @@ import static bartworks.API.recipe.BartWorksRecipeMaps.bacterialVatRecipes; import static bartworks.API.recipe.BartWorksRecipeMaps.bioLabRecipes; +import static bartworks.util.BWRecipes.computeSieverts; import static gregtech.api.enums.Mods.CropsPlusPlus; import static gregtech.api.util.GTRecipeBuilder.MINUTES; import static gregtech.api.util.GTRecipeBuilder.SECONDS; import static gregtech.api.util.GTRecipeBuilder.TICKS; +import static gregtech.api.util.GTRecipeConstants.SIEVERTS; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -130,6 +132,7 @@ public static void registerWaterBasedBacterialVatRecipes() { .special(BioItemList.getPetriDish(BioCultureLoader.CommonYeast)) .fluidInputs(new FluidStack(fluidStack, 100)) .fluidOutputs(FluidRegistry.getFluidStack("potion.ghp", 1)) + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) .duration(17 * SECONDS + 10 * TICKS) .eut(TierEU.RECIPE_EV) .noOptimize() @@ -141,6 +144,7 @@ public static void registerWaterBasedBacterialVatRecipes() { .special(BioItemList.getPetriDish(BioCultureLoader.WhineYeast)) .fluidInputs(new FluidStack(fluidStack, 100)) .fluidOutputs(FluidRegistry.getFluidStack("potion.wine", 12)) + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) .duration(10 * SECONDS) .eut(TierEU.RECIPE_MV) .noOptimize() @@ -154,6 +158,7 @@ public static void registerWaterBasedBacterialVatRecipes() { .special(BioItemList.getPetriDish(BioCultureLoader.BeerYeast)) .fluidInputs(new FluidStack(fluidStack, 100)) .fluidOutputs(FluidRegistry.getFluidStack("potion.beer", 5)) + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) .duration(30 * SECONDS) .eut(TierEU.RECIPE_LV) .noOptimize() @@ -164,6 +169,7 @@ public static void registerWaterBasedBacterialVatRecipes() { .special(BioItemList.getPetriDish(BioCultureLoader.BeerYeast)) .fluidInputs(new FluidStack(fluidStack, 100)) .fluidOutputs(FluidRegistry.getFluidStack("potion.darkbeer", 10)) + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) .duration(30 * SECONDS) .eut(TierEU.RECIPE_LV) .noOptimize() @@ -178,6 +184,7 @@ public static void registerBacterialVatRecipes() { .special(BioItemList.getPetriDish(BioCultureLoader.WhineYeast)) .fluidInputs(FluidRegistry.getFluidStack("potion.grapejuice", 100)) .fluidOutputs(FluidRegistry.getFluidStack("potion.wine", 12)) + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) .duration(20 * SECONDS) .eut(TierEU.RECIPE_LV) .noOptimize() @@ -187,6 +194,7 @@ public static void registerBacterialVatRecipes() { .special(BioItemList.getPetriDish(BioCultureLoader.anaerobicOil)) .fluidInputs(Materials.FermentedBiomass.getFluid(10000)) .fluidOutputs(new FluidStack(FluidLoader.fulvicAcid, 1000)) + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) .duration(2 * MINUTES + 17 * SECONDS + 8 * TICKS) .eut(TierEU.RECIPE_LV) .noOptimize() diff --git a/src/main/java/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index ce03b6eb446..084ed2f9ca1 100644 --- a/src/main/java/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -15,6 +15,7 @@ import static gregtech.api.enums.Mods.UniversalSingularities; import static gregtech.api.util.GTModHandler.getModItem; import static gregtech.api.util.GTRecipeBuilder.SECONDS; +import static gregtech.api.util.GTRecipeBuilder.TICKS; import net.minecraft.item.ItemStack; @@ -25,6 +26,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TierEU; import gregtech.api.util.GTOreDictUnificator; +import gtnhlanth.common.register.WerkstoffMaterialPool; public class ElectricImplosionCompressorRecipes implements Runnable { @@ -49,6 +51,17 @@ public void run() { } } + // Manual Add due to werkstoff material system disconnected from autogeneration + GTValues.RA.stdBuilder() + .itemInputs(WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.dust, 4)) + .itemOutputs( + WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.gem, 3), + GTOreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 12L)) + .duration(1 * TICKS) + .eut(TierEU.RECIPE_UEV) + .noOptimize() + .addTo(electricImplosionCompressorRecipes); + GTValues.RA.stdBuilder() .itemInputs(new ItemStack(highDensityPlutoniumNugget, 5)) .itemOutputs(new ItemStack(highDensityPlutonium, 1)) diff --git a/src/main/java/bartworks/common/loaders/ItemRegistry.java b/src/main/java/bartworks/common/loaders/ItemRegistry.java index a644e6c838e..4117a32563e 100644 --- a/src/main/java/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/bartworks/common/loaders/ItemRegistry.java @@ -386,7 +386,9 @@ public class ItemRegistry { public static ItemStack giantOutputHatch; public static ItemStack humongousInputHatch; + @Deprecated public static ItemStack[][][] TecTechLaserAdditions = new ItemStack[3][4][4]; + @Deprecated public static ItemStack TecTechPipeEnergyLowPower; public static void run() { diff --git a/src/main/java/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/bartworks/common/loaders/RegisterServerCommands.java index 7161eed1d3d..51f2511f7a4 100644 --- a/src/main/java/bartworks/common/loaders/RegisterServerCommands.java +++ b/src/main/java/bartworks/common/loaders/RegisterServerCommands.java @@ -13,10 +13,7 @@ package bartworks.common.loaders; -import bartworks.common.commands.ClearCraftingCache; -import bartworks.common.commands.GetWorkingDirectory; import bartworks.common.commands.PrintRecipeListToFile; -import bartworks.common.commands.RunGC; import bartworks.common.commands.SummonRuin; import cpw.mods.fml.common.event.FMLServerStartingEvent; @@ -25,8 +22,5 @@ public class RegisterServerCommands { public static void registerAll(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); event.registerServerCommand(new PrintRecipeListToFile()); - event.registerServerCommand(new ClearCraftingCache()); - event.registerServerCommand(new GetWorkingDirectory()); - event.registerServerCommand(new RunGC()); } } diff --git a/src/main/java/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/bartworks/common/loaders/recipes/Assembler.java index b96c6653b21..d3bf75812fc 100644 --- a/src/main/java/bartworks/common/loaders/recipes/Assembler.java +++ b/src/main/java/bartworks/common/loaders/recipes/Assembler.java @@ -9,7 +9,6 @@ import net.minecraftforge.fluids.FluidRegistry; import bartworks.common.loaders.ItemRegistry; -import bartworks.system.material.WerkstoffLoader; import goodgenerator.items.GGMaterial; import gregtech.api.GregTechAPI; import gregtech.api.enums.GTValues; @@ -24,19 +23,6 @@ public class Assembler implements Runnable { @Override public void run() { - Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below - Materials.Lead, // ULV - Materials.Tin, // LV - Materials.AnnealedCopper, // MV - Materials.Gold, // HV - Materials.Aluminium, // EV - Materials.Tungsten, // IV - Materials.VanadiumGallium, // LuV - Materials.Naquadah, // ZPM - Materials.NaquadahAlloy, // UV - Materials.SuperconductorUV // UHV - }; - GTValues.RA.stdBuilder() .itemInputs( new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), @@ -134,98 +120,6 @@ public void run() { .eut(TierEU.RECIPE_MV) .addTo(assemblerRecipes); - GTValues.RA.stdBuilder() - .itemInputs( - ItemList.Circuit_Parts_GlassFiber.get(32), - GTOreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 8), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2)) - .itemOutputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - 1, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage())) - .fluidInputs(Materials.Polytetrafluoroethylene.getMolten(72)) - .duration(10 * SECONDS) - .eut(TierEU.RECIPE_EV) - .addTo(assemblerRecipes); - - ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; - ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; - ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2]; - - ItemList[] emitters = { ItemList.Emitter_EV, ItemList.Emitter_IV, ItemList.Emitter_LuV, ItemList.Emitter_ZPM }; - - ItemList[] sensors = { ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, ItemList.Sensor_ZPM }; - - OrePrefixes[] prefixes = { OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, - OrePrefixes.cableGt16 }; - - for (int j = 0; j < 4; j++) { - for (int i = 0; i < 4; i++) { - ItemStack converter = converters[j][i]; - ItemStack eInput = input[j][i]; - ItemStack eDynamo = dynamo[j][i]; - long recipeConsumption = switch (i) { - case 0 -> TierEU.RECIPE_EV; - case 1 -> TierEU.RECIPE_IV; - case 2 -> TierEU.RECIPE_LuV; - case 3 -> TierEU.RECIPE_ZPM; - default -> TierEU.RECIPE_EV; - }; - - int solderingAmount = Math.max(144 * i, 72) * (j + 1); - - GTValues.RA.stdBuilder() - .itemInputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GTOreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - sensors[i].get(2 * (j + 1)), - ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))) - .itemOutputs(converter) - .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1)) * SECONDS) - .eut(recipeConsumption) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - (j + 1) * 16, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GTOreDictUnificator.get(prefixes[j], cables[i + 4], 8), - sensors[i].get(2 * (j + 1)), - ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1))) - .itemOutputs(eInput) - .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1)) * SECONDS) - .eut(recipeConsumption) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - (j + 1) * 16, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GTOreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1))) - .itemOutputs(eDynamo) - .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1) * SECONDS)) - .eut(recipeConsumption) - .addTo(assemblerRecipes); - } - } - GTValues.RA.stdBuilder() .itemInputs( ItemList.Hatch_Input_HV.get(64), diff --git a/src/main/java/bartworks/common/loaders/recipes/CraftingRecipes.java b/src/main/java/bartworks/common/loaders/recipes/CraftingRecipes.java index 5473872dda8..724100826ce 100644 --- a/src/main/java/bartworks/common/loaders/recipes/CraftingRecipes.java +++ b/src/main/java/bartworks/common/loaders/recipes/CraftingRecipes.java @@ -4,13 +4,11 @@ import static gregtech.api.enums.MetaTileEntityIDs.BioLab_HV; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_IV; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_LuV; -import static gregtech.api.enums.MetaTileEntityIDs.BioLab_MAX; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_UEV; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_UHV; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_UIV; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_UMV; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_UV; -import static gregtech.api.enums.MetaTileEntityIDs.BioLab_UXV; import static gregtech.api.enums.MetaTileEntityIDs.BioLab_ZPM; import static gregtech.api.enums.MetaTileEntityIDs.BioVat; import static gregtech.api.enums.MetaTileEntityIDs.LESU; @@ -19,13 +17,7 @@ import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_HV; import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_IV; import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_LuV; -import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_MAX; -import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_UEV; -import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_UHV; -import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_UIV; -import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_UMV; import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_UV; -import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_UXV; import static gregtech.api.enums.MetaTileEntityIDs.RadioHatch_ZPM; import static gregtech.api.enums.MetaTileEntityIDs.Windmill; import static gregtech.api.enums.Mods.IndustrialCraft2; @@ -48,9 +40,9 @@ import bartworks.system.material.Werkstoff; import bartworks.system.material.WerkstoffLoader; import gregtech.api.GregTechAPI; -import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.MaterialsUEVplus; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GTModHandler; @@ -387,10 +379,10 @@ public void run() { GTModHandler.addCraftingRecipe( BioItemList.mBioLabParts[3], RecipeLoader.BITSD, - new Object[] { "SFE", "CPC", "NFN", 'N', - GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', "circuit" + Materials.LuV, - 'F', ItemList.Field_Generator_LuV.get(1L), 'E', ItemList.Emitter_LuV.get(1L), 'S', - ItemList.Sensor_LuV.get(1L), 'P', WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 1), }); + new Object[] { "SFE", "PCP", "NFN", 'N', + GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'C', "circuit" + Materials.EV, + 'F', ItemList.Field_Generator_EV.get(1L), 'E', ItemList.Emitter_EV.get(1L), 'S', + ItemList.Sensor_EV.get(1L), 'P', GTOreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), }); // ClonalCellularSynthesisModule GTModHandler.addCraftingRecipe( @@ -408,58 +400,203 @@ public void run() { "circuit" + Materials.EV, 'K', GTOreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), 'H', ItemList.MACHINE_HULLS[3].get(1L) }); - ItemStack[] Pistons2 = { ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), - ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), - ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L) }; - ItemStack[] BioLab2 = new ItemStack[GTValues.VN.length - 3]; - ItemStack[] RadioHatch2 = new ItemStack[GTValues.VN.length - 3]; - Materials[] cables2 = { Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, - Materials.Naquadah, Materials.NaquadahAlloy, Materials.SuperconductorUHV }; - Materials[] hulls2 = { Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, - Materials.Iridium, Materials.Osmium, Materials.Naquadah }; - Materials[] wireMat2 = { Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, - Materials.NaquadahAlloy, Materials.SuperconductorUHV }; - Materials[] circuits2 = { Materials.HV, Materials.EV, Materials.IV, Materials.LuV, Materials.ZPM, - Materials.UV }; - - int[] BioLab = new int[] { BioLab_HV.ID, BioLab_EV.ID, BioLab_IV.ID, BioLab_LuV.ID, BioLab_ZPM.ID, BioLab_UV.ID, - BioLab_UHV.ID, BioLab_UEV.ID, BioLab_UIV.ID, BioLab_UMV.ID, BioLab_UXV.ID, BioLab_MAX.ID }; - int[] RadioHatch = new int[] { RadioHatch_HV.ID, RadioHatch_EV.ID, RadioHatch_IV.ID, RadioHatch_LuV.ID, - RadioHatch_ZPM.ID, RadioHatch_UV.ID, RadioHatch_UHV.ID, RadioHatch_UEV.ID, RadioHatch_UIV.ID, - RadioHatch_UMV.ID, RadioHatch_UXV.ID, RadioHatch_MAX.ID }; - - for (int i = 3; i < GTValues.VN.length - 1; i++) { - BioLab2[i - 3] = new MTEBioLab( - BioLab[i - 3], - "bw.biolab" + GTValues.VN[i], - GTValues.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), - i).getStackForm(1L); - RadioHatch2[i - 3] = new GT_MetaTileEntity_RadioHatch( - RadioHatch[i - 3], - "bw.radiohatch" + GTValues.VN[i], - GTValues.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), - i).getStackForm(1L); - try { - ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GTModHandler.addCraftingRecipe( - BioLab2[i - 3], - RecipeLoader.BITSD, - new Object[] { "PFP", "WCW", "OGO", 'F', - GTOreDictUnificator.get(OrePrefixes.frameGt, hulls2[i - 3], 1L), 'W', - GTOreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[i - 3], 1L), 'P', - GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', - GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', - "circuit" + circuits2[i - 3], 'C', machinehull }); - GTModHandler.addCraftingRecipe( - RadioHatch2[i - 3], - RecipeLoader.BITSD, - new Object[] { "DPD", "DCD", "DKD", 'D', - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull, 'K', - GTOreDictUnificator.get(OrePrefixes.cableGt08, cables2[i - 3], 1L), 'P', Pistons2[i - 3] }); - } catch (ArrayIndexOutOfBoundsException ignored) { + // BioLabs + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_HV.ID, "bw.biolabHV", StatCollector.translateToLocal("tile.biolab.name"), 3) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.StainlessSteel, 1L), 'W', + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.Kanthal, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.HV, 1L), 'C', + ItemList.MACHINE_HULLS[3].get(1L) }); - } - } + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_EV.ID, "bw.biolabEV", StatCollector.translateToLocal("tile.biolab.name"), 4) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Titanium, 1L), 'W', + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.Nichrome, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.EV, 1L), 'C', + ItemList.MACHINE_HULLS[4].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_IV.ID, "bw.biolabIV", StatCollector.translateToLocal("tile.biolab.name"), 5) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1L), 'W', + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.TPV, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.IV, 1L), 'C', + ItemList.MACHINE_HULLS[5].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_LuV.ID, "bw.biolabLuV", StatCollector.translateToLocal("tile.biolab.name"), 6) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Chrome, 1L), + 'W', GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.HSSG, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.LuV, 1L), 'C', + ItemList.MACHINE_HULLS[6].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_ZPM.ID, "bw.biolabZPM", StatCollector.translateToLocal("tile.biolab.name"), 7) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1L), 'W', + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.ZPM, 1L), 'C', + ItemList.MACHINE_HULLS[7].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_UV.ID, "bw.biolabUV", StatCollector.translateToLocal("tile.biolab.name"), 8) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Osmium, 1L), + 'W', GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UV, 1L), 'C', + ItemList.MACHINE_HULLS[8].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_UHV.ID, "bw.biolabUHV", StatCollector.translateToLocal("tile.biolab.name"), 9) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 1L), 'W', + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.ElectrumFlux, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UHV, 1L), 'C', + ItemList.MACHINE_HULLS[9].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_UEV.ID, "bw.biolabUEV", StatCollector.translateToLocal("tile.biolab.name"), 10) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Bedrockium, 1L), 'W', + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.DraconiumAwakened, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UEV, 1L), 'C', + ItemList.MACHINE_HULLS[10].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_UIV.ID, "bw.biolabUIV", StatCollector.translateToLocal("tile.biolab.name"), 11) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.TranscendentMetal, 1L), 'W', + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.Infinity, 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 1L), 'C', + ItemList.MACHINE_HULLS[11].get(1L) }); + + GTModHandler.addCraftingRecipe( + new MTEBioLab(BioLab_UMV.ID, "bw.biolabUMV", StatCollector.translateToLocal("tile.biolab.name"), 12) + .getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.SpaceTime, 1L), 'W', + GTOreDictUnificator.get("wireGt01Hypogen", 1L), 'P', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UMV, 1L), 'C', + ItemList.MACHINE_HULLS[12].get(1L) }); + + // Radio Hatches + GTModHandler.addCraftingRecipe( + new GT_MetaTileEntity_RadioHatch( + RadioHatch_HV.ID, + "bw.radiohatchHV", + "HV " + StatCollector.translateToLocal("tile.radiohatch.name"), + 3).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', + ItemList.MACHINE_HULLS[3].get(1L), 'K', + GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.Gold, 1L), 'P', + ItemList.Electric_Piston_HV.get(1) }); + + GTModHandler.addCraftingRecipe( + new GT_MetaTileEntity_RadioHatch( + RadioHatch_EV.ID, + "bw.radiohatchEV", + "EV " + StatCollector.translateToLocal("tile.radiohatch.name"), + 4).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', + ItemList.MACHINE_HULLS[4].get(1L), 'K', + GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.Aluminium, 1L), 'P', + ItemList.Electric_Piston_EV.get(1) }); + + GTModHandler.addCraftingRecipe( + new GT_MetaTileEntity_RadioHatch( + RadioHatch_IV.ID, + "bw.radiohatchIV", + "IV " + StatCollector.translateToLocal("tile.radiohatch.name"), + 5).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', + ItemList.MACHINE_HULLS[5].get(1L), 'K', + GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.Tungsten, 1L), 'P', + ItemList.Electric_Piston_IV.get(1) }); + + GTModHandler.addCraftingRecipe( + new GT_MetaTileEntity_RadioHatch( + RadioHatch_LuV.ID, + "bw.radiohatchLuV", + "LuV " + StatCollector.translateToLocal("tile.radiohatch.name"), + 6).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', + ItemList.MACHINE_HULLS[6].get(1L), 'K', + GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.VanadiumGallium, 1L), 'P', + ItemList.Electric_Piston_LuV.get(1) }); + + GTModHandler.addCraftingRecipe( + new GT_MetaTileEntity_RadioHatch( + RadioHatch_ZPM.ID, + "bw.radiohatchZPM", + "ZPM " + StatCollector.translateToLocal("tile.radiohatch.name"), + 7).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', + ItemList.MACHINE_HULLS[7].get(1L), 'K', + GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.Naquadah, 1L), 'P', + ItemList.Electric_Piston_ZPM.get(1) }); + + GTModHandler.addCraftingRecipe( + new GT_MetaTileEntity_RadioHatch( + RadioHatch_UV.ID, + "bw.radiohatchUV", + "UV " + StatCollector.translateToLocal("tile.radiohatch.name"), + 8).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', + ItemList.MACHINE_HULLS[8].get(1L), 'K', + GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.NaquadahAlloy, 1L), 'P', + ItemList.Electric_Piston_UV.get(1) }); } } diff --git a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java index 54810bcf6d9..058106000d9 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java @@ -129,7 +129,7 @@ public class MTECircuitAssemblyLine extends MTEEnhancedMultiBlockBase getStructureDefinition() { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Circuit Assembler") + tt.addMachineType("Circuit Assembler, CAL") .addInfo("Change Mode with Screwdriver") .addInfo("Does not lose efficiency when overclocked") .addSeparator() @@ -178,7 +178,7 @@ protected MultiblockTooltipBuilder createTooltip() { "Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing") .addStructureInfo( "Layer 2 - " + getColoredTierNameFromTier((byte) 4) - + "+ Tier Glass, Assembling Line Casing, " + + "+ Tier Glass, Assembly Line Casing, " + getColoredTierNameFromTier((byte) 4) + "+ Tier Glass") .addStructureInfo("Layer 3 - Grate Machine Casing") diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java index 60a69abbf19..6ae351cadf9 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java @@ -75,7 +75,7 @@ protected MultiblockTooltipBuilder createTooltip() { String casings = this.getCasingBlockItem() .get(0) .getDisplayName(); - tt.addMachineType("Geothermal Heat Pump") + tt.addMachineType("Geothermal Heat Pump, DEHP") .addInfo("Consumes " + TierEU.RECIPE_HV + "EU/t") .addInfo("Has 2 Modes, use the Screwdriver to change them:"); @@ -87,8 +87,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addInfo("Each maintenance issue lowers output efficiency by 10%") .addInfo("Explodes when it runs out of Distilled Water/Coolant"); - tt.addSeparator() - .beginStructureBlock(3, 7, 3, false) + tt.beginStructureBlock(3, 7, 3, false) .addController("Front bottom") .addOtherStructurePart(casings, "form the 3x1x3 Base") .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java b/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java index ff6c0a4eb9d..c69d67a006d 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java @@ -261,7 +261,7 @@ protected IAlignmentLimits getInitialAlignmentLimits() { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Implosion Compressor") + tt.addMachineType("Implosion Compressor, EIC") .addInfo("Explosions are fun") .addInfo("Uses electricity instead of Explosives") .addInfo("Can parallel up to 4^(Tier - 1)") diff --git a/src/main/java/bartworks/common/tileentities/multis/MTELESU.java b/src/main/java/bartworks/common/tileentities/multis/MTELESU.java index e2c393f889a..f51548253f4 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTELESU.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTELESU.java @@ -31,6 +31,7 @@ import com.gtnewhorizons.modularui.api.NumberFormatMUI; import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; @@ -533,6 +534,7 @@ private void drawTexts(DynamicPositionedColumn screenElements) { screenElements.widget( new TextWidget().setStringSupplier(() -> "EU: " + numberFormat.format(this.clientEU)) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( new FakeSyncWidget.LongSyncer( @@ -541,6 +543,7 @@ private void drawTexts(DynamicPositionedColumn screenElements) { val -> clientEU = val)) .widget( new TextWidget().setStringSupplier(() -> "MAX: " + numberFormat.format(clientMaxEU)) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( new FakeSyncWidget.LongSyncer( @@ -552,6 +555,7 @@ private void drawTexts(DynamicPositionedColumn screenElements) { val -> clientMaxEU = val)) .widget( new TextWidget().setStringSupplier(() -> "MAX EU/t IN: " + numberFormat.format(clientMaxIn)) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( new FakeSyncWidget.LongSyncer( @@ -560,6 +564,7 @@ private void drawTexts(DynamicPositionedColumn screenElements) { val -> clientMaxIn = val)) .widget( new TextWidget().setStringSupplier(() -> "EU/t OUT: " + numberFormat.format(clientMaxOut)) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( new FakeSyncWidget.LongSyncer( @@ -568,6 +573,7 @@ private void drawTexts(DynamicPositionedColumn screenElements) { val -> clientMaxOut = val)) .widget( new TextWidget().setStringSupplier(() -> "AMP/t IN/OUT: " + numberFormat.format(clientAmps)) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( new FakeSyncWidget.LongSyncer( @@ -575,10 +581,12 @@ private void drawTexts(DynamicPositionedColumn screenElements) { .getInputAmperage(), val -> clientAmps = val)) .widget( - new TextWidget(Text.localised("tooltip.LESU.0.name")).setDefaultColor(Color.YELLOW.getRGB()) + new TextWidget(Text.localised("tooltip.LESU.0.name")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(Color.YELLOW.getRGB()) .setEnabled(widget -> this.maxEUStore() >= Long.MAX_VALUE - 1)) .widget( - new TextWidget(Text.localised("tooltip.LESU.1.name")).setDefaultColor(Color.RED.getRGB()) + new TextWidget(Text.localised("tooltip.LESU.1.name")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(Color.RED.getRGB()) .setEnabled( widget -> !this.getBaseMetaTileEntity() .isActive())); diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEWindmill.java b/src/main/java/bartworks/common/tileentities/multis/MTEWindmill.java index b6636f97c3c..61f925c5e20 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEWindmill.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEWindmill.java @@ -50,6 +50,7 @@ import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; @@ -617,7 +618,7 @@ else if (System.currentTimeMillis() / DIVIDER % 40 == 0) val -> this.getBaseMetaTileEntity() .setActive(val))) .widget( - new TextWidget(GTUtility.trans("138", "Incomplete Structure.")) + new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setTextAlignment(Alignment.CenterLeft) .setDefaultColor(this.COLOR_TEXT_WHITE.get()) .setMaxWidth(150) .setEnabled(widget -> !this.mMachine) diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java index c783ef31786..689966aee46 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java @@ -169,7 +169,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Blast Furnace") + tt.addMachineType("Blast Furnace, MEBF") .addParallelInfo(Configuration.Multiblocks.megaMachinesMax) .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java index d3d072cbcc7..14e59081604 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java @@ -69,7 +69,7 @@ public MTEMegaChemicalReactor(String aName) { @Override public MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Chemical Reactor") + tt.addMachineType("Chemical Reactor, MCR") .addInfo("What molecule do you want to synthesize ?") .addInfo("Or you want to replace something in this molecule ?") .addParallelInfo(Configuration.Multiblocks.megaMachinesMax) diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java index 4c3199f33f2..95ddef6b8af 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java @@ -258,7 +258,7 @@ public int getRecipeCatalystPriority() { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Distillery") + tt.addMachineType("Distillery, MDT") .addParallelInfo(Configuration.Multiblocks.megaMachinesMax) .addInfo("Fluids are only put out at the correct height") .addInfo("The correct height equals the slot number in the NEI recipe") diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java index 092e62850cd..30beb268d07 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java @@ -149,7 +149,7 @@ public MTEMegaOilCracker(String aName) { @Override public MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Cracker") + tt.addMachineType("Cracker, MOC") .addParallelInfo(Configuration.Multiblocks.megaMachinesMax) .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") .addInfo("More efficient than the Chemical Reactor") diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java index 5734faeb5e8..c9138789363 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java @@ -233,7 +233,7 @@ public FluidStack getStack() { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Vacuum Freezer") + tt.addMachineType("Vacuum Freezer, MVF") .addInfo("Cools hot ingots and cells") .addParallelInfo(Configuration.Multiblocks.megaMachinesMax) .addTecTechHatchInfo() diff --git a/src/main/java/bartworks/common/tileentities/tiered/MTEBioLab.java b/src/main/java/bartworks/common/tileentities/tiered/MTEBioLab.java index 992c7188fa2..0c9d86d8d2f 100644 --- a/src/main/java/bartworks/common/tileentities/tiered/MTEBioLab.java +++ b/src/main/java/bartworks/common/tileentities/tiered/MTEBioLab.java @@ -325,7 +325,7 @@ public int checkRecipe(boolean skipOC) { BioCulture bioCulture = BioCulture .getBioCultureFromNBTTag(this.mInventory[this.getInputSlot()].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) return MTEBasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < 3; i++) { if (this.mInventory[this.getInputSlot() + i] != null) @@ -338,7 +338,7 @@ public int checkRecipe(boolean skipOC) { } this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); this.calculateOverclockedNess( - BWUtil.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), + BWUtil.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); return MTEBasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } diff --git a/src/main/java/bartworks/system/material/WerkstoffLoader.java b/src/main/java/bartworks/system/material/WerkstoffLoader.java index 5b485b99053..cc3fdd749e5 100644 --- a/src/main/java/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/bartworks/system/material/WerkstoffLoader.java @@ -127,7 +127,6 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Element; import gregtech.api.enums.FluidState; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; @@ -703,6 +702,7 @@ public static void setUp() { .onlyDust() .addMetalItems() .addMolten() + .addMetalCraftingSolidifierRecipes() .enforceUnification(), 39, TextureSet.SET_METALLIC @@ -1050,6 +1050,8 @@ public static void setUp() { .addMolten() .addMetalItems() .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .enforceUnification(), 64, TextureSet.SET_METALLIC @@ -1238,6 +1240,8 @@ public static void setUp() { .addMetalItems() .addMolten() .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .enforceUnification(), 78, TextureSet.SET_METALLIC); @@ -1347,7 +1351,9 @@ public static void setUp() { .addMixerRecipes((short) 1) .addSimpleMetalWorkingItems() .addCraftingMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), + .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), 88, TextureSet.SET_METALLIC, new Pair<>(Materials.Palladium, 3), @@ -1383,7 +1389,9 @@ public static void setUp() { .addMixerRecipes((short) 1) .addSimpleMetalWorkingItems() .addCraftingMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), + .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), 90, TextureSet.SET_METALLIC, new Pair<>(WerkstoffLoader.Ruthenium, 2), @@ -1413,7 +1421,9 @@ public static void setUp() { .addMixerRecipes() .addSimpleMetalWorkingItems() .addCraftingMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), + .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), 92, TextureSet.SET_SHINY, new Pair<>(Materials.TungstenSteel, 12), @@ -1474,7 +1484,9 @@ public static void setUp() { .addCraftingMetalWorkingItems() .addMolten() .addSimpleMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), + .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), 96, TextureSet.SET_METALLIC, new Pair<>(Materials.Steel, 2), @@ -1571,6 +1583,55 @@ public static void setUp() { 104, TextureSet.SET_SHINY); + // Extracted from GalaxySpace + public static final Werkstoff LiquidHelium = new Werkstoff( + new short[] { 210, 230, 250 }, + "Liquid Helium", + "He", + new Werkstoff.Stats().setBoilingPoint(4) + .setGas(false) + .setMeltingPoint(1), + Werkstoff.Types.MATERIAL, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 11500, + TextureSet.SET_FLUID); + + public static final Werkstoff HafniumCarbide = new Werkstoff( + new short[] { 125, 135, 125 }, + "Hafnium Carbide", + "HfC", + new Werkstoff.Stats().setMass(192), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust(), + 11501, + TextureSet.SET_METALLIC); + + public static final Werkstoff TantalumCarbideHafniumCarbideMixture = new Werkstoff( + new short[] { 75, 85, 75 }, + "Tantalum Carbide / Hafnium Carbide Mixture", + subscriptNumbers("(TaC)4HfC"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust(), + 11502, + TextureSet.SET_METALLIC); + + public static final Werkstoff TantalumHafniumCarbide = new Werkstoff( + new short[] { 80, 90, 80 }, + "Tantalum Hafnium Carbide", + subscriptNumbers("Ta4HfC5"), + new Werkstoff.Stats().setMass(192) + .setMass(962) + .setMeltingPoint(4263), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust() + .addMetalItems() + .addMolten() + .setBlacklist(OrePrefixes.plate), + 11503, + TextureSet.SET_METALLIC); + public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); public static HashBiMap molten = HashBiMap.create(); @@ -1986,28 +2047,6 @@ private static void runGTItemDataRegistrator() { } } addFakeItemDataToInWorldBlocksAndCleanUpFakeData(); - addVanillaCasingsToGTOreDictUnificator(); - } - - public static void addVanillaCasingsToGTOreDictUnificator() { - GTOreDictUnificator - .addAssociation(OrePrefixes.blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), false); - GTOreDictUnificator - .addAssociation(OrePrefixes.blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); - GTOreDictUnificator - .addAssociation(OrePrefixes.blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); - GTOreDictUnificator - .addAssociation(OrePrefixes.blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); - GTOreDictUnificator.addAssociation( - OrePrefixes.blockCasing, - Materials.TungstenSteel, - ItemList.Casing_RobustTungstenSteel.get(1L), - false); - GTOreDictUnificator.addAssociation( - OrePrefixes.blockCasing, - Materials.Polytetrafluoroethylene, - ItemList.Casing_Chemically_Inert.get(1L), - false); } /** diff --git a/src/main/java/bartworks/system/material/gtenhancement/PlatinumSludgeOverHaul.java b/src/main/java/bartworks/system/material/gtenhancement/PlatinumSludgeOverHaul.java index e6582dd7b17..df806929112 100644 --- a/src/main/java/bartworks/system/material/gtenhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/bartworks/system/material/gtenhancement/PlatinumSludgeOverHaul.java @@ -372,18 +372,7 @@ private static void runHelperrecipes() { .duration(1200) .eut(30) .addTo(multiblockChemicalReactorRecipes); - // transitional recipe. to be removed in 2.8.0 and onwards - GTValues.RA.stdBuilder() - .itemInputs(GTUtility.getIntegratedCircuit(2)) - .itemOutputs(PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4)) - .fluidInputs(PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600)) - .fluidOutputs( - PDAmmonia.getFluidOrGas(3600), - Materials.NitrogenDioxide.getGas(9000), - Materials.DilutedSulfuricAcid.getFluid(9000)) - .duration(1400) - .eut(240) - .addTo(multiblockChemicalReactorRecipes); + GTValues.RA.stdBuilder() .itemInputs(GTUtility.getIntegratedCircuit(3)) .itemOutputs(PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4)) diff --git a/src/main/java/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/bartworks/system/material/processingLoaders/AdditionalRecipes.java index ae2078137c8..f76877734ff 100644 --- a/src/main/java/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -15,6 +15,7 @@ import static bartworks.API.recipe.BartWorksRecipeMaps.bacterialVatRecipes; import static bartworks.API.recipe.BartWorksRecipeMaps.bioLabRecipes; +import static bartworks.util.BWRecipes.computeSieverts; import static gregtech.api.enums.Mods.Gendustry; import static gregtech.api.enums.OrePrefixes.bolt; import static gregtech.api.enums.OrePrefixes.crushed; @@ -48,6 +49,7 @@ import static gregtech.api.util.GTRecipeConstants.COIL_HEAT; import static gregtech.api.util.GTRecipeConstants.FUEL_VALUE; import static gregtech.api.util.GTRecipeConstants.FUSION_THRESHOLD; +import static gregtech.api.util.GTRecipeConstants.SIEVERTS; import static gregtech.api.util.GTRecipeConstants.UniversalChemical; import java.util.Arrays; @@ -167,6 +169,7 @@ private static void runBWRecipes() { } } + long energyUsageWithTransformModule = 1; for (ItemStack stack : BioItemList.getAllPetriDishes()) { BioData DNA = BioData.getBioDataFromNBTTag( stack.getTagCompound() @@ -175,6 +178,11 @@ private static void runBWRecipes() { stack.getTagCompound() .getCompoundTag("Plasmid")); if (!Objects.equals(DNA.getName(), Plasmid.getName())) { + if (DNA.getName() == "TCetiEis Fucus Serratus") { + energyUsageWithTransformModule = TierEU.RECIPE_LuV; + } else if (DNA.getName() == "Escherichia koli") { + energyUsageWithTransformModule = TierEU.RECIPE_EV; + } GTValues.RA.stdBuilder() .itemInputs( BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), @@ -185,7 +193,7 @@ private static void runBWRecipes() { .fluidInputs(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) .special(BioItemList.mBioLabParts[3]) .duration(25 * SECONDS) - .eut(TierEU.RECIPE_LuV) + .eut(energyUsageWithTransformModule) .ignoreCollision() .fake() .addTo(bioLabRecipes); @@ -224,6 +232,7 @@ private static void runBWRecipes() { .special(BioItemList.getPetriDish(bioCulture)) .fluidInputs(fluidStack) .fluidOutputs(new FluidStack(bioCulture.getFluid(), 10)) + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) .duration(50 * SECONDS) .eut(TierEU.RECIPE_MV) .addTo(bacterialVatRecipes); diff --git a/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 5b24b1e6ee3..e9f85b17009 100644 --- a/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -43,6 +43,7 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.recipe.RecipeCategories; import gregtech.api.recipe.RecipeMaps; +import gregtech.api.util.GTLog; import gregtech.api.util.GTModHandler; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipe; @@ -61,153 +62,168 @@ public void run(Werkstoff werkstoff) { || werkstoff.getStats() .isCentrifuge()) && !werkstoff.hasItemType(dust)) { - List flOutputs = new ArrayList<>(); - List stOutputs = new ArrayList<>(); - HashMap> tracker = new HashMap<>(); - int cells = 0; - for (Pair container : werkstoff.getContents() + + if (werkstoff.getContents() .getValue() - .toArray(new Pair[0])) { - if (container.getKey() instanceof Materials) { - if ((((Materials) container.getKey()).hasCorrespondingGas() - || ((Materials) container.getKey()).hasCorrespondingFluid() - || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) - && ((Materials) container.getKey()).getDust(0) == null) { - FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getFluid(1000L * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { + .size() > 0) { + + List flOutputs = new ArrayList<>(); + List stOutputs = new ArrayList<>(); + HashMap> tracker = new HashMap<>(); + int cells = 0; + for (Pair container : werkstoff.getContents() + .getValue() + .toArray(new Pair[0])) { + if (container.getKey() instanceof Materials) { + if ((((Materials) container.getKey()).hasCorrespondingGas() + || ((Materials) container.getKey()).hasCorrespondingFluid() + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) + && ((Materials) container.getKey()).getDust(0) == null) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getFluid(1000L * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put( + container.getKey(), + new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add( + ((Materials) container.getKey()).getCells( + tracker.get(container.getKey()) + .getKey() + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()) + .getValue() + 1); + } + cells += container.getValue(); + } + } else { + if (((Materials) container.getKey()).getDust(container.getValue()) == null) continue; if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { stOutputs.add( - ((Materials) container.getKey()).getCells( + ((Materials) container.getKey()).getDust( tracker.get(container.getKey()) .getKey() + container.getValue())); stOutputs.remove( tracker.get(container.getKey()) .getValue() + 1); } - cells += container.getValue(); } - } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null) continue; - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else if (container.getKey() instanceof Werkstoff) { + if (((Werkstoff) container.getKey()).getStats() + .isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { + FluidStack tmpFl = ((Werkstoff) container.getKey()) + .getFluidOrGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); + tracker.put( + container.getKey(), + new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add( + ((Werkstoff) container.getKey()).get( + cell, + tracker.get(container.getKey()) + .getKey() + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()) + .getValue() + 1); + } + cells += container.getValue(); + } } else { - stOutputs.add( - ((Materials) container.getKey()).getDust( - tracker.get(container.getKey()) - .getKey() + container.getValue())); - stOutputs.remove( - tracker.get(container.getKey()) - .getValue() + 1); - } - } - } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats() - .isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { - FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { + if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue; if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); + stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { stOutputs.add( ((Werkstoff) container.getKey()).get( - cell, + dust, tracker.get(container.getKey()) .getKey() + container.getValue())); stOutputs.remove( tracker.get(container.getKey()) .getValue() + 1); } - cells += container.getValue(); - } - } else { - if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue; - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add( - ((Werkstoff) container.getKey()).get( - dust, - tracker.get(container.getKey()) - .getKey() + container.getValue())); - stOutputs.remove( - tracker.get(container.getKey()) - .getValue() + 1); } } } - } - ItemStack input = werkstoff.get(cell); - input.stackSize = 1; + ItemStack input = werkstoff.get(cell); + input.stackSize = 1; - int cellEmpty = cells - 1; + int cellEmpty = cells - 1; - stOutputs.add(Materials.Empty.getCells(-cellEmpty)); - if (werkstoff.getStats() - .isElektrolysis()) - RecipeMaps.electrolyzerRecipes.add( - new GTRecipe( - true, - new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] { null }, - new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats() - .getProtons() - * werkstoff.getContents() - .getValue() - .size())), - Math.min( - 4, - werkstoff.getContents() - .getValue() - .size()) - * 30, - 0)); - if (werkstoff.getStats() - .isCentrifuge()) - RecipeMaps.centrifugeRecipes.add( - new GTRecipe( - true, - new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] { null }, - new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats() - .getMass() - * werkstoff.getContents() - .getValue() - .size())), - Math.min( - 4, - werkstoff.getContents() - .getValue() - .size()) - * 5, - 0)); + stOutputs.add(Materials.Empty.getCells(-cellEmpty)); + if (werkstoff.getStats() + .isElektrolysis()) + RecipeMaps.electrolyzerRecipes.add( + new GTRecipe( + true, + new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getProtons() + * werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 30, + 0)); + if (werkstoff.getStats() + .isCentrifuge()) + RecipeMaps.centrifugeRecipes.add( + new GTRecipe( + true, + new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getMass() + * werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 5, + 0)); + } else { + GTLog.err.println( + "Autogenerated recipe(s) using Werkstoff material '" + werkstoff.getDefaultName() + + "' (fluid) removed due to no contents in material definition."); + } } // Tank "Recipe" diff --git a/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 04db75e0d39..187ca174d7a 100644 --- a/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -47,6 +47,7 @@ import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.recipe.RecipeMaps; +import gregtech.api.util.GTLog; import gregtech.api.util.GTModHandler; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTRecipeConstants; @@ -71,50 +72,94 @@ public void run(Werkstoff werkstoff) { || werkstoffStats.isCentrifuge() || werkstoff.getGenerationFeatures() .hasChemicalRecipes()) { - for (Pair container : werkstoff.getContents() + + if (werkstoff.getContents() .getValue() - .toArray(new Pair[0])) { - final ISubTagContainer key = container.getKey(); - final int value = container.getValue(); - if (key instanceof Materials materialKey) { - if ((materialKey.getGas(0) != null || materialKey.getFluid(0) != null - || materialKey.mIconSet == TextureSet.SET_FLUID) && materialKey.getDust(0) == null) { - FluidStack tmpFl = materialKey.getGas(1000L * value); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = materialKey.getFluid(1000L * value); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { + .size() > 0) { + + for (Pair container : werkstoff.getContents() + .getValue() + .toArray(new Pair[0])) { + final ISubTagContainer key = container.getKey(); + final int value = container.getValue(); + if (key instanceof Materials materialKey) { + if ((materialKey.getGas(0) != null || materialKey.getFluid(0) != null + || materialKey.mIconSet == TextureSet.SET_FLUID) && materialKey.getDust(0) == null) { + FluidStack tmpFl = materialKey.getGas(1000L * value); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = materialKey.getFluid(1000L * value); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(key)) { + stOutputs.add(materialKey.getCells(value)); + tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); + } else { + stOutputs.add( + materialKey.getCells( + tracker.get(key) + .getKey() + value)); + stOutputs.remove( + tracker.get(key) + .getValue() + 1); + } + cells += value; + } + } else { + if (materialKey.getDust(value) == null) { + if (materialKey.getCells(value) == null + || materialKey.getMolten(0) == null && materialKey.getSolid(0) == null) + continue; + FluidStack tmpFl = materialKey.getMolten(1000L * value); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = materialKey.getSolid(1000L * value); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(key)) { + stOutputs.add(materialKey.getCells(value)); + tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); + } else { + stOutputs.add( + materialKey.getCells( + tracker.get(key) + .getKey() + value)); + stOutputs.remove( + tracker.get(key) + .getValue() + 1); + } + cells += value; + } + } if (!tracker.containsKey(key)) { - stOutputs.add(materialKey.getCells(value)); + stOutputs.add(materialKey.getDust(value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { stOutputs.add( - materialKey.getCells( + materialKey.getDust( tracker.get(key) .getKey() + value)); stOutputs.remove( tracker.get(key) .getValue() + 1); } - cells += value; } - } else { - if (materialKey.getDust(value) == null) { - if (materialKey.getCells(value) == null - || materialKey.getMolten(0) == null && materialKey.getSolid(0) == null) continue; - FluidStack tmpFl = materialKey.getMolten(1000L * value); + } else if (key instanceof Werkstoff werkstoffKey) { + if (werkstoffKey.getStats() + .isGas() || werkstoffKey.hasItemType(cell)) { + FluidStack tmpFl = werkstoffKey.getFluidOrGas(1000 * value); if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = materialKey.getSolid(1000L * value); + tmpFl = werkstoffKey.getFluidOrGas(1000 * value); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { if (!tracker.containsKey(key)) { - stOutputs.add(materialKey.getCells(value)); + stOutputs.add(werkstoffKey.get(cell, value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { stOutputs.add( - materialKey.getCells( + werkstoffKey.get( + cell, tracker.get(key) .getKey() + value)); stOutputs.remove( @@ -123,92 +168,29 @@ public void run(Werkstoff werkstoff) { } cells += value; } - } - if (!tracker.containsKey(key)) { - stOutputs.add(materialKey.getDust(value)); - tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add( - materialKey.getDust( - tracker.get(key) - .getKey() + value)); - stOutputs.remove( - tracker.get(key) - .getValue() + 1); - } - } - } else if (key instanceof Werkstoff werkstoffKey) { - if (werkstoffKey.getStats() - .isGas() || werkstoffKey.hasItemType(cell)) { - FluidStack tmpFl = werkstoffKey.getFluidOrGas(1000 * value); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = werkstoffKey.getFluidOrGas(1000 * value); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { + if (!werkstoffKey.hasItemType(dust)) continue; if (!tracker.containsKey(key)) { - stOutputs.add(werkstoffKey.get(cell, value)); + stOutputs.add(werkstoffKey.get(dust, value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { stOutputs.add( werkstoffKey.get( - cell, + dust, tracker.get(key) .getKey() + value)); stOutputs.remove( tracker.get(key) .getValue() + 1); } - cells += value; - } - } else { - if (!werkstoffKey.hasItemType(dust)) continue; - if (!tracker.containsKey(key)) { - stOutputs.add(werkstoffKey.get(dust, value)); - tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); - } else { - stOutputs.add( - werkstoffKey.get( - dust, - tracker.get(key) - .getKey() + value)); - stOutputs.remove( - tracker.get(key) - .getValue() + 1); } } } - } - ItemStack input = werkstoff.get(dust); - input.stackSize = werkstoff.getContents() - .getKey(); - if (werkstoffStats.isElektrolysis()) { - GTRecipe tRecipe = new GTRecipe( - true, - new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] { null }, - new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, - (int) Math.max( - 1L, - Math.abs( - werkstoffStats.getProtons() / werkstoff.getContents() - .getValue() - .size())), - Math.min( - 4, - werkstoff.getContents() - .getValue() - .size()) - * 30, - 0); - RecipeMaps.electrolyzerRecipes.add(tRecipe); - } - if (werkstoffStats.isCentrifuge()) { - RecipeMaps.centrifugeRecipes.add( - new GTRecipe( + ItemStack input = werkstoff.get(dust); + input.stackSize = werkstoff.getContents() + .getKey(); + if (werkstoffStats.isElektrolysis()) { + GTRecipe tRecipe = new GTRecipe( true, new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, stOutputs.toArray(new ItemStack[0]), @@ -219,7 +201,7 @@ public void run(Werkstoff werkstoff) { (int) Math.max( 1L, Math.abs( - werkstoffStats.getMass() / werkstoff.getContents() + werkstoffStats.getProtons() / werkstoff.getContents() .getValue() .size())), Math.min( @@ -227,60 +209,90 @@ public void run(Werkstoff werkstoff) { werkstoff.getContents() .getValue() .size()) - * 5, - 0)); - } - if (werkstoff.getGenerationFeatures() - .hasChemicalRecipes()) { - if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GTValues.RA.stdBuilder() - .itemInputs(stOutputs.toArray(new ItemStack[0])) - .itemOutputs(input) - .fluidInputs(flOutputs.toArray(new FluidStack[0])) - .duration( - (int) Math.max( - 1L, - Math.abs( - werkstoffStats.getProtons() / werkstoff.getContents() + * 30, + 0); + RecipeMaps.electrolyzerRecipes.add(tRecipe); + } + if (werkstoffStats.isCentrifuge()) { + RecipeMaps.centrifugeRecipes.add( + new GTRecipe( + true, + new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoffStats.getMass() / werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() .getValue() - .size()))) - .eut( - Math.min( - 4, - werkstoff.getContents() - .getValue() - .size()) - * 30) - .addTo(GTRecipeConstants.UniversalChemical); - } - if (werkstoff.getGenerationFeatures() - .hasMixerRecipes()) { - if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - short circuitID = werkstoff.getMixCircuit(); - ItemStack circuit = circuitID == -1 ? null : GTUtility.getIntegratedCircuit(circuitID); - if (circuit != null) stOutputs.add(circuit); - RecipeMaps.mixerRecipes.add( - new GTRecipe( - true, - stOutputs.toArray(new ItemStack[0]), - new ItemStack[] { input }, - null, - null, - new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, - null, - (int) Math.max( - 1L, - Math.abs( - werkstoffStats.getMass() / werkstoff.getContents() + .size()) + * 5, + 0)); + } + if (werkstoff.getGenerationFeatures() + .hasChemicalRecipes()) { + if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); + GTValues.RA.stdBuilder() + .itemInputs(stOutputs.toArray(new ItemStack[0])) + .itemOutputs(input) + .fluidInputs(flOutputs.toArray(new FluidStack[0])) + .duration( + (int) Math.max( + 1L, + Math.abs( + werkstoffStats.getProtons() / werkstoff.getContents() + .getValue() + .size()))) + .eut( + Math.min( + 4, + werkstoff.getContents() .getValue() - .size())), - Math.min( - 4, - werkstoff.getContents() - .getValue() - .size()) - * 5, - 0)); + .size()) + * 30) + .addTo(GTRecipeConstants.UniversalChemical); + } + if (werkstoff.getGenerationFeatures() + .hasMixerRecipes()) { + if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); + short circuitID = werkstoff.getMixCircuit(); + ItemStack circuit = circuitID == -1 ? null : GTUtility.getIntegratedCircuit(circuitID); + if (circuit != null) stOutputs.add(circuit); + RecipeMaps.mixerRecipes.add( + new GTRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] { input }, + null, + null, + new FluidStack[] { !flOutputs.isEmpty() ? flOutputs.get(0) : null }, + null, + (int) Math.max( + 1L, + Math.abs( + werkstoffStats.getMass() / werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 5, + 0)); + } + } else { + GTLog.err.println( + "Autogenerated recipe(s) using Werkstoff material '" + werkstoff.getDefaultName() + + "' (dust) removed due to no contents in material definition."); } } diff --git a/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 60869619a44..96676b889ab 100644 --- a/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -110,8 +110,10 @@ public void run(Werkstoff werkstoff) { .itemOutputs(werkstoff.get(ingot)) .fluidInputs(werkstoff.getMolten(144)) .duration( - (int) werkstoff.getStats() - .getMass()) + Math.max( + 1, + (int) werkstoff.getStats() + .getMass())) .eut( werkstoff.getStats() .getMass() > 128 ? 64 : 30) @@ -122,8 +124,10 @@ public void run(Werkstoff werkstoff) { .itemOutputs(werkstoff.get(nugget)) .fluidInputs(werkstoff.getMolten(16)) .duration( - (int) ((double) werkstoff.getStats() - .getMass() / 9D)) + Math.max( + 1, + (int) ((double) werkstoff.getStats() + .getMass() / 9D))) .eut( werkstoff.getStats() .getMass() > 128 ? 64 : 30) diff --git a/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaser.java index 7dc3eca2f8b..077be58a71f 100644 --- a/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -20,6 +20,7 @@ import tectech.mechanics.pipe.IConnectsToEnergyTunnel; import tectech.thing.metaTileEntity.pipe.MTEPipeEnergy; +@Deprecated public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel { boolean isSender(); diff --git a/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaserBase.java b/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaserBase.java index a4e21be96f5..b9ddf8df4bb 100644 --- a/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaserBase.java +++ b/src/main/java/bwcrossmod/tectech/tileentites/tiered/LowPowerLaserBase.java @@ -25,6 +25,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.MTETieredMachineBlock; +@Deprecated public abstract class LowPowerLaserBase extends MTETieredMachineBlock implements LowPowerLaser { protected long AMPERES; diff --git a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserBox.java b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserBox.java index e4eba7d464d..d2a862d5787 100644 --- a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserBox.java +++ b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserBox.java @@ -23,6 +23,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GTUtility; +@Deprecated public class MTELowPowerLaserBox extends LowPowerLaserBase { public MTELowPowerLaserBox(int aID, String aName, String aNameRegional, int aTier, long aAmperes, @@ -161,7 +162,8 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override public String[] getDescription() { - return new String[] { "Like a transformer... but for LASERS!", + return new String[] { EnumChatFormatting.RED + "DEPRECATED! This will be removed in the next major update.", + "Like a transformer... but for LASERS!", "Transfer rate: " + EnumChatFormatting.YELLOW + GTUtility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.WHITE diff --git a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserDynamo.java b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserDynamo.java index da3e3e4ac2b..678cf380d05 100644 --- a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserDynamo.java +++ b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserDynamo.java @@ -13,11 +13,14 @@ package bwcrossmod.tectech.tileentites.tiered; +import net.minecraft.util.EnumChatFormatting; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import tectech.thing.metaTileEntity.hatch.MTEHatchDynamoTunnel; +@Deprecated public class MTELowPowerLaserDynamo extends MTEHatchDynamoTunnel implements LowPowerLaser { public MTELowPowerLaserDynamo(int aID, String aName, String aNameRegional, int aTier, int aAmp) { @@ -55,7 +58,10 @@ public long getAMPERES() { @Override public String[] getDescription() { - return mDescriptionArray; + String[] desc = new String[mDescriptionArray.length + 1]; + desc[0] = EnumChatFormatting.RED + "DEPRECATED! This machine will be removed in the next major update."; + System.arraycopy(mDescriptionArray, 0, desc, 1, mDescriptionArray.length); + return desc; } @Override diff --git a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserHatch.java b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserHatch.java index b9fa9c14b67..7cc2b8c345a 100644 --- a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserHatch.java +++ b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserHatch.java @@ -13,11 +13,14 @@ package bwcrossmod.tectech.tileentites.tiered; +import net.minecraft.util.EnumChatFormatting; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyTunnel; +@Deprecated public class MTELowPowerLaserHatch extends MTEHatchEnergyTunnel implements LowPowerLaser { public MTELowPowerLaserHatch(int aID, String aName, String aNameRegional, int aTier, int aAmp) { @@ -30,7 +33,10 @@ public MTELowPowerLaserHatch(String aName, int aTier, int aAmp, String[] aDescri @Override public String[] getDescription() { - return mDescriptionArray; + String[] desc = new String[mDescriptionArray.length + 1]; + desc[0] = EnumChatFormatting.RED + "DEPRECATED! This machine will be removed in the next major update."; + System.arraycopy(mDescriptionArray, 0, desc, 1, mDescriptionArray.length); + return desc; } @Override diff --git a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserPipe.java b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserPipe.java index 0a8ddb19d30..0d4bf98282d 100644 --- a/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserPipe.java +++ b/src/main/java/bwcrossmod/tectech/tileentites/tiered/MTELowPowerLaserPipe.java @@ -33,6 +33,7 @@ import gregtech.common.GTClient; import ic2.core.Ic2Items; +@Deprecated public class MTELowPowerLaserPipe extends MTECable implements LowPowerLaser { public MTELowPowerLaserPipe(int aID, String aName, String aNameRegional) { @@ -74,7 +75,8 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override public String[] getDescription() { - return new String[] { "Primitive Laser Cable intended for Low Power Applications", "Does not auto-connect", + return new String[] { EnumChatFormatting.RED + "DEPRECATED! This will be removed in the next major update.", + "Primitive Laser Cable intended for Low Power Applications", "Does not auto-connect", "Does not turn or bend", EnumChatFormatting.WHITE + "Must be " + EnumChatFormatting.YELLOW diff --git a/src/main/java/detrav/items/processing/ProcessingDetravToolProspector.java b/src/main/java/detrav/items/processing/ProcessingDetravToolProspector.java index 85d31927803..1525303a68d 100644 --- a/src/main/java/detrav/items/processing/ProcessingDetravToolProspector.java +++ b/src/main/java/detrav/items/processing/ProcessingDetravToolProspector.java @@ -26,7 +26,7 @@ public class ProcessingDetravToolProspector implements gregtech.api.interfaces.IOreRecipeRegistrator { public ProcessingDetravToolProspector() { - OrePrefixes.toolHeadPickaxe.add(this); + } public void registerOre(OrePrefixes aPrefix, Materials material, String aOreDictName, String aModName, diff --git a/src/main/java/ggfab/mte/MTEAdvAssLine.java b/src/main/java/ggfab/mte/MTEAdvAssLine.java index f9874efd79b..a4c913207ce 100644 --- a/src/main/java/ggfab/mte/MTEAdvAssLine.java +++ b/src/main/java/ggfab/mte/MTEAdvAssLine.java @@ -304,9 +304,9 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Assembling Line") - .addInfo("Built exactly the same as standard Assembling Line") - .addInfo("Assembling Line with item pipelining") + tt.addMachineType("Assembly Line, AAL") + .addInfo("Built exactly the same as standard Assembly Line") + .addInfo("Assembly Line with item pipelining") .addInfo("All fluids are however consumed at start") .addInfo("Use voltage of worst energy hatch for overclocking") .addInfo("Performs normal overclock with given voltage") @@ -323,7 +323,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addStructureInfo( "Layer 1 - Solid Steel Machine Casing, Input Bus (last can be Output Bus), Solid Steel Machine Casing") .addStructureInfo( - "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") + "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembly Line Casing, Reinforced Glass") .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes") @@ -522,9 +522,11 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve * l -> { currentInputLength = l; for (SliceStatusWidget w : arr) { w.updateText(); } })); */ screenElements.widget( - new TextWidget(Text.localised("ggfab.gui.advassline.shutdown")).setEnabled(this::hasAbnormalStopReason)); + new TextWidget(Text.localised("ggfab.gui.advassline.shutdown")).setTextAlignment(Alignment.CenterLeft) + .setEnabled(this::hasAbnormalStopReason)); screenElements.widget( new TextWidget().setTextSupplier(() -> Text.localised(lastStopReason)) + .setTextAlignment(Alignment.CenterLeft) .attachSyncer( new FakeSyncWidget.StringSyncer(() -> lastStopReason, r -> this.lastStopReason = r), screenElements) diff --git a/src/main/java/goodgenerator/blocks/regularBlock/BlockTurbineCasing.java b/src/main/java/goodgenerator/blocks/regularBlock/BlockTurbineCasing.java index 38aeae89cdc..2638ae337e0 100644 --- a/src/main/java/goodgenerator/blocks/regularBlock/BlockTurbineCasing.java +++ b/src/main/java/goodgenerator/blocks/regularBlock/BlockTurbineCasing.java @@ -1,89 +1,28 @@ package goodgenerator.blocks.regularBlock; import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; -import goodgenerator.blocks.tileEntity.base.MTELargeTurbineBase; import goodgenerator.client.render.BlockRenderHandler; import goodgenerator.main.GoodGenerator; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.render.TextureFactory; public class BlockTurbineCasing extends BlockCasing implements ITextureBlock { - public static IIconContainer[][] turbineShape = new IIconContainer[3][9]; public IIconContainer base; - static { - for (int i = 0; i < 3; i++) for (int j = 1; j <= 9; j++) - turbineShape[i][j - 1] = new Textures.BlockIcons.CustomIcon("icons/turbines/TURBINE_" + i + j); - } - public BlockTurbineCasing(String name, String texture) { super(name, new String[] { GoodGenerator.MOD_ID + ":" + texture }); base = new Textures.BlockIcons.CustomIcon("icons/" + texture); } - private static int isTurbineControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection side) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (!(tTileEntity instanceof IGregTechTileEntity tTile)) return 0; - if (tTile.getMetaTileEntity() instanceof MTELargeTurbineBase && tTile.getFrontFacing() == side) { - if (tTile.isActive()) return 1; - return ((MTELargeTurbineBase) tTile.getMetaTileEntity()).hasTurbine() ? 2 : 3; - } - return 0; - } - - public ITexture[] getTurbineCasing(int iconIndex, boolean active, boolean hasTurbine) { - int states = active ? 0 : hasTurbine ? 1 : 2; - return new ITexture[] { TextureFactory.of(base), TextureFactory.of(turbineShape[states][iconIndex]) }; - } - @Override public ITexture[] getTexture(Block aBlock, ForgeDirection side, IBlockAccess aWorld, int xCoord, int yCoord, int zCoord) { - final int ordinalSide = side.ordinal(); - int tInvertLeftRightMod = ordinalSide % 2 * 2 - 1; - switch (ordinalSide / 2) { - case 0: - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) continue; - int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, side)) != 0) { - return getTurbineCasing(4 - i * 3 - j, tState == 1, tState == 2); - } - } - } - break; - case 1: - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) continue; - int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, side)) != 0) { - return getTurbineCasing(4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); - } - } - } - break; - case 2: - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) continue; - int tState; - if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, side)) != 0) { - return getTurbineCasing(4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); - } - } - } - break; - } return getTexture(aBlock, side); } diff --git a/src/main/java/goodgenerator/blocks/structures/AntimatterStructures.java b/src/main/java/goodgenerator/blocks/structures/AntimatterStructures.java index e199e680cc8..d83704c646f 100644 --- a/src/main/java/goodgenerator/blocks/structures/AntimatterStructures.java +++ b/src/main/java/goodgenerator/blocks/structures/AntimatterStructures.java @@ -3368,7 +3368,7 @@ public class AntimatterStructures { " A A ", " A A ", " C C ", " FCG GCF ", " DDGDDG GDDGDD ", " DDGDDGDCDGGGGGDCDGDDGDD ", - " FDDDDDDDDDDDDDDDDDDDDDDDFF " }, + " FDDDDDDDDDDDDDDDDDDDDDDDF " }, { " CCC ", " EEEEEEEEE ", " E E ", " E E ", " E E ", " E E ", diff --git a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterForge.java b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterForge.java index 9380ea349a9..d45aebbf8db 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterForge.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterForge.java @@ -28,6 +28,7 @@ import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizons.modularui.api.NumberFormatMUI; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; @@ -40,7 +41,6 @@ import gregtech.api.enums.HatchElement; import gregtech.api.enums.Materials; import gregtech.api.enums.MaterialsUEVplus; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -150,21 +150,6 @@ protected IStructureDefinition computeValue(Class type) { } }; - static { - Textures.BlockIcons.setCasingTextureForId( - 53, - TextureFactory.of( - TextureFactory.builder() - .addIcon(MACHINE_CASING_ANTIMATTER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(MACHINE_CASING_ANTIMATTER_GLOW) - .extFacing() - .glow() - .build())); - } - public AntimatterForge(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -208,7 +193,7 @@ protected MultiblockTooltipBuilder createTooltip() { + " EU per operation to produce antimatter") .addSeparator() .addInfo("Every cycle, the lowest amount of antimatter in the 16 antimatter hatches is recorded") - .addInfo("Cycles every 5 seconds") + .addInfo("Cycles every second") .addInfo( "All hatches with more than the lowest amount will " + EnumChatFormatting.RED + "lose half the difference!" @@ -307,6 +292,7 @@ protected MultiblockTooltipBuilder createTooltip() { + "+0.10" + EnumChatFormatting.GRAY) .addInfo("Each stabilization can only use one of the fluids at a time") + .beginStructureBlock(53, 53, 47, false) .addCasingInfoMin("Antimatter Containment Casing", 512, false) .addCasingInfoMin("Magnetic Flux Casing", 2274, false) .addCasingInfoMin("Gravity Stabilization Casing", 623, false) @@ -372,21 +358,6 @@ public int textureIndex(int type) { } } - private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1_GLOW) - .extFacing() - .glow() - .build()); - - public ITexture getTextureOverlay() { - return textureOverlay; - } - @Override public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aStack) { return side != getBaseMetaTileEntity().getFrontFacing(); @@ -415,8 +386,25 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec if (side == facing) return new ITexture[] { TextureFactory.builder() .addIcon(MACHINE_CASING_ANTIMATTER) .extFacing() - .build(), getTextureOverlay() }; - if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(53) }; + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build() }; + if (aActive) return new ITexture[] { TextureFactory.builder() + .addIcon(MACHINE_CASING_ANTIMATTER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(MACHINE_CASING_ANTIMATTER_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { TextureFactory.builder() .addIcon(MACHINE_CASING_ANTIMATTER) .extFacing() @@ -781,7 +769,7 @@ public String[] getInfoData() { + EnumChatFormatting.AQUA + GTUtility.formatNumbers(this.guiAntimatterChange) + EnumChatFormatting.RESET - + " EU/t" }; + + " L" }; } private long getAntimatterAmount() { @@ -827,6 +815,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve + numberFormat.format(antimatterAmountCache) + EnumChatFormatting.WHITE + " L") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get())) .widget(new FakeSyncWidget.LongSyncer(this::getAntimatterAmount, val -> antimatterAmountCache = val)) .widget( @@ -837,6 +826,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve + standardFormat.format(passiveCostCache) + EnumChatFormatting.WHITE + " EU/t") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get())) .widget(new FakeSyncWidget.LongSyncer(this::getPassiveConsumption, val -> passiveCostCache = val)) .widget( @@ -847,6 +837,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve + standardFormat.format(activeCostCache) + EnumChatFormatting.WHITE + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get())) .widget(new FakeSyncWidget.LongSyncer(this::getActiveConsumption, val -> activeCostCache = val)) .widget( @@ -857,6 +848,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve + numberFormat.format(antimatterChangeCache) + EnumChatFormatting.WHITE + " L") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get())) .widget(new FakeSyncWidget.LongSyncer(this::getAntimatterChange, val -> antimatterChangeCache = val)); } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java index 98bbbe70e7f..96a0310ed6a 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java @@ -33,6 +33,7 @@ import com.gtnewhorizons.modularui.api.NumberFormatMUI; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; @@ -48,7 +49,6 @@ import gregtech.api.enums.HatchElement; import gregtech.api.enums.Materials; import gregtech.api.enums.MaterialsUEVplus; -import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -112,21 +112,6 @@ protected IStructureDefinition computeValue(Class type) } }; - static { - Textures.BlockIcons.setCasingTextureForId( - 53, - TextureFactory.of( - TextureFactory.builder() - .addIcon(MACHINE_CASING_ANTIMATTER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(MACHINE_CASING_ANTIMATTER_GLOW) - .extFacing() - .glow() - .build())); - } - private boolean addLaserSource(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) { IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; @@ -357,6 +342,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addInfo("Enable wireless EU mode with screwdriver") .addInfo("Wireless mode requires SC UMV Base or better") .addInfo("Wireless mode uses hatch capacity limit") + .beginStructureBlock(35, 43, 35, false) .addCasingInfoMin("Transcendentally Reinforced Borosilicate Glass", 1008, false) .addCasingInfoMin("Magnetic Flux Casing", 4122, false) .addCasingInfoMin("Gravity Stabilization Casing", 2418, false) @@ -515,6 +501,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve + standardFormat.format(energyProducedCache) + EnumChatFormatting.WHITE + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get())) .widget(new FakeSyncWidget.LongSyncer(this::getEnergyProduced, val -> energyProducedCache = val)) .widget( @@ -525,6 +512,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve + numberFormat.format(Math.ceil(efficiencyCache * 100)) + EnumChatFormatting.WHITE + " %") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get())) .widget(new FakeSyncWidget.FloatSyncer(this::getEfficiency, val -> efficiencyCache = val)) .widget( @@ -535,6 +523,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve + numberFormat.format(Math.ceil(avgEffCache * 100)) + EnumChatFormatting.WHITE + " % ⟩₁₀") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get())) .widget(new FakeSyncWidget.FloatSyncer(this::getAvgEfficiency, val -> avgEffCache = val)); } @@ -544,30 +533,31 @@ public IStructureDefinition getStructureDefinition() { return STRUCTURE_DEFINITION.get(getClass()); } - private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1_GLOW) - .extFacing() - .glow() - .build()); - - public ITexture getTextureOverlay() { - return textureOverlay; - } - @Override - @SuppressWarnings("ALL") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) return new ITexture[] { TextureFactory.builder() .addIcon(MACHINE_CASING_ANTIMATTER) .extFacing() - .build(), getTextureOverlay() }; - if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(53) }; + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build() }; + if (aActive) return new ITexture[] { TextureFactory.builder() + .addIcon(MACHINE_CASING_ANTIMATTER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(MACHINE_CASING_ANTIMATTER_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { TextureFactory.builder() .addIcon(MACHINE_CASING_ANTIMATTER) .extFacing() diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTENeutronAccelerator.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTENeutronAccelerator.java index a9c70d92849..fb63e673020 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTENeutronAccelerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTENeutronAccelerator.java @@ -1,6 +1,9 @@ package goodgenerator.blocks.tileEntity.GTMetaTileEntity; import static gregtech.api.enums.GTValues.V; +import static gregtech.api.util.GTUtility.formatNumbers; + +import net.minecraft.util.EnumChatFormatting; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -28,9 +31,12 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override public String[] getDescription() { - return new String[] { "Input EU to Accelerate the Neutron!", "Max EU input: " + this.maxEUInput(), - "Max EU consumption: " + this.getMaxEUConsume(), - "Every EU can be transformed into 10~20 eV Neutron Kinetic Energy." }; + return new String[] { "Uses Energy to Accelerate the Neutrons!", + "Max consumption: " + EnumChatFormatting.YELLOW + + formatNumbers(this.getMaxEUConsume()) + + EnumChatFormatting.WHITE + + " EU/t", + "Every EU gets converted into 10-20 eV Neutron Kinetic Energy." }; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java index be44ef3112f..041e8f4bcff 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java @@ -212,7 +212,7 @@ public IStructureDefinition getStructureDefinition() { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("High-Capacity Component Assembler") + tt.addMachineType("High-Capacity Component Assembler, CoAL") .addInfo("Assembles basic components (motors, pumps, etc.) in large batches.") .addInfo( "The " + EnumChatFormatting.BOLD diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java index 34277effaf5..18fd72eaf4c 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java @@ -203,7 +203,7 @@ public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStac @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Heat Exchanger/Plasma Heat Exchanger") + tt.addMachineType("Heat Exchanger, EHE") .addInfo("Outputs SH steam by cooling hot fluids with distilled water.") .addInfo("Supplying more hot fluid than the threshold causes overheating,") .addInfo("producing SC steam instead.") diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java index b89b3b96762..fa9fe3d250e 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java @@ -132,7 +132,7 @@ protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemS if (this.mCasing >= 24 && this.mMaintenanceHatches.size() == 1 && !this.mInputBusses.isEmpty() && !this.mEssentiaOutputHatches.isEmpty()) { - this.mParallel = Math.floor(this.mParallel += 1 << this.pTier); + this.mParallel = (len + 1) * Math.pow(2, this.pTier); return true; } return false; @@ -191,10 +191,11 @@ public IStructureDefinition getStructure_EM() { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Essentia Smeltery") + tt.addMachineType("Essentia Smeltery, LES") .addInfo("Necessary evil.") .addInfo("Advanced Essentia smelting technology.") - .addInfo("Max parallel dictated by structure size and Essentia Diffusion Cell tier") + .addInfo("Maximum parallel = 2^Tier * (Length - 1)") + .addInfo("Diffusion Cell Tiers start from 0, Length is full multi length.") .addInfo("Energy Hatch tier: HV+") .addInfo("You can find more information about this machine in the Thaumonomicon.") .addTecTechHatchInfo() @@ -219,7 +220,11 @@ public String[] getStructureDescription(ItemStack itemStack) { @Override public String[] getInfoData() { String[] info = super.getInfoData(); - info[8] = "Node Power: " + EnumChatFormatting.RED + info[8] = "Parallel: " + EnumChatFormatting.YELLOW + + Math.round(this.mParallel) + + EnumChatFormatting.RESET + + " Node Power: " + + EnumChatFormatting.RED + this.nodePower + EnumChatFormatting.RESET + " Purification Efficiency: " @@ -258,8 +263,7 @@ protected void onCasingFound() { } protected void onEssentiaCellFound(int tier) { - this.mParallel += (1 << tier) * 0.25f; - this.pTier = Math.max(this.pTier, tier); + this.pTier = tier; } private boolean addEnergyHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer1.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer1.java index 633bd9a72b2..0d36a897aec 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer1.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer1.java @@ -61,8 +61,6 @@ protected MultiblockTooltipBuilder createTooltip() { "If the recipe requires a voltage tier over " + GTUtility.getColoredTierNameFromTier((byte) tier()) + EnumChatFormatting.GRAY + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).") .addInfo("It can run 64x recipes at most.") .addTecTechHatchInfo() .addCasingInfoMin("LuV Machine Casing", 1664, false) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer2.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer2.java index e702e694eb1..472af5e84e2 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer2.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer2.java @@ -61,8 +61,6 @@ protected MultiblockTooltipBuilder createTooltip() { "If the recipe requires a voltage tier over " + GTUtility.getColoredTierNameFromTier((byte) tier()) + EnumChatFormatting.GRAY + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).") .addInfo("Startup < 160,000,000 EU: 128x Parallel") .addInfo("Startup >= 160,000,000 EU: 64x Parallel") .addTecTechHatchInfo() diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer3.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer3.java index 06f06e7cdda..f1e46b2c6f9 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer3.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer3.java @@ -61,8 +61,6 @@ protected MultiblockTooltipBuilder createTooltip() { "If the recipe requires a voltage tier over " + GTUtility.getColoredTierNameFromTier((byte) tier()) + EnumChatFormatting.GRAY + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).") .addInfo("Startup < 160,000,000 EU: 192x Parallel") .addInfo("Startup < 320,000,000 EU: 128x Parallel") .addInfo("Startup >= 320,000,000 EU: 64x Parallel") diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer4.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer4.java index 74635196001..a54348f19ac 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer4.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer4.java @@ -58,8 +58,6 @@ protected MultiblockTooltipBuilder createTooltip() { "If the recipe requires a voltage tier over " + GTUtility.getColoredTierNameFromTier((byte) tier()) + EnumChatFormatting.GRAY + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).") .addInfo("Performs 4/4 overclock.") .addInfo("Startup < 160,000,000 EU: 256x Parallel") .addInfo("Startup < 320,000,000 EU: 192x Parallel") diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer5.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer5.java index 52b89d67ad9..fd652356f95 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer5.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeFusionComputer5.java @@ -58,8 +58,6 @@ protected MultiblockTooltipBuilder createTooltip() { "If the recipe requires a voltage tier over " + GTUtility.getColoredTierNameFromTier((byte) tier()) + EnumChatFormatting.GRAY + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).") .addInfo("Performs 4/4 overclock.") .addInfo("Startup < 160,000,000 EU: 320x Parallel") .addInfo("Startup < 320,000,000 EU: 256x Parallel") diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java b/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java index 2935d4b6b44..ef5e45bbfe7 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java @@ -24,6 +24,7 @@ import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizons.modularui.api.NumberFormatMUI; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; @@ -180,7 +181,7 @@ public RecipeMap getRecipeMap() { protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Neutron Activator") + tt.addMachineType("Neutron Activator, NA") .addInfo("Superluminal-velocity Motion.") .addInfo("The minimum height of the Speeding Pipe Casing is 4.") .addInfo("Per extra Speeding Pipe Casing will give time discount.") @@ -465,9 +466,12 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve screenElements .widget( new TextWidget(StatCollector.translateToLocal("gui.NeutronActivator.0")) - .setDefaultColor(COLOR_TEXT_WHITE.get())) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget( new TextWidget().setStringSupplier(() -> numberFormat.format(eV / 1_000_000d) + " MeV") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget(new FakeSyncWidget.IntegerSyncer(() -> eV, val -> eV = val)); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java index 815aaeafa6b..24b80f5ef80 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java @@ -330,7 +330,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Precise Assembler/Assembler") + tt.addMachineType("Precise Assembler, Assembler, PrAss") .addInfo("The error is no more than 7nm.") .addInfo("Can assemble precise component in Precise Mode.") .addInfo("Can work like a normal assembler in Normal Mode.") diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java index 0a3ec6fc1a4..73b718f6e46 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java @@ -68,7 +68,7 @@ public int fluidIntoPower(ArrayList aFluids, TurbineStatCalculator t } if (totalFlow <= 0) return 0; tEU = totalFlow; - addOutput(GTModHandler.getSteam(totalFlow)); + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", totalFlow)); if (totalFlow == realOptFlow) { tEU = GTUtility .safeInt((long) (tEU * (looseFit ? turbine.getLooseSteamEfficiency() : turbine.getSteamEfficiency()))); @@ -138,13 +138,17 @@ public int getCasingTextureIndex() { return 1538; } + public boolean isNewStyleRendering() { + return true; + } + @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); tt.addMachineType("Supercritical Steam Turbine") .addInfo("Needs a Turbine, place inside controller") .addInfo("Use Supercritical Steam to generate power.") - .addInfo("Outputs 1L of Steam per 1L of SC Steam as well as producing power") + .addInfo("Outputs 1L of SH Steam per 1L of SC Steam as well as producing power") .addInfo("Power output depends on turbine and fitting") .addInfo("Use screwdriver to adjust fitting of turbine") .beginStructureBlock(3, 3, 4, true) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEUniversalChemicalFuelEngine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEUniversalChemicalFuelEngine.java index 0b6e9586890..b3df1b3c99e 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEUniversalChemicalFuelEngine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEUniversalChemicalFuelEngine.java @@ -180,7 +180,7 @@ public int getPollutionPerTick(ItemStack aStack) { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Chemical Engine") + tt.addMachineType("Chemical Engine, UCFE") .addInfo("BURNING BURNING BURNING") .addInfo("Use combustible liquid to generate power.") .addInfo("You need to supply Combustion Promoter to keep it running.") @@ -276,7 +276,7 @@ public boolean onRunningTick(ItemStack stack) { public String[] getInfoData() { String[] info = super.getInfoData(); info[4] = "Currently generates: " + EnumChatFormatting.RED - + GTUtility.formatNumbers(this.getPowerFlow()) + + GTUtility.formatNumbers(this.getPowerFlow() * tEff / 10000) + EnumChatFormatting.RESET + " EU/t"; info[6] = "Problems: " + EnumChatFormatting.RED diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java index 9a304a82d2d..5fa8d163525 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java @@ -32,6 +32,7 @@ import com.gtnewhorizons.modularui.api.NumberFormatMUI; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; @@ -56,6 +57,7 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import tectech.TecTech; import tectech.thing.gui.TecTechUITextures; @@ -253,8 +255,7 @@ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { cacheNeedsRecreation = !tankInfoCache[0].fluid.isFluidEqual(mFluid); } if (cacheNeedsRecreation) { - final FluidStack storedFluid = mFluid.copy(); - storedFluid.amount = fluidSize; + final FluidStack storedFluid = GTUtility.copyAmount(fluidSize, mFluid); tankInfoCache[0] = new FluidTankInfo(storedFluid, tankCapacity); } else if (mFluid != null) { tankInfoCache[0].fluid.amount = fluidSize; @@ -646,12 +647,14 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve .widget( new TextWidget().setStringSupplier( () -> StatCollector.translateToLocal("gui.YOTTank.0") + " " + numberFormat.format(mStorage) + " L") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorage, val -> mStorage = val)) .widget( new TextWidget() .setStringSupplier(() -> StatCollector.translateToLocal("gui.YOTTank.1") + " " + getFluidName()) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val)) @@ -661,6 +664,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve () -> StatCollector.translateToLocal("gui.YOTTank.2") + " " + numberFormat.format(mStorageCurrent) + " L") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorageCurrent, val -> mStorageCurrent = val)) @@ -669,6 +673,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve .setStringSupplier( () -> StatCollector.translateToLocal("gui.YOTTank.3") + " " + getLockedFluidName()) .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setTextAlignment(Alignment.CenterLeft) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget(new FakeSyncWidget.FluidStackSyncer(() -> mLockedFluid, val -> mLockedFluid = val)) .widget(new FakeSyncWidget.BooleanSyncer(() -> isFluidLocked, val -> isFluidLocked = val)) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java index 36b1142732b..458504384ee 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java @@ -14,10 +14,8 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -29,6 +27,7 @@ import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizons.modularui.api.NumberFormatMUI; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; @@ -49,7 +48,6 @@ import gregtech.api.metatileentity.implementations.MTEHatchEnergy; import gregtech.api.metatileentity.implementations.MTEHatchInput; import gregtech.api.metatileentity.implementations.MTEHatchOutput; -import gregtech.api.objects.GTChunkManager; import gregtech.api.objects.GTItemStack; import gregtech.api.objects.overclockdescriber.FusionOverclockDescriber; import gregtech.api.objects.overclockdescriber.OverclockDescriber; @@ -73,7 +71,6 @@ public abstract class MTELargeFusionComputer extends MTETooltipMultiBlockBaseEM public static final String MAIN_NAME = "largeFusion"; public static final int M = 1_000_000; - private boolean isLoadedChunk; public GTRecipe mLastRecipe; public int para; protected OverclockDescriber overclockDescriber; @@ -235,45 +232,6 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide() && !aBaseMetaTileEntity.isAllowedToWork()) { - // if machine has stopped, stop chunkloading - GTChunkManager.releaseTicket((TileEntity) aBaseMetaTileEntity); - this.isLoadedChunk = false; - } else if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && !this.isLoadedChunk) { - // load a 3x3 area when machine is running - GTChunkManager.releaseTicket((TileEntity) aBaseMetaTileEntity); - int offX = aBaseMetaTileEntity.getFrontFacing().offsetX; - int offZ = aBaseMetaTileEntity.getFrontFacing().offsetZ; - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + 1 + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() - 1 + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + 1 + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() - 1 + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + 1 + offZ)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() - 1 + offZ)); - this.isLoadedChunk = true; - } - if (aBaseMetaTileEntity.isServerSide()) { mTotalRunTime++; if (mEfficiency < 0) mEfficiency = 0; @@ -488,12 +446,6 @@ protected void setProcessingLogicPower(ProcessingLogic logic) { logic.setAvailableAmperage(getSingleHatchPower() * 32 / GTValues.V[tier()]); } - @Override - public void onRemoval() { - if (this.isLoadedChunk) GTChunkManager.releaseTicket((TileEntity) getBaseMetaTileEntity()); - super.onRemoval(); - } - public int getChunkX() { return getBaseMetaTileEntity().getXCoord() >> 4; } @@ -628,6 +580,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve () -> StatCollector.translateToLocal("gui.LargeFusion.0") + " " + numberFormat.format(energyStorageCache) + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget(new FakeSyncWidget.LongSyncer(this::maxEUStore, val -> energyStorageCache = val)) @@ -637,6 +590,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve () -> StatCollector.translateToLocal("gui.LargeFusion.1") + " " + numberFormat.format(getEUVar()) + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget(new FakeSyncWidget.LongSyncer(this::getEUVar, this::setEUVar)); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java index 843a42ac806..75f234a9fbb 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java @@ -6,18 +6,20 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GTStructureUtility.*; import static gregtech.api.util.GTUtility.validMTEList; import java.util.ArrayList; import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -25,10 +27,11 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElementCheckOnly; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import gregtech.api.interfaces.IHatchElement; +import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.MetaGeneratedTool; import gregtech.api.metatileentity.implementations.MTEEnhancedMultiBlockBase; @@ -36,6 +39,7 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GTUtility; +import gregtech.api.util.GTUtilityClient; import gregtech.api.util.TurbineStatCalculator; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.common.items.MetaGeneratedTool01; @@ -52,26 +56,20 @@ protected IStructureDefinition computeValue(Class type) .addShape( STRUCTURE_PIECE_MAIN, transpose( - new String[][] { { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, - { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", }, - { " --- ", "xc~cx", "xh-hx", "xh-hx", "xcdcx", }, - { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", }, - { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, })) + new String[][] { { " ", " ", " ", " ", " ", }, + { " --- ", " ccc ", " hhh ", " hhh ", " hhh ", }, + { " --- ", " c~c ", " h-h ", " h-h ", " hdh ", }, + { " --- ", " ccc ", " hhh ", " hhh ", " hhh ", }, + { " ", " ", " ", " ", " ", }, })) .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1))) .addElement( 'h', lazy( - t -> buildHatchAdder(MTELargeTurbineBase.class) - .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) + t -> buildHatchAdder(MTELargeTurbineBase.class).atLeast(t.getHatchElements()) .casingIndex(t.getCasingTextureIndex()) .dot(2) .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('x', (IStructureElementCheckOnly) (aContext, aWorld, aX, aY, aZ) -> { - TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ); - return !(tTile instanceof IGregTechTileEntity) - || !(((IGregTechTileEntity) tTile).getMetaTileEntity() instanceof MTELargeTurbineBase); - }) .build(); } }; @@ -85,6 +83,12 @@ protected IStructureDefinition computeValue(Class type) protected int overflowMultiplier = 0; protected long maxPower = 0; + // client side stuff + protected boolean mHasTurbine; + // mMachine got overwritten by StructureLib extended facing query response + // so we use a separate field for this + protected boolean mFormed; + public MTELargeTurbineBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -103,6 +107,25 @@ public IStructureDefinition getStructureDefinition() { return STRUCTURE_DEFINITION.get(getClass()); } + @SuppressWarnings("unchecked") + protected IHatchElement[] getHatchElements() { + if (getPollutionPerTick(null) == 0) + return new IHatchElement[] { Maintenance, InputHatch, OutputHatch, OutputBus, InputBus }; + return new IHatchElement[] { Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler }; + } + + @Override + public boolean checkStructure(boolean aForceReset, IGregTechTileEntity aBaseMetaTileEntity) { + boolean f = super.checkStructure(aForceReset, aBaseMetaTileEntity); + if (f && getBaseMetaTileEntity().isServerSide()) { + // while is this a client side field, blockrenderer will reuse the server world for client side rendering + // so we must set it as well... + mFormed = true; + return true; + } + return f; + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { maxPower = 0; @@ -120,6 +143,47 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a public abstract int getCasingTextureIndex(); + public boolean isNewStyleRendering() { + return false; + } + + public IIconContainer[] getTurbineTextureActive() { + return TURBINE_NEW_ACTIVE; + } + + public IIconContainer[] getTurbineTextureFull() { + return TURBINE_NEW; + } + + public IIconContainer[] getTurbineTextureEmpty() { + return TURBINE_NEW_EMPTY; + } + + @Override + public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + if (!isNewStyleRendering() || !mFormed) return false; + + IIconContainer[] tTextures; + if (getBaseMetaTileEntity().isActive()) tTextures = getTurbineTextureActive(); + else if (hasTurbine()) tTextures = getTurbineTextureFull(); + else tTextures = getTurbineTextureEmpty(); + GTUtilityClient + .renderTurbineOverlay(aWorld, aX, aY, aZ, aRenderer, getExtendedFacing(), getCasingBlock(), tTextures); + return false; + } + + @Override + public void onValueUpdate(byte aValue) { + mHasTurbine = (aValue & 0x1) != 0; + mFormed = (aValue & 0x2) != 0; + super.onValueUpdate(aValue); + } + + @Override + public byte getUpdateData() { + return (byte) ((hasTurbine() ? 1 : 0) | (mMachine ? 2 : 0)); + } + @Override public boolean addToMachineList(IGregTechTileEntity tTileEntity, int aBaseCasingIndex) { return addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex()) diff --git a/src/main/java/goodgenerator/items/GGMaterial.java b/src/main/java/goodgenerator/items/GGMaterial.java index aa9aedf9bbb..82a622f166e 100644 --- a/src/main/java/goodgenerator/items/GGMaterial.java +++ b/src/main/java/goodgenerator/items/GGMaterial.java @@ -285,7 +285,8 @@ public class GGMaterial implements Runnable { .addCraftingMetalWorkingItems() .addSimpleMetalWorkingItems() .addMultipleIngotMetalWorkingItems() - .addMetaSolidifierRecipes(), + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), OffsetID + 21, TextureSet.SET_SHINY, new Pair<>(GGMaterial.orundum, 2), @@ -639,7 +640,8 @@ public class GGMaterial implements Runnable { new Werkstoff.GenerationFeatures().disable() .onlyDust() .addMolten() - .addMetalItems(), + .addMetalItems() + .addMetalCraftingSolidifierRecipes(), OffsetID + 52, TextureSet.SET_SHINY, new Pair<>(Zinc, 1), @@ -1000,6 +1002,8 @@ public class GGMaterial implements Runnable { .addMolten() .addMetalItems() .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 4), OffsetID + 81, TextureSet.SET_METALLIC, @@ -1020,6 +1024,8 @@ public class GGMaterial implements Runnable { .addMolten() .addMetalItems() .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 2), OffsetID + 82, TextureSet.SET_METALLIC, @@ -1042,6 +1048,8 @@ public class GGMaterial implements Runnable { .addMetalItems() .addCraftingMetalWorkingItems() .addSimpleMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 6), OffsetID + 83, TextureSet.SET_METALLIC, @@ -1068,6 +1076,8 @@ public class GGMaterial implements Runnable { .addCraftingMetalWorkingItems() .addSimpleMetalWorkingItems() .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 3), OffsetID + 84, TextureSet.SET_SHINY, @@ -1192,6 +1202,8 @@ public class GGMaterial implements Runnable { .addCraftingMetalWorkingItems() .addSimpleMetalWorkingItems() .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 7), OffsetID + 95, TextureSet.SET_SHINY, @@ -1219,7 +1231,9 @@ public class GGMaterial implements Runnable { .addMetalItems() .addCraftingMetalWorkingItems() .addSimpleMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), + .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), OffsetID + 96, TextureSet.SET_METALLIC, new Pair<>(marM200, 18), @@ -1248,7 +1262,9 @@ public class GGMaterial implements Runnable { new Werkstoff.GenerationFeatures().onlyDust() .addMolten() .addMetalItems() - .addCraftingMetalWorkingItems(), + .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), OffsetID + 98, TextureSet.SET_SHINY, new Pair<>(AnnealedCopper, 4), @@ -1274,7 +1290,9 @@ public class GGMaterial implements Runnable { new Werkstoff.GenerationFeatures().onlyDust() .addMolten() .addMetalItems() - .addCraftingMetalWorkingItems(), + .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes(), OffsetID + 100, TextureSet.SET_SHINY, new Pair<>(TinAlloy, 4), @@ -1292,6 +1310,8 @@ public class GGMaterial implements Runnable { .addMolten() .addMetalItems() .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 6), OffsetID + 101, TextureSet.SET_SHINY, @@ -1313,6 +1333,8 @@ public class GGMaterial implements Runnable { .addMolten() .addMetalItems() .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 5), OffsetID + 102, TextureSet.SET_METALLIC, @@ -1355,6 +1377,8 @@ public class GGMaterial implements Runnable { .addMolten() .addMetalItems() .addCraftingMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 3), OffsetID + 104, TextureSet.SET_SHINY, @@ -1449,6 +1473,8 @@ public class GGMaterial implements Runnable { .addCraftingMetalWorkingItems() .addSimpleMetalWorkingItems() .addMultipleIngotMetalWorkingItems() + .addMetaSolidifierRecipes() + .addMetalCraftingSolidifierRecipes() .addMixerRecipes((short) 4), OffsetID + 109, TextureSet.SET_METALLIC, diff --git a/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java b/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java index 5054a779ef8..d94bf5f59ee 100644 --- a/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java +++ b/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java @@ -443,7 +443,7 @@ private static void generateWrapRecipes() { .addTo(assemblerRecipes); GTValues.RA.stdBuilder() .itemInputs( - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 1), + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 16), GTUtility.getIntegratedCircuit(16)) .fluidInputs(Materials.SolderingAlloy.getMolten(72L)) .itemOutputs(new ItemStack(Loaders.circuitWrap, 1, 13)) diff --git a/src/main/java/goodgenerator/loader/Loaders.java b/src/main/java/goodgenerator/loader/Loaders.java index e3648b855dc..a3b0b6d13e0 100644 --- a/src/main/java/goodgenerator/loader/Loaders.java +++ b/src/main/java/goodgenerator/loader/Loaders.java @@ -281,7 +281,7 @@ public class Loaders { public static ItemStack CT; public static ItemStack[] LFC = new ItemStack[5]; - public static ItemStack[] NeutronAccelerators = new ItemStack[9]; + public static ItemStack[] NeutronAccelerators = new ItemStack[13]; public static ItemStack[] Generator_Diesel = new ItemStack[2]; public static ItemStack CompAssline; @@ -303,8 +303,10 @@ public static void GTMetaTileRegister() { MetaTileEntityIDs.NeutronAcceleratorLV.ID, MetaTileEntityIDs.NeutronAcceleratorMV.ID, MetaTileEntityIDs.NeutronAcceleratorHV.ID, MetaTileEntityIDs.NeutronAcceleratorEV.ID, MetaTileEntityIDs.NeutronAcceleratorIV.ID, MetaTileEntityIDs.NeutronAcceleratorLuV.ID, - MetaTileEntityIDs.NeutronAcceleratorZPM.ID, MetaTileEntityIDs.NeutronAcceleratorUV.ID, }; - for (int i = 0; i < 9; i++) { + MetaTileEntityIDs.NeutronAcceleratorZPM.ID, MetaTileEntityIDs.NeutronAcceleratorUV.ID, + MetaTileEntityIDs.NeutronAcceleratorUHV.ID, MetaTileEntityIDs.NeutronAcceleratorUEV.ID, + MetaTileEntityIDs.NeutronAcceleratorUIV.ID, MetaTileEntityIDs.NeutronAcceleratorUMV.ID, }; + for (int i = 0; i < 13; i++) { Loaders.NeutronAccelerators[i] = new MTENeutronAccelerator( neutronAcceleratorIDs[i], "Neutron Accelerator " + GTValues.VN[i], @@ -374,7 +376,7 @@ public static void GTMetaTileRegister() { "ComponentAssemblyLine", "Component Assembly Line").getStackForm(1L); CrackRecipeAdder.registerPipe(MetaTileEntityIDs.PipeIncoloy903.ID, GGMaterial.incoloy903, 15000, 8000, true); - CrackRecipeAdder.registerWire(MetaTileEntityIDs.WireSignalium.ID, GGMaterial.signalium, 12, 131072, 16, true); + CrackRecipeAdder.registerWire(MetaTileEntityIDs.WireSignalium.ID, GGMaterial.signalium, 12, 131072, 32, true); CrackRecipeAdder.registerWire(MetaTileEntityIDs.WireLumiium.ID, GGMaterial.lumiium, 8, 524288, 64, true); Loaders.AMForge = new AntimatterForge( IDs_GoodGenerator.AntimatterForge.ID, diff --git a/src/main/java/goodgenerator/loader/RecipeLoader.java b/src/main/java/goodgenerator/loader/RecipeLoader.java index 306c4c1de11..7ad35781956 100644 --- a/src/main/java/goodgenerator/loader/RecipeLoader.java +++ b/src/main/java/goodgenerator/loader/RecipeLoader.java @@ -44,6 +44,7 @@ import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.MaterialsKevlar; import gregtech.api.enums.MaterialsUEVplus; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; @@ -52,6 +53,7 @@ import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipeConstants; import gregtech.api.util.GTUtility; +import gtPlusPlus.core.material.MaterialsElements; public class RecipeLoader { @@ -1122,8 +1124,7 @@ public static void RecipeLoad() { GTOreDictUnificator.get(OrePrefixes.cableGt01, Materials.YttriumBariumCuprate, 2), GTOreDictUnificator.get(OrePrefixes.plate, Materials.NetherStar, 1), GTOreDictUnificator.get(OrePrefixes.plate, Materials.Polybenzimidazole, 4), - GTOreDictUnificator.get(OrePrefixes.plate, Materials.NeodymiumMagnetic, 4), - GTOreDictUnificator.get(OrePrefixes.plate, Materials.NeodymiumMagnetic, 4), + GTOreDictUnificator.get(OrePrefixes.plate, Materials.NeodymiumMagnetic, 8), ItemList.Electric_Motor_LuV.get(2), GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorMV, 4)) .fluidInputs(Materials.Argon.getGas(3000)) @@ -1141,8 +1142,7 @@ public static void RecipeLoad() { GTOreDictUnificator.get(OrePrefixes.cableGt01, Materials.VanadiumGallium, 2), GTOreDictUnificator.get(OrePrefixes.plate, Materials.NetherStar, 1), GTOreDictUnificator.get(OrePrefixes.plateDouble, Materials.Polybenzimidazole, 4), - GTOreDictUnificator.get(OrePrefixes.plate, Materials.SamariumMagnetic, 4), - GTOreDictUnificator.get(OrePrefixes.plate, Materials.SamariumMagnetic, 4), + GTOreDictUnificator.get(OrePrefixes.plate, Materials.SamariumMagnetic, 8), ItemList.Electric_Motor_ZPM.get(2), GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorEV, 4)) .fluidInputs(WerkstoffLoader.Xenon.getFluidOrGas(3000)) @@ -1160,9 +1160,8 @@ public static void RecipeLoad() { GTOreDictUnificator.get(OrePrefixes.cableGt01, Materials.NaquadahAlloy, 4), GTOreDictUnificator.get(OrePrefixes.plate, Materials.NetherStar, 2), GTOreDictUnificator.get(OrePrefixes.plateTriple, Materials.Polybenzimidazole, 4), - ItemList.ZPM_Coil.get(4), + ItemList.ZPM_Coil.get(8), GTOreDictUnificator.get(OrePrefixes.stickLong, Materials.NickelZincFerrite, 16), - ItemList.ZPM_Coil.get(4), ItemList.Electric_Motor_UV.get(2), GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorLuV, 4)) .fluidInputs(WerkstoffLoader.Oganesson.getFluidOrGas(3000)) @@ -1171,6 +1170,93 @@ public static void RecipeLoad() { .duration(15 * SECONDS) .addTo(AssemblyLine); + GTValues.RA.stdBuilder() + .metadata(RESEARCH_ITEM, Loaders.NeutronAccelerators[8].copy()) + .metadata(RESEARCH_TIME, 16 * MINUTES) + .itemInputs( + ItemRefer.Inverter.get(8), + ItemList.Hull_MAX.get(1L), + GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUV, 4), + GGMaterial.orundum.get(OrePrefixes.plate, 2), + GTOreDictUnificator.get(OrePrefixes.plateTriple, MaterialsKevlar.Kevlar, 8), + ItemList.UV_Coil.get(8), + GTOreDictUnificator.get(OrePrefixes.stickLong, Materials.Neutronium, 16), + ItemList.Electric_Motor_UHV.get(2), + GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorZPM, 4)) + .fluidInputs(WerkstoffLoader.Oganesson.getFluidOrGas(12000), Materials.Grade5PurifiedWater.getFluid(16000)) + .itemOutputs(Loaders.NeutronAccelerators[9].copy()) + .eut(TierEU.RECIPE_UHV) + .duration(15 * SECONDS) + .addTo(AssemblyLine); + + GTValues.RA.stdBuilder() + .metadata(RESEARCH_ITEM, Loaders.NeutronAccelerators[9].copy()) + .metadata(RESEARCH_TIME, 16 * MINUTES) + .itemInputs( + ItemRefer.Inverter.get(16), + ItemList.Hull_UEV.get(1L), + GTOreDictUnificator.get(OrePrefixes.cableGt01, Materials.Draconium, 4), + GGMaterial.orundum.get(OrePrefixes.plate, 8), + GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsKevlar.Kevlar, 16), + ItemList.UHV_Coil.get(8), + GTOreDictUnificator.get(OrePrefixes.stickLong, Materials.TengamAttuned, 16), + ItemList.Electric_Motor_UEV.get(2), + GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUV, 4)) + .fluidInputs( + GGMaterial.metastableOganesson.getMolten(3 * 144), + Materials.Grade6PurifiedWater.getFluid(16000)) + .itemOutputs(Loaders.NeutronAccelerators[10].copy()) + .eut(TierEU.RECIPE_UEV) + .duration(15 * SECONDS) + .addTo(AssemblyLine); + + GTValues.RA.stdBuilder() + .metadata(RESEARCH_ITEM, Loaders.NeutronAccelerators[10].copy()) + .metadata(RESEARCH_TIME, 16 * MINUTES) + .itemInputs( + ItemRefer.Inverter.get(32), + ItemList.Hull_UIV.get(1L), + MaterialsElements.STANDALONE.HYPOGEN.getWire01(4), + MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getPlate(8), + GTOreDictUnificator.get(OrePrefixes.plateDouble, Materials.RadoxPolymer, 16), + ItemList.Tesseract.get(8), + ItemList.Electromagnet_Tengam.get(1), + ItemList.Electric_Motor_UIV.get(2), + GTOreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 16), + GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUHV, 4)) + .fluidInputs( + GGMaterial.metastableOganesson.getMolten(12 * 144), + MaterialsUEVplus.DimensionallyShiftedSuperfluid.getFluid(4000), + Materials.Grade7PurifiedWater.getFluid(16000)) + .itemOutputs(Loaders.NeutronAccelerators[11].copy()) + .eut(TierEU.RECIPE_UIV) + .duration(15 * SECONDS) + .addTo(AssemblyLine); + + GTValues.RA.stdBuilder() + .metadata(RESEARCH_ITEM, Loaders.NeutronAccelerators[11].copy()) + .metadata(RESEARCH_TIME, 16 * MINUTES) + .itemInputs( + ItemRefer.Inverter.get(64), + ItemList.Hull_UMV.get(1L), + GTOreDictUnificator.get(OrePrefixes.wireGt01, MaterialsUEVplus.SpaceTime, 4), + MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getPlate(32), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.RadoxPolymer, 1), + ItemList.EnergisedTesseract.get(12), + ItemList.Electromagnet_Tengam.get(1), + ItemList.Electric_Motor_UMV.get(2), + GTOreDictUnificator.get(OrePrefixes.stickLong, MaterialsUEVplus.Creon, 16), + GTOreDictUnificator.get(OrePrefixes.stickLong, MaterialsUEVplus.Mellion, 16), + GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUEV, 4)) + .fluidInputs( + GGMaterial.shirabon.getMolten(3 * 144), + MaterialsUEVplus.DimensionallyShiftedSuperfluid.getFluid(8000), + Materials.Grade8PurifiedWater.getFluid(16000)) + .itemOutputs(Loaders.NeutronAccelerators[12].copy()) + .eut(TierEU.RECIPE_UMV) + .duration(15 * SECONDS) + .addTo(AssemblyLine); + GTValues.RA.stdBuilder() .itemInputs( ItemList.Casing_IV.get(1L), diff --git a/src/main/java/goodgenerator/util/CrackRecipeAdder.java b/src/main/java/goodgenerator/util/CrackRecipeAdder.java index d0ef883a5af..2c51eff9787 100644 --- a/src/main/java/goodgenerator/util/CrackRecipeAdder.java +++ b/src/main/java/goodgenerator/util/CrackRecipeAdder.java @@ -520,6 +520,12 @@ public static void registerWire(int ID, Werkstoff material, int aAmperage, int a true, false).getStackForm(1L)); } + GTValues.RA.stdBuilder() + .itemInputs(material.get(OrePrefixes.ingot, 1), GTUtility.getIntegratedCircuit(1)) + .itemOutputs(material.get(OrePrefixes.wireGt01, 2)) + .duration(5 * SECONDS) + .eut(4) + .addTo(wiremillRecipes); GTValues.RA.stdBuilder() .itemInputs(material.get(OrePrefixes.ingot, 1), GTUtility.getIntegratedCircuit(2)) .itemOutputs(material.get(OrePrefixes.wireGt02, 1)) @@ -550,6 +556,12 @@ public static void registerWire(int ID, Werkstoff material, int aAmperage, int a .duration(17 * SECONDS + 10 * TICKS) .eut(4) .addTo(wiremillRecipes); + GTValues.RA.stdBuilder() + .itemInputs(material.get(OrePrefixes.stick, 1), GTUtility.getIntegratedCircuit(1)) + .itemOutputs(material.get(OrePrefixes.wireGt01, 1)) + .duration(2 * SECONDS + 10 * TICKS) + .eut(4) + .addTo(wiremillRecipes); GTValues.RA.stdBuilder() .itemInputs(material.get(OrePrefixes.stick, 2), GTUtility.getIntegratedCircuit(2)) .itemOutputs(material.get(OrePrefixes.wireGt02, 1)) diff --git a/src/main/java/gregtech/GTMod.java b/src/main/java/gregtech/GTMod.java index 9861d35fcfb..a52a9c2013c 100644 --- a/src/main/java/gregtech/GTMod.java +++ b/src/main/java/gregtech/GTMod.java @@ -88,6 +88,7 @@ import gregtech.common.config.Other; import gregtech.common.config.Worldgen; import gregtech.common.covers.CoverFacadeAE; +import gregtech.common.items.flinttools.FlintTools; import gregtech.common.misc.GTCommand; import gregtech.common.misc.spaceprojects.commands.SPCommand; import gregtech.common.misc.spaceprojects.commands.SPMCommand; @@ -135,7 +136,7 @@ version = "MC1710", guiFactory = "gregtech.client.GTGuiFactory", dependencies = " required-after:IC2;" + " required-after:structurelib;" - + " required-after:gtnhlib@[0.2.1,);" + + " required-after:gtnhlib@[0.5.22,);" + " required-after:modularui@[1.1.12,);" + " required-after:appliedenergistics2@[rv3-beta-258,);" + " after:dreamcraft;" @@ -328,6 +329,11 @@ public void onPreLoad(FMLPreInitializationEvent aEvent) { if (FMLCommonHandler.instance() .getEffectiveSide() .isServer()) AssemblyLineServer.fillMap(aEvent); + + // Flint tool setup. + FlintTools.registerTools(); + FlintTools.registerPosteaTransformations(); + FlintTools.registerRecipes(); } @Mod.EventHandler @@ -589,8 +595,6 @@ public void onPostLoad(FMLPostInitializationEvent aEvent) { GregTechAPI.sAfterGTLoad = null; GregTechAPI.sBeforeGTPostload = null; GregTechAPI.sAfterGTPostload = null; - - GTPostLoad.createGTtoolsCreativeTab(); } @Mod.EventHandler diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index 2d2b93472a1..6910c0d72ed 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -2566,7 +2566,7 @@ public enum ItemList implements IItemContainer { Thermal_Superconductor, Relativistic_Heat_Capacitor, Phononic_Seed_Crystal, - ResearchCompleter, // Populated in EMT + ResearchCompleter, SpaceElevatorController, // Populated in GTNH-Intergalactic Spray_Color_Infinite, // semicolon after the comment to reduce merge conflicts @@ -2583,8 +2583,8 @@ public enum ItemList implements IItemContainer { Spray_Color_Used_14, Spray_Color_Used_15 }, TRANSFORMERS = { Transformer_LV_ULV, Transformer_MV_LV, Transformer_HV_MV, Transformer_EV_HV, Transformer_IV_EV, Transformer_LuV_IV, Transformer_ZPM_LuV, Transformer_UV_ZPM, Transformer_MAX_UV }, - MACHINE_HULLS = { Hull_ULV, Hull_LV, Hull_MV, Hull_HV, Hull_EV, Hull_IV, Hull_LuV, Hull_ZPM, Hull_UV, - Hull_MAX }, + MACHINE_HULLS = { Hull_ULV, Hull_LV, Hull_MV, Hull_HV, Hull_EV, Hull_IV, Hull_LuV, Hull_ZPM, Hull_UV, Hull_MAX, + Hull_UEV, Hull_UIV, Hull_UMV, Hull_UXV, Hull_MAXV }, HATCHES_DYNAMO = { Hatch_Dynamo_ULV, Hatch_Dynamo_LV, Hatch_Dynamo_MV, Hatch_Dynamo_HV, Hatch_Dynamo_EV, Hatch_Dynamo_IV, Hatch_Dynamo_LuV, Hatch_Dynamo_ZPM, Hatch_Dynamo_UV, Hatch_Dynamo_UHV }, HATCHES_ENERGY = { Hatch_Energy_ULV, Hatch_Energy_LV, Hatch_Energy_MV, Hatch_Energy_HV, Hatch_Energy_EV, diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 3493e640ff6..9417ea0aa36 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -2648,9 +2648,6 @@ private static void addHasGasFluid(Materials aMaterial) { return; } - if (aMaterial.mHasPlasma) { - GTMod.gregtechproxy.addAutogeneratedPlasmaFluid(aMaterial); - } if (aMaterial.mHasGas) { GTFluidFactory .of(aMaterial.mName.toLowerCase(), aMaterial.mDefaultLocalName, aMaterial, GAS, aMaterial.mGasTemp); diff --git a/src/main/java/gregtech/api/enums/MaterialsUEVplus.java b/src/main/java/gregtech/api/enums/MaterialsUEVplus.java index 7c14ff2f141..d974ace85e8 100644 --- a/src/main/java/gregtech/api/enums/MaterialsUEVplus.java +++ b/src/main/java/gregtech/api/enums/MaterialsUEVplus.java @@ -701,7 +701,7 @@ public class MaterialsUEVplus { 1.0F, 8 * 2621440, 26, - 1 | 2 | 64 | 128, + 1 | 2 | 32 | 64 | 128, 70, 0, 70, diff --git a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java index ad95e303b7b..2aa902b8357 100644 --- a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java +++ b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java @@ -1467,7 +1467,7 @@ public enum MetaTileEntityIDs { AcidGeneratorLV(12793), HumongousInputHatch(12799), CreativeScanner(12800), - ResearchCompleter(13001), // In EMT + ResearchCompleter(13001), sofc1(13101), sofc2(13102), tfft(13104), @@ -1476,6 +1476,7 @@ public enum MetaTileEntityIDs { WORMHOLE_GENERATOR_CONTROLLER(13115), MegaChemicalReactor(13366), MegaOilCracker(13367), + DysonSwarmController(14001), PlanetaryGasSiphonController(14002), SpaceElevatorController(14003), SpaceElevatorModuleAssemblerT1(14004), @@ -1939,7 +1940,11 @@ public enum MetaTileEntityIDs { ComponentAssemblyLine(32026), AntimatterForge(32027), WireLumiium(32737), - WireSignalium(32749),; + WireSignalium(32749), + NeutronAcceleratorUHV(32761), + NeutronAcceleratorUEV(32762), + NeutronAcceleratorUIV(32763), + NeutronAcceleratorUMV(32764),; public final int ID; diff --git a/src/main/java/gregtech/api/enums/OreMixes.java b/src/main/java/gregtech/api/enums/OreMixes.java index f012937ecc9..bb45886c21d 100644 --- a/src/main/java/gregtech/api/enums/OreMixes.java +++ b/src/main/java/gregtech/api/enums/OreMixes.java @@ -310,7 +310,7 @@ public enum OreMixes { .localize(Materials.Tungstate)), Sapphire(new OreMixBuilder().name("ore.mix.sapphire") - .heightRange(10, 40) + .heightRange(10, 25) .weight(60) .density(2) .size(16) @@ -361,7 +361,7 @@ public enum OreMixes { .localize(Materials.Diamond)), Olivine(new OreMixBuilder().name("ore.mix.olivine") - .heightRange(10, 40) + .heightRange(10, 25) .weight(60) .density(2) .size(16) @@ -466,7 +466,7 @@ public enum OreMixes { .sporadic(Materials.Titanium)), AquaIgnis(new OreMixBuilder().name("ore.mix.aquaignis") - .heightRange(5, 35) + .heightRange(5, 20) .weight(16) .density(2) .size(16) @@ -478,7 +478,7 @@ public enum OreMixes { .localize(Materials.InfusedWater, Materials.InfusedFire, Materials.Amber)), TerraAer(new OreMixBuilder().name("ore.mix.terraaer") - .heightRange(5, 35) + .heightRange(5, 20) .weight(16) .density(2) .size(16) @@ -491,7 +491,7 @@ public enum OreMixes { .localize(Materials.InfusedEarth, Materials.InfusedAir)), PerditioOrdo(new OreMixBuilder().name("ore.mix.perditioordo") - .heightRange(5, 35) + .heightRange(5, 20) .weight(16) .density(2) .size(16) @@ -896,7 +896,7 @@ public enum OreMixes { .sporadic(Materials.MeteoricIron)), TFGalena(new OreMixBuilder().name("ore.mix.tfgalena") - .heightRange(5, 35) + .heightRange(5, 20) .weight(40) .density(4) .size(16) diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 73a502bf4e8..159e0461881 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -240,35 +240,11 @@ public enum OrePrefixes { bulletGtLarge("Large Bullets", "Large ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 3, 64, -1), /** consisting out of 2 Ingots. */ - toolHeadSword("Sword Blades", "", " Sword Blade", true, true, false, false, false, false, true, true, false, false, - B[6], M * 2, 64, 32), - /** consisting out of 3 Ingots. */ - toolHeadPickaxe("Pickaxe Heads", "", " Pickaxe Head", true, true, false, false, false, false, true, true, false, - false, B[6], M * 3, 64, 33), - /** consisting out of 1 Ingots. */ - toolHeadShovel("Shovel Heads", "", " Shovel Head", true, true, false, false, false, false, true, true, false, false, - B[6], M * 1, 64, 34), - /** consisting out of 1 Ingots. */ - toolHeadUniversalSpade("Universal Spade Heads", "", " Universal Spade Head", true, true, false, false, false, false, - true, true, false, false, B[6], M * 1, 64, 43), - /** consisting out of 3 Ingots. */ - toolHeadAxe("Axe Heads", "", " Axe Head", true, true, false, false, false, false, true, true, false, false, B[6], - M * 3, 64, 35), - /** consisting out of 2 Ingots. */ - toolHeadHoe("Hoe Heads", "", " Hoe Head", true, true, false, false, false, false, true, true, false, false, B[6], - M * 2, 64, 36), - /** consisting out of 3 Ingots. */ - toolHeadSense("Sense Blades", "", " Sense Blade", true, true, false, false, false, false, true, true, false, false, - B[6], M * 3, 64, 44), - /** consisting out of 2 Ingots. */ toolHeadFile("File Heads", "", " File Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 64, 38), /** consisting out of 6 Ingots. */ toolHeadHammer("Hammer Heads", "", " Hammer Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 64, 37), - /** consisting out of 4 Ingots. */ - toolHeadPlow("Plow Heads", "", " Plow Head", true, true, false, false, false, false, true, true, false, false, B[6], - M * 4, 64, 45), /** consisting out of 2 Ingots. */ toolHeadSaw("Saw Blades", "", " Saw Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 64, 39), @@ -616,7 +592,10 @@ public enum OrePrefixes { false, false, 0, M * 1, 64, -1), // subatomic particles particle("A Subatomic Particle", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, - 64, -1); + 64, -1), + // Beamline Masks + mask("A Photolithographic Mask", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, + 1, -1); public static final ImmutableList CELL_TYPES = ImmutableList.of( cell, @@ -1092,20 +1071,12 @@ public enum OrePrefixes { OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.foil, - OrePrefixes.toolHeadSword, - OrePrefixes.toolHeadPickaxe, - OrePrefixes.toolHeadShovel, - OrePrefixes.toolHeadAxe, - OrePrefixes.toolHeadHoe, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, - OrePrefixes.toolHeadUniversalSpade, - OrePrefixes.toolHeadSense, - OrePrefixes.toolHeadPlow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, OrePrefixes.wireFine, diff --git a/src/main/java/gregtech/api/enums/SoundResource.java b/src/main/java/gregtech/api/enums/SoundResource.java index f262dc2619a..ec2327e04ef 100644 --- a/src/main/java/gregtech/api/enums/SoundResource.java +++ b/src/main/java/gregtech/api/enums/SoundResource.java @@ -70,7 +70,7 @@ public enum SoundResource { GT_MACHINES_PURIFICATION_PH_LOOP(237, GregTech.ID, "machines.PurificationPhLoop"), GT_MACHINES_COAGULATION_LOOP(238, GregTech.ID, "machines.PurificationCoagulationLoop"), GT_MACHINES_OZONATION_LOOP(239, GregTech.ID, "machines.PurificationOzonationLoop"), - GT_MACHINES_PURIFICATION_PLASMA_LOOP(240, "machines.PurificationPlasmaLoop"), + GT_MACHINES_PURIFICATION_PLASMA_LOOP(240, GregTech.ID, "machines.PurificationPlasmaLoop"), GT_MACHINES_MULTI_LATHE_LOOP(241, GregTech.ID, "machines.MultiLatheLoop"), GT_MACHINES_MULTI_AUTOCLAVE_LOOP(242, GregTech.ID, "machines.MultiAutoclaveLoop"), diff --git a/src/main/java/gregtech/api/enums/TextureSet.java b/src/main/java/gregtech/api/enums/TextureSet.java index 4a13dcc9b4f..7abb799e210 100644 --- a/src/main/java/gregtech/api/enums/TextureSet.java +++ b/src/main/java/gregtech/api/enums/TextureSet.java @@ -34,20 +34,20 @@ public class TextureSet { "/dustPure", "/crushed", "/crushedPurified", "/crushedCentrifuged", "/gem", "/nugget", "/casingSmall", "/ingot", "/ingotHot", "/ingotDouble", "/ingotTriple", "/ingotQuadruple", "/ingotQuintuple", "/plate", "/plateDouble", "/plateTriple", "/plateQuadruple", "/plateQuintuple", "/plateDense", "/stick", "/lens", "/round", "/bolt", - "/screw", "/ring", "/foil", "/cell", "/cellPlasma", "/toolHeadSword", "/toolHeadPickaxe", "/toolHeadShovel", - "/toolHeadAxe", "/toolHeadHoe", "/toolHeadHammer", "/toolHeadFile", "/toolHeadSaw", "/toolHeadDrill", - "/toolHeadChainsaw", "/toolHeadWrench", "/toolHeadUniversalSpade", "/toolHeadSense", "/toolHeadPlow", - "/toolHeadArrow", "/toolHeadScrewdriver", "/toolHeadBuzzSaw", "/toolHeadSoldering", "/nanites", "/wireFine", - "/gearGtSmall", "/rotor", "/stickLong", "/springSmall", "/spring", "/arrowGtWood", "/arrowGtPlastic", - "/gemChipped", "/gemFlawed", "/gemFlawless", "/gemExquisite", "/gearGt", "/oreRaw", aTextVoidDir, aTextVoidDir, - "/oreSmall", "/ore", "/wire", "/foil", "/block1", "/block2", "/block3", "/block4", "/block5", "/block6", - "/pipeSide", "/pipeTiny", "/pipeSmall", "/pipeMedium", "/pipeLarge", "/pipeHuge", "/frameGt", "/pipeQuadruple", - "/pipeNonuple", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, - aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, "/crateGtDust", "/crateGtIngot", "/crateGtGem", - "/crateGtPlate", "/turbineBlade", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + "/screw", "/ring", "/foil", "/cell", "/cellPlasma", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + aTextVoidDir, "/toolHeadHammer", "/toolHeadFile", "/toolHeadSaw", "/toolHeadDrill", "/toolHeadChainsaw", + "/toolHeadWrench", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, "/toolHeadScrewdriver", + "/toolHeadBuzzSaw", "/toolHeadSoldering", "/nanites", "/wireFine", "/gearGtSmall", "/rotor", "/stickLong", + "/springSmall", "/spring", "/arrowGtWood", "/arrowGtPlastic", "/gemChipped", "/gemFlawed", "/gemFlawless", + "/gemExquisite", "/gearGt", "/oreRaw", aTextVoidDir, aTextVoidDir, "/oreSmall", "/ore", "/wire", "/foil", + "/block1", "/block2", "/block3", "/block4", "/block5", "/block6", "/pipeSide", "/pipeTiny", "/pipeSmall", + "/pipeMedium", "/pipeLarge", "/pipeHuge", "/frameGt", "/pipeQuadruple", "/pipeNonuple", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + aTextVoidDir, "/crateGtDust", "/crateGtIngot", "/crateGtGem", "/crateGtPlate", "/turbineBlade", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, - aTextVoidDir, aTextVoidDir, aTextVoidDir, "/plateSuperdense", "/handleMallet", "/toolHeadMallet", }; + aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + "/plateSuperdense", "/handleMallet", "/toolHeadMallet", }; public boolean is_custom = false; diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 92a213fb30b..cf8750fe197 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -1451,6 +1451,8 @@ public enum BlockIcons implements IIconContainer, Runnable { BLOCK_QUARK_CONTAINMENT_CASING, COMPRESSOR_CASING, COMPRESSOR_PIPE_CASING, + HEATING_DUCT_CASING, + COOLANT_DUCT_CASING, NEUTRONIUM_CASING, NEUTRONIUM_ACTIVE_CASING, NEUTRONIUM_STABLE_CASING, diff --git a/src/main/java/gregtech/api/gui/modularui/GTUITextures.java b/src/main/java/gregtech/api/gui/modularui/GTUITextures.java index 2e0fc114d9e..499f043af18 100644 --- a/src/main/java/gregtech/api/gui/modularui/GTUITextures.java +++ b/src/main/java/gregtech/api/gui/modularui/GTUITextures.java @@ -537,6 +537,7 @@ public static FallbackableUITexture fallbackableProgressbar(String name, UITextu public static final UITexture PICTURE_SLOTS_HOLO_3BY3 = UITexture .fullImage(GregTech.ID, "gui/picture/slots_holo_3by3"); public static final UITexture PICTURE_ARROW_DOUBLE = UITexture.fullImage(GregTech.ID, "gui/picture/arrow_double"); + public static final UITexture PICTURE_ARROW_GRAY = UITexture.fullImage(GregTech.ID, "gui/picture/arrow_gray"); public static final UITexture PICTURE_SUPER_BUFFER = UITexture.fullImage(GregTech.ID, "gui/picture/super_buffer"); public static final UITexture PICTURE_SQUARE_LIGHT_GRAY = UITexture .fullImage(GregTech.ID, "gui/picture/square_light_gray"); diff --git a/src/main/java/gregtech/api/interfaces/ITemporaryTE.java b/src/main/java/gregtech/api/interfaces/ITemporaryTE.java new file mode 100644 index 00000000000..581137ca603 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/ITemporaryTE.java @@ -0,0 +1,4 @@ +package gregtech.api.interfaces; + +public interface ITemporaryTE { +} diff --git a/src/main/java/gregtech/api/items/MetaGeneratedTool.java b/src/main/java/gregtech/api/items/MetaGeneratedTool.java index eaa1fe7c8d5..4c9cdf39ae8 100644 --- a/src/main/java/gregtech/api/items/MetaGeneratedTool.java +++ b/src/main/java/gregtech/api/items/MetaGeneratedTool.java @@ -43,7 +43,6 @@ import cpw.mods.fml.relauncher.SideOnly; import crazypants.enderio.api.tool.ITool; import forestry.api.arboriculture.IToolGrafter; -import gregtech.GTMod; import gregtech.api.GregTechAPI; import gregtech.api.enchants.EnchantmentRadioactivity; import gregtech.api.enums.Materials; @@ -649,6 +648,15 @@ public final boolean doDamageToItem(ItemStack aStack, int aVanillaDamage) { return doDamage(aStack, aVanillaDamage * 100L); } + private static boolean playSound = true; + + public final boolean doDamageNoSound(ItemStack aStack, long aAmount) { + playSound = false; + boolean ret = doDamage(aStack, aAmount); + playSound = true; + return ret; + } + public final boolean doDamage(ItemStack aStack, long aAmount) { if (!isItemStackUsable(aStack)) return false; Long[] tElectric = getElectricStats(aStack); @@ -658,7 +666,7 @@ public final boolean doDamage(ItemStack aStack, long aAmount) { if (tNewDamage >= getToolMaxDamage(aStack)) { IToolStats tStats = getToolStats(aStack); if (tStats == null || GTUtility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { - if (tStats != null) GTUtility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); + if (tStats != null && playSound) GTUtility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); if (aStack.stackSize > 0) aStack.stackSize--; } } @@ -672,7 +680,7 @@ public final boolean doDamage(ItemStack aStack, long aAmount) { if (tNewDamage >= getToolMaxDamage(aStack)) { IToolStats tStats = getToolStats(aStack); if (tStats == null || GTUtility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { - if (tStats != null) GTUtility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); + if (tStats != null && playSound) GTUtility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); if (aStack.stackSize > 0) aStack.stackSize--; } } @@ -731,13 +739,12 @@ private ItemStack getContainerItem(ItemStack aStack, boolean playSound) { aStack = GTUtility.copyAmount(1, aStack); IToolStats tStats = getToolStats(aStack); if (tStats == null) return null; - doDamage(aStack, tStats.getToolDamagePerContainerCraft()); - aStack = aStack.stackSize > 0 ? aStack : null; - if (playSound && GTMod.gregtechproxy.mTicksUntilNextCraftSound <= 0) { - GTMod.gregtechproxy.mTicksUntilNextCraftSound = 10; - String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound(); - GTUtility.doSoundAtClient(sound, 1, 1.0F); + if (playSound) { + doDamage(aStack, tStats.getToolDamagePerContainerCraft()); + } else { + doDamageNoSound(aStack, tStats.getToolDamagePerContainerCraft()); } + aStack = aStack.stackSize > 0 ? aStack : null; return aStack; } diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 0ef1d196e93..d2d9f429b72 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -32,12 +32,14 @@ import gregtech.api.graphs.Lock; import gregtech.api.graphs.Node; import gregtech.api.graphs.paths.NodePath; +import gregtech.api.interfaces.ITemporaryTE; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IConnectable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IDebugableTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity; +import gregtech.api.net.GTPacketCreateTE; import gregtech.api.net.GTPacketTileEntity; import gregtech.api.objects.GTItemStack; import gregtech.api.util.CoverBehaviorBase; @@ -294,30 +296,56 @@ && getMetaTileEntity().doTickProfilingMessageDuringThisTick() private void sendClientData() { if (mSendClientData) { - NW.sendPacketToAllPlayersInRange( - worldObj, - new GTPacketTileEntity( + if (mMetaTileEntity instanceof ITemporaryTE) { + NW.sendPacketToAllPlayersInRange( + worldObj, + new GTPacketCreateTE( + xCoord, + (short) yCoord, + zCoord, + mID, + getCoverInfoAtSide(ForgeDirection.DOWN).getCoverID(), + getCoverInfoAtSide(ForgeDirection.UP).getCoverID(), + getCoverInfoAtSide(ForgeDirection.NORTH).getCoverID(), + getCoverInfoAtSide(ForgeDirection.SOUTH).getCoverID(), + getCoverInfoAtSide(ForgeDirection.WEST).getCoverID(), + getCoverInfoAtSide(ForgeDirection.EAST).getCoverID(), + oTextureData = mConnections, + oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, + oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)), + oColor = mColor), xCoord, - (short) yCoord, - zCoord, - mID, - getCoverInfoAtSide(ForgeDirection.DOWN).getCoverID(), - getCoverInfoAtSide(ForgeDirection.UP).getCoverID(), - getCoverInfoAtSide(ForgeDirection.NORTH).getCoverID(), - getCoverInfoAtSide(ForgeDirection.SOUTH).getCoverID(), - getCoverInfoAtSide(ForgeDirection.WEST).getCoverID(), - getCoverInfoAtSide(ForgeDirection.EAST).getCoverID(), - oTextureData = mConnections, - oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, - oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)), - oColor = mColor), - xCoord, - zCoord); - mSendClientData = false; + zCoord); + } else { + NW.sendPacketToAllPlayersInRange( + worldObj, + new GTPacketTileEntity( + xCoord, + (short) yCoord, + zCoord, + mID, + getCoverInfoAtSide(ForgeDirection.DOWN).getCoverID(), + getCoverInfoAtSide(ForgeDirection.UP).getCoverID(), + getCoverInfoAtSide(ForgeDirection.NORTH).getCoverID(), + getCoverInfoAtSide(ForgeDirection.SOUTH).getCoverID(), + getCoverInfoAtSide(ForgeDirection.WEST).getCoverID(), + getCoverInfoAtSide(ForgeDirection.EAST).getCoverID(), + oTextureData = mConnections, + oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, + oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)), + oColor = mColor), + xCoord, + zCoord); + mSendClientData = false; + } } sendCoverDataIfNeeded(); } diff --git a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java index 7669cf8b27b..c9376504f60 100644 --- a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java @@ -746,7 +746,8 @@ protected List getCoverTabTooltip(ForgeDirection side, ISerializableObje if (coverItem == null) return Collections.emptyList(); final boolean coverHasGUI = coverInfo.hasCoverGUI(); - final List tooltip = coverItem.getTooltip(Minecraft.getMinecraft().thePlayer, true); + final Minecraft mc = Minecraft.getMinecraft(); + final List tooltip = coverItem.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips); final ImmutableList.Builder builder = ImmutableList.builder(); builder.add( (coverHasGUI ? EnumChatFormatting.UNDERLINE : EnumChatFormatting.DARK_GRAY) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java index 512552e9f06..345ce96dbc2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java @@ -121,6 +121,7 @@ protected void setAlignmentLimits(IAlignmentLimits mLimits) { * IStructureDefinition is expected to be evaluated against current instance only, and should not be used against * other instances, even for those of the same class. */ + @Override public abstract IStructureDefinition getStructureDefinition(); protected abstract MultiblockTooltipBuilder createTooltip(); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEFrame.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEFrame.java index ec000b6e9c1..483d8573b8c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEFrame.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEFrame.java @@ -7,6 +7,7 @@ import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITemporaryTE; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -14,7 +15,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GTLanguageManager; -public class MTEFrame extends MetaPipeEntity { +public class MTEFrame extends MetaPipeEntity implements ITemporaryTE { private static final String localizedDescFormat = GTLanguageManager .addStringLocalization("gt.blockmachines.gt_frame.desc.format", "Just something you can put covers on."); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMaintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMaintenance.java index b617c954f74..38d76ab6afb 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMaintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMaintenance.java @@ -176,8 +176,8 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, ForgeDirection side, float aX, float aY, float aZ) { - if (aBaseMetaTileEntity.isClientSide()) return true; if (side == aBaseMetaTileEntity.getFrontFacing()) { + if (aBaseMetaTileEntity.isClientSide()) return true; // only allow OC robot fake player if (aPlayer instanceof FakePlayer && !aPlayer.getGameProfile() .getName() diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index 1e29d797a49..faa799a4e5c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -4,6 +4,7 @@ import static gregtech.api.enums.GTValues.VN; import static gregtech.api.util.GTUtility.filterValidMTEs; import static gregtech.api.util.GTUtility.formatNumbers; +import static gregtech.api.util.GTUtility.min; import static gregtech.api.util.GTUtility.validMTEList; import static mcp.mobius.waila.api.SpecialChars.GREEN; import static mcp.mobius.waila.api.SpecialChars.RED; @@ -19,6 +20,7 @@ import java.util.Map; import java.util.Optional; import java.util.function.LongConsumer; +import java.util.stream.Collectors; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -39,6 +41,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.TestOnly; @@ -110,6 +113,7 @@ import gregtech.common.tileentities.machines.MTEHatchOutputBusME; import gregtech.common.tileentities.machines.MTEHatchOutputME; import gregtech.common.tileentities.machines.multi.MTELargeTurbine; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSteamBusInput; import it.unimi.dsi.fastutil.objects.Object2ReferenceOpenHashMap; import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap; import mcp.mobius.waila.api.IWailaConfigHandler; @@ -884,7 +888,10 @@ protected CheckRecipeResult doCheckRecipe() { for (IDualInputHatch dualInputHatch : mDualInputHatches) { for (var it = dualInputHatch.inventories(); it.hasNext();) { IDualInputInventory slot = it.next(); - processingLogic.setInputItems(slot.getItemInputs()); + // Reverse order of input items for consistent behavior with standard input buses. + ItemStack[] inputItems = slot.getItemInputs(); + ArrayUtils.reverse(inputItems); + processingLogic.setInputItems(inputItems); processingLogic.setInputFluids(slot.getFluidInputs()); CheckRecipeResult foundResult = processingLogic.process(); if (foundResult.wasSuccessful()) { @@ -1008,6 +1015,8 @@ public int getPollutionPerTick(ItemStack aStack) { /** * Gets the pollution produced per second by this multiblock, default to 0. Override this with its actual value in * the code of the multiblock. + * + * This returns the unmodified raw pollution value, not the one after muffler discounts. */ public int getPollutionPerSecond(ItemStack aStack) { return 0; @@ -1319,6 +1328,11 @@ protected static boolean dumpFluid(List aOutputHatches, FluidSta continue; } if (!tHatch.canStoreFluid(copiedFluidStack)) continue; + + if (tHatch instanceof MTEHatchOutputME tMEHatch) { + if (!tMEHatch.canAcceptFluid()) continue; + } + int tAmount = tHatch.fill(copiedFluidStack, false); if (tAmount >= copiedFluidStack.amount) { boolean filled = tHatch.fill(copiedFluidStack, true) >= copiedFluidStack.amount; @@ -1809,6 +1823,7 @@ public boolean addInputBusToMachineList(IGregTechTileEntity aTileEntity, int aBa hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mDualInputHatches.add(hatch); } + if (aMetaTileEntity instanceof MTEHatchSteamBusInput) return false; if (aMetaTileEntity instanceof ISmartInputHatch hatch) { mSmartInputHatches.add(hatch); } @@ -2003,6 +2018,32 @@ public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDat GTUtility.getColoredTierNameFromVoltage(-actualEnergyUsage))); } } + + int outputItemLength = tag.getInteger("outputItemLength"); + int outputFluidLength = tag.getInteger("outputFluidLength"); + int totalOutputs = outputItemLength + outputFluidLength; + if (totalOutputs > 0) { + currentTip.add(StatCollector.translateToLocal("GT5U.waila.producing")); + for (int i = 0; i < min(3, outputItemLength); i++) { + currentTip.add( + " " + tag.getString("outputItem" + i) + + " x " + + formatNumbers(tag.getInteger("outputItemCount" + i))); + } + for (int i = 0; i < min(3 - outputItemLength, outputFluidLength); i++) { + currentTip.add( + " " + tag.getString("outputFluid" + i) + + " x " + + formatNumbers(tag.getInteger("outputFluidCount" + i)) + + "L"); + } + if (totalOutputs > 3) { + currentTip.add( + StatCollector.translateToLocalFormatted( + "GT5U.waila.producing.andmore", + formatNumbers((totalOutputs - 3)))); + } + } } currentTip .add(GTWaila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress"))); @@ -2030,6 +2071,21 @@ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompou tag.setInteger("maxProgress", mMaxProgresstime); tag.setBoolean("incompleteStructure", (getBaseMetaTileEntity().getErrorDisplayID() & 64) != 0); + if (mOutputItems != null) { + tag.setInteger("outputItemLength", mOutputItems.length); + for (int i = 0; i < mOutputItems.length; i++) { + tag.setString("outputItem" + i, mOutputItems[i].getDisplayName()); + tag.setInteger("outputItemCount" + i, mOutputItems[i].stackSize); + } + } + if (mOutputFluids != null) { + tag.setInteger("outputFluidLength", mOutputFluids.length); + for (int i = 0; i < mOutputFluids.length; i++) { + tag.setString("outputFluid" + i, mOutputFluids[i].getLocalizedName()); + tag.setInteger("outputFluidCount" + i, mOutputFluids[i].amount); + } + } + final IGregTechTileEntity tileEntity = getBaseMetaTileEntity(); if (tileEntity != null) { tag.setBoolean("isActive", tileEntity.isActive()); @@ -2451,9 +2507,9 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont drawTexts(screenElements, inventorySlot); builder.widget( new Scrollable().setVerticalScroll() - .widget(screenElements.setPos(10, 0)) - .setPos(0, 7) - .setSize(190, 79)); + .widget(screenElements) + .setPos(10, 7) + .setSize(182, 79)); setMachineModeIcons(); builder.widget(createPowerSwitchButton(builder)) @@ -2507,12 +2563,12 @@ protected String generateCurrentRecipeInfoString() { }; int lines = 0; - int MAX_LINES = 5; + int MAX_LINES = 10; if (mOutputItems != null) { HashMap nameToAmount = new HashMap<>(); for (var item : mOutputItems) { - if (item == null) continue; + if (item == null || item.stackSize <= 0) continue; nameToAmount.merge(item.getDisplayName(), (long) item.stackSize, Long::sum); } for (Map.Entry entry : nameToAmount.entrySet()) { @@ -2535,7 +2591,7 @@ protected String generateCurrentRecipeInfoString() { if (mOutputFluids != null) { HashMap nameToAmount = new HashMap<>(); for (var fluid : mOutputFluids) { - if (fluid == null) continue; + if (fluid == null || fluid.amount <= 0) continue; nameToAmount.merge(fluid.getLocalizedName(), (long) fluid.amount, Long::sum); } for (Map.Entry entry : nameToAmount.entrySet()) { @@ -2561,54 +2617,70 @@ protected String generateCurrentRecipeInfoString() { protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { screenElements.setSynced(false) - .setSpace(0) - .setPos(10, 7); + .setSpace(0); if (supportsMachineModeSwitch()) { screenElements.widget( - TextWidget.dynamicString( - () -> EnumChatFormatting.WHITE + GTUtility.trans("400", "Running mode: ") - + EnumChatFormatting.GOLD - + getMachineModeName())); + TextWidget + .dynamicString( + () -> EnumChatFormatting.WHITE + GTUtility.trans("400", "Running mode: ") + + EnumChatFormatting.GOLD + + getMachineModeName()) + .setTextAlignment(Alignment.CenterLeft)); } screenElements .widget( - new TextWidget(GTUtility.trans("132", "Pipe is loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("132", "Pipe is loose. (Wrench)")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mWrench)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); screenElements .widget( - new TextWidget(GTUtility.trans("133", "Screws are loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("133", "Screws are loose. (Screwdriver)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mScrewdriver)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); screenElements .widget( - new TextWidget(GTUtility.trans("134", "Something is stuck.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("134", "Something is stuck. (Soft Mallet)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mSoftHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); screenElements .widget( - new TextWidget(GTUtility.trans("135", "Platings are dented.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("135", "Platings are dented. (Hammer)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mHardHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); screenElements .widget( - new TextWidget(GTUtility.trans("136", "Circuitry burned out.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("136", "Circuitry burned out. (Soldering)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mSolderingTool)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); - screenElements.widget( - new TextWidget(GTUtility.trans("137", "That doesn't belong there.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mCrowbar)) + screenElements + .widget( + new TextWidget(GTUtility.trans("137", "That doesn't belong there. (Crowbar)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mCrowbar)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); screenElements .widget( - new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mMachine)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); screenElements.widget( - new TextWidget("Too Uncertain.").setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget("Too Uncertain.").setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 128) != 0)); screenElements.widget( - new TextWidget("Invalid Parameters.").setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget("Invalid Parameters.").setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 256) != 0)); screenElements.widget( @@ -2645,6 +2717,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve time.getSeconds() % 60); }) .setSynced(false) + .setTextAlignment(Alignment.CenterLeft) .setEnabled( widget -> shouldDisplayShutDownReason() && !getBaseMetaTileEntity().isActive() && getBaseMetaTileEntity().wasShutdown())) @@ -2693,7 +2766,18 @@ && getBaseMetaTileEntity().wasShutdown())) || (mOutputItems != null && mOutputItems.length > 0))) .widget( new FakeSyncWidget.ListSyncer<>( - () -> mOutputFluids != null ? Arrays.asList(mOutputFluids) : Collections.emptyList(), + () -> mOutputFluids != null ? Arrays.stream(mOutputFluids) + .map(fluidStack -> { + if (fluidStack == null) return null; + return new FluidStack(fluidStack, fluidStack.amount) { + + @Override + public boolean isFluidEqual(FluidStack other) { + return super.isFluidEqual(other) && amount == other.amount; + } + }; + }) + .collect(Collectors.toList()) : Collections.emptyList(), val -> mOutputFluids = val.toArray(new FluidStack[0]), NetworkUtils::writeFluidStack, NetworkUtils::readFluidStack)) @@ -2708,7 +2792,8 @@ && getBaseMetaTileEntity().wasShutdown())) } screenElements.widget( - new TextWidget(GTUtility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("144", "Missing Turbine Rotor")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> { if (getBaseMetaTileEntity().isAllowedToWork()) return false; if (getBaseMetaTileEntity().getErrorDisplayID() == 0 && this instanceof MTELargeTurbine) { diff --git a/src/main/java/gregtech/api/net/GTPacketCreateTE.java b/src/main/java/gregtech/api/net/GTPacketCreateTE.java new file mode 100644 index 00000000000..c0b1c26e18d --- /dev/null +++ b/src/main/java/gregtech/api/net/GTPacketCreateTE.java @@ -0,0 +1,212 @@ +package gregtech.api.net; + +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +import org.jetbrains.annotations.NotNull; + +import com.google.common.io.ByteArrayDataInput; + +import gregtech.GTMod; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import io.netty.buffer.ByteBuf; + +public class GTPacketCreateTE extends GTPacket { + + private int mX, mZ, mC0, mC1, mC2, mC3, mC4, mC5; + private short mY, mID, mRID; + private byte mTexture, mTexturePage, mUpdate, mRedstone, mColor; + + public GTPacketCreateTE() { + super(); + } + + public GTPacketCreateTE(int aX, short aY, int aZ, short aRID, short aID, int aC0, int aC1, int aC2, int aC3, + int aC4, int aC5, byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { + super(); + mX = aX; + mY = aY; + mZ = aZ; + mC0 = aC0; + mC1 = aC1; + mC2 = aC2; + mC3 = aC3; + mC4 = aC4; + mC5 = aC5; + mRID = aRID; + mID = aID; + mTexture = aTexture; + mTexturePage = aTexturePage; + mUpdate = aUpdate; + mRedstone = aRedstone; + mColor = aColor; + } + + public GTPacketCreateTE(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, int aC5, + byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { + this( + aX, + aY, + aZ, + (short) 0, + aID, + aC0, + aC1, + aC2, + aC3, + aC4, + aC5, + aTexture, + aTexturePage, + aUpdate, + aRedstone, + aColor); + } + + public GTPacketCreateTE(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, int aC5, + byte aTexture, byte aUpdate, byte aRedstone, byte aColor) { + this(aX, aY, aZ, (short) 0, aID, aC0, aC1, aC2, aC3, aC4, aC5, aTexture, (byte) 0, aUpdate, aRedstone, aColor); + } + + @Override + public byte getPacketID() { + return GTPacketTypes.CREATE_TILE_ENTITY.id; + } + + @Override + public void encode(ByteBuf aOut) { + aOut.writeInt(mX); + aOut.writeShort(mY); + aOut.writeInt(mZ); + + aOut.writeShort(mRID); + aOut.writeShort(mID); + + aOut.writeInt(mC0); + aOut.writeInt(mC1); + aOut.writeInt(mC2); + aOut.writeInt(mC3); + aOut.writeInt(mC4); + aOut.writeInt(mC5); + + aOut.writeByte(mTexture); + aOut.writeByte(mTexturePage); + aOut.writeByte(mUpdate); + aOut.writeByte(mRedstone); + aOut.writeByte(mColor); + } + + @Override + public GTPacket decode(ByteArrayDataInput aData) { + return new GTPacketCreateTE( + // Coords + aData.readInt(), + aData.readShort(), + aData.readInt(), + // Registry & ID + aData.readShort(), + aData.readShort(), + // Covers + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + // Everything else + aData.readByte(), + aData.readByte(), + aData.readByte(), + aData.readByte(), + aData.readByte()); + } + + @Override + public void process(IBlockAccess world) { + if (world == null) return; + if (world instanceof WorldClient) { + final TileEntity tileEntity = world.getTileEntity(mX, mY, mZ); + if (tileEntity == null) { + try { + if (mTexturePage != 0) // It's a MetaTileEntity + { + BaseMetaTileEntity newTileEntity = getBaseMetaTileEntity(); + ((WorldClient) world).setTileEntity(mX, mY, mZ, newTileEntity); + } else // Otherwise it's a MetaPipeEntity + { + BaseMetaPipeEntity newTileEntity = getBaseMetaPipeEntity(); + ((WorldClient) world).setTileEntity(mX, mY, mZ, newTileEntity); + } + } catch (Exception e) { + GTMod.GT_FML_LOGGER.error("Exception creating Tile Entity at ({}, {}, {})", mX, mY, mZ); + } + } else { + try { + if (tileEntity instanceof BaseMetaTileEntity) + ((BaseMetaTileEntity) tileEntity).receiveMetaTileEntityData( + mID, + mC0, + mC1, + mC2, + mC3, + mC4, + mC5, + mTexture, + mTexturePage, + mUpdate, + mRedstone, + mColor); + else if (tileEntity instanceof BaseMetaPipeEntity) + ((BaseMetaPipeEntity) tileEntity).receiveMetaTileEntityData( + mID, + mC0, + mC1, + mC2, + mC3, + mC4, + mC5, + mTexture, + mUpdate, + mRedstone, + mColor); + } catch (Exception e) { + GTMod.GT_FML_LOGGER.error( + "Exception setting tile entity data for tile entity {} at ({}, {}, {})", + tileEntity, + mX, + mY, + mZ); + } + } + } + } + + @NotNull + private BaseMetaPipeEntity getBaseMetaPipeEntity() { + BaseMetaPipeEntity newTileEntity = new BaseMetaPipeEntity(); + newTileEntity + .receiveMetaTileEntityData(mID, mC0, mC1, mC2, mC3, mC4, mC5, mTexture, mUpdate, mRedstone, mColor); + return newTileEntity; + } + + @NotNull + private BaseMetaTileEntity getBaseMetaTileEntity() { + BaseMetaTileEntity newTileEntity = new BaseMetaTileEntity(); + newTileEntity.receiveMetaTileEntityData( + mID, + mC0, + mC1, + mC2, + mC3, + mC4, + mC5, + mTexture, + mTexturePage, + mUpdate, + mRedstone, + mColor); + return newTileEntity; + } +} diff --git a/src/main/java/gregtech/api/net/GTPacketNodeInfo.java b/src/main/java/gregtech/api/net/GTPacketNodeInfo.java new file mode 100644 index 00000000000..6d0a0648196 --- /dev/null +++ b/src/main/java/gregtech/api/net/GTPacketNodeInfo.java @@ -0,0 +1,68 @@ +package gregtech.api.net; + +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +import com.google.common.io.ByteArrayDataInput; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.tileentities.machines.multi.MTEResearchCompleter; +import io.netty.buffer.ByteBuf; + +public class GTPacketNodeInfo extends GTPacket { + + private int mBlockX, mBlockY, mBlockZ, mDim, nodeDistance, nodeColor; + + public GTPacketNodeInfo() { + super(); + } + + public GTPacketNodeInfo(int mBlockX, int mBlockY, int mBlockZ, int mDim, int nodeDistance, int nodeColor) { + this.mBlockX = mBlockX; + this.mBlockY = mBlockY; + this.mBlockZ = mBlockZ; + this.mDim = mDim; + this.nodeDistance = nodeDistance; + this.nodeColor = nodeColor; + } + + @Override + public byte getPacketID() { + return GTPacketTypes.NODE_INFO.id; + } + + @Override + public void encode(ByteBuf buf) { + buf.writeInt(mBlockX); + buf.writeInt(mBlockY); + buf.writeInt(mBlockZ); + buf.writeInt(mDim); + buf.writeInt(nodeDistance); + buf.writeInt(nodeColor); + } + + @Override + public GTPacket decode(ByteArrayDataInput buf) { + return new GTPacketNodeInfo( + buf.readInt(), + buf.readInt(), + buf.readInt(), + buf.readInt(), + buf.readInt(), + buf.readInt()); + } + + @Override + public void process(IBlockAccess world) { + if (world instanceof WorldClient worldClient) { + if (worldClient.blockExists(mBlockX, mBlockY, mBlockZ)) { + TileEntity tileEntity = world.getTileEntity(mBlockX, mBlockY, mBlockZ); + if (tileEntity instanceof IGregTechTileEntity igtte + && igtte.getMetaTileEntity() instanceof MTEResearchCompleter completer) { + completer.setNodeValues(nodeDistance, nodeColor); + } + } + } + } +} diff --git a/src/main/java/gregtech/api/net/GTPacketTileEntity.java b/src/main/java/gregtech/api/net/GTPacketTileEntity.java index e996f32ced5..15819cb9ed0 100644 --- a/src/main/java/gregtech/api/net/GTPacketTileEntity.java +++ b/src/main/java/gregtech/api/net/GTPacketTileEntity.java @@ -1,6 +1,5 @@ package gregtech.api.net; -import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; @@ -124,7 +123,6 @@ public void process(IBlockAccess aWorld) { if (aWorld == null) return; final TileEntity tTileEntity = aWorld.getTileEntity(mX, mY, mZ); try { - final Block tBlock; if (tTileEntity instanceof BaseMetaTileEntity) ((BaseMetaTileEntity) tTileEntity).receiveMetaTileEntityData( mID, mC0, diff --git a/src/main/java/gregtech/api/net/GTPacketTypes.java b/src/main/java/gregtech/api/net/GTPacketTypes.java index ed432744349..0179fe5c0a2 100644 --- a/src/main/java/gregtech/api/net/GTPacketTypes.java +++ b/src/main/java/gregtech/api/net/GTPacketTypes.java @@ -35,6 +35,8 @@ public enum GTPacketTypes { ORE_DICT_CACHE(25, new PacketOreDictCache()), SERVER_JOINED(26, new PacketServerJoined()), EIC(27, new PacketEIC()), + CREATE_TILE_ENTITY(28, new GTPacketCreateTE()), + NODE_INFO(29, new GTPacketNodeInfo()), // merge conflict prevention comment, keep a trailing comma above ; diff --git a/src/main/java/gregtech/api/objects/GTChunkManager.java b/src/main/java/gregtech/api/objects/GTChunkManager.java index 2fc87f148d2..2e0a272cf1f 100644 --- a/src/main/java/gregtech/api/objects/GTChunkManager.java +++ b/src/main/java/gregtech/api/objects/GTChunkManager.java @@ -136,6 +136,10 @@ public static boolean requestPlayerChunkLoad(TileEntity owner, ChunkCoordIntPair tag.setInteger("OwnerX", owner.xCoord); tag.setInteger("OwnerY", owner.yCoord); tag.setInteger("OwnerZ", owner.zCoord); + tag.setString( + "OwnerType", + owner.getClass() + .getSimpleName()); ForgeChunkManager.forceChunk(ticket, chunkXZ); if (GTValues.alwaysReloadChunkloaders) ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(owner.xCoord >> 4, owner.zCoord >> 4)); diff --git a/src/main/java/gregtech/api/recipe/RecipeCategories.java b/src/main/java/gregtech/api/recipe/RecipeCategories.java index 3112fce7053..8d0b0165434 100644 --- a/src/main/java/gregtech/api/recipe/RecipeCategories.java +++ b/src/main/java/gregtech/api/recipe/RecipeCategories.java @@ -17,13 +17,6 @@ public final class RecipeCategories { builder -> builder.setDisplayImage( createIcon(GregTech.getResourcePath("textures", "gui", "picture", "arc_furnace_recycling.png")))); - public static final RecipeCategory plasmaArcFurnaceRecycling = new RecipeCategory( - "gt.recipe.category.plasma_arc_furnace_recycling", - RecipeMaps.plasmaArcFurnaceRecipes, - () -> Client.nei.recipeCategories.plasmaArcFurnaceRecycling, - builder -> builder.setDisplayImage( - createIcon(GregTech.getResourcePath("textures", "gui", "picture", "plasma_arc_furnace_recycling.png")))); - public static final RecipeCategory maceratorRecycling = new RecipeCategory( "gt.recipe.category.macerator_recycling", RecipeMaps.maceratorRecipes, diff --git a/src/main/java/gregtech/api/recipe/RecipeMaps.java b/src/main/java/gregtech/api/recipe/RecipeMaps.java index fa984039dae..31c4ce8b249 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMaps.java +++ b/src/main/java/gregtech/api/recipe/RecipeMaps.java @@ -1,5 +1,6 @@ package gregtech.api.recipe; +import static bartworks.util.BWRecipes.computeSieverts; import static gregtech.api.enums.Mods.Avaritia; import static gregtech.api.enums.Mods.GTNHIntergalactic; import static gregtech.api.enums.Mods.NEICustomDiagrams; @@ -30,8 +31,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; - import com.gtnewhorizons.modularui.api.drawable.UITexture; import com.gtnewhorizons.modularui.common.widget.ProgressBar; @@ -318,9 +317,13 @@ public final class RecipeMaps { (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput && index != 0 ? GTUITextures.OVERLAY_SLOT_LENS : null) // Add a simple ordering so lower tier purified water is displayed first, otherwise it gets really confusing + // NEI Catalyst search requires recipes to be sorted by voltage tier. Therefore, we first sort by voltage tier, + // then by water tier, then the default comparator. .neiRecipeComparator( - (a, b) -> Comparator.comparing(PurifiedWaterHelpers::getWaterTierFromRecipe) - .thenComparing(GTRecipe::compareTo) + (a, b) -> Comparator.comparing(recipe -> recipe.mEUt) + .thenComparing( + Comparator.comparing(PurifiedWaterHelpers::getWaterTierFromRecipe) + .thenComparing(GTRecipe::compareTo)) .compare(a, b)) .build(); public static final RecipeMap mixerRecipes = RecipeMapBuilder.of("gt.recipe.mixer") @@ -470,16 +473,6 @@ public final class RecipeMaps { .minInputs(1, 1) .slotOverlays( (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_MOLD : null) - .recipeTransformer(r -> { - if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { - if (Materials.PhasedGold.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; - else if (Materials.PhasedIron.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; - } - }) .build(); public static final RecipeMap fluidExtractionRecipes = RecipeMapBuilder .of("gt.recipe.fluidextractor") @@ -489,16 +482,6 @@ else if (Materials.PhasedIron.getMolten(1) (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CENTRIFUGE : null) .progressBar(GTUITextures.PROGRESSBAR_EXTRACT) - .recipeTransformer(r -> { - if (ArrayUtils.isNotEmpty(r.mFluidOutputs)) { - if (Materials.PhasedGold.getMolten(1) - .isFluidEqual(r.mFluidOutputs[0])) - r.mFluidOutputs = new FluidStack[] { Materials.VibrantAlloy.getMolten(r.mFluidOutputs[0].amount) }; - else if (Materials.PhasedIron.getMolten(1) - .isFluidEqual(r.mFluidOutputs[0])) - r.mFluidOutputs = new FluidStack[] { Materials.PulsatingIron.getMolten(r.mFluidOutputs[0].amount) }; - } - }) .build(); public static final RecipeMap packagerRecipes = RecipeMapBuilder.of("gt.recipe.packager") .maxIO(2, 1, 0, 0) @@ -1238,7 +1221,8 @@ && isArrayEmptyOrNull(b.getFluidOutputs()) b -> BartWorksRecipeMaps.bacterialVatRecipes.doAdd( b.copy() .special(BioItemList.getPetriDish(BioCultureLoader.generalPurposeFermentingBacteria)) - .metadata(SIEVERTS, (int) GTUtility.getTier(b.getEUt()))))); + .metadata(SIEVERTS, computeSieverts(0, 3, false, false, false)) + .eut(b.getEUt())))); RecipeMaps.implosionRecipes.addDownstream( IRecipeMap.newRecipeMap( b -> BartWorksRecipeMaps.electricImplosionCompressorRecipes.doAdd( diff --git a/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java b/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java index a27e425efb1..7998d7cbcb8 100644 --- a/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java @@ -15,6 +15,8 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.common.tileentities.machines.multi.MTELargeBoilerBronze; +import gregtech.common.tileentities.machines.multi.MTELargeBoilerSteel; @SuppressWarnings({ "unused", "UnusedReturnValue" }) @ParametersAreNonnullByDefault @@ -47,11 +49,11 @@ public static boolean addAllowedSolidFuel(String itemregistryName, int meta) { } public GTRecipe addDenseLiquidRecipe(GTRecipe recipe) { - return addRecipe(recipe, ((double) recipe.mSpecialValue) / 10, false); + return addRecipe(recipe, ((double) recipe.mSpecialValue) / 10, true, false); } public GTRecipe addDieselRecipe(GTRecipe recipe) { - return addRecipe(recipe, ((double) recipe.mSpecialValue) / 40, false); + return addRecipe(recipe, ((double) recipe.mSpecialValue) / 40, true, false); } public void addSolidRecipes(ItemStack... itemStacks) { @@ -65,6 +67,12 @@ public GTRecipe addSolidRecipe(@Nullable ItemStack fuelItemStack) { if (fuelItemStack == null) { return null; } + + // only fuels with a burn time larger than the bronze boilers' eu/t should be considered + if (GTModHandler.getFuelValue(fuelItemStack) < MTELargeBoilerBronze.EUT_GENERATED) { + return null; + } + if (!addedGeneralDesc) { GTValues.RA.stdBuilder() .duration(1) @@ -72,14 +80,19 @@ public GTRecipe addSolidRecipe(@Nullable ItemStack fuelItemStack) { .specialValue(1) .setNEIDesc( "Not all solid fuels are listed.", - "Any item that burns in a", - "vanilla furnace will burn in", - "a Large Bronze or Steel Boiler.") + "Any burnable item with a burn", + "time of at least " + MTELargeBoilerBronze.EUT_GENERATED + + " / " + + MTELargeBoilerSteel.EUT_GENERATED, + "will burn in a Large Bronze", + "/ Steel Boiler, respectively.") .build() .map(this::compileRecipe); addedGeneralDesc = true; } + boolean isAllowedInSteelBoiler = GTModHandler.getFuelValue(fuelItemStack) >= MTELargeBoilerSteel.EUT_GENERATED; + String registryName = Item.itemRegistry.getNameForObject(fuelItemStack.getItem()); boolean isHighTierAllowed = ALLOWED_SOLID_FUELS.contains(registryName + ":" + fuelItemStack.getItemDamage()); return GTValues.RA.stdBuilder() @@ -88,11 +101,17 @@ public GTRecipe addSolidRecipe(@Nullable ItemStack fuelItemStack) { .eut(0) .specialValue(GTModHandler.getFuelValue(fuelItemStack) / 1600) .build() - .map(r -> addRecipe(r, ((double) GTModHandler.getFuelValue(fuelItemStack)) / 1600, isHighTierAllowed)) + .map( + r -> addRecipe( + r, + ((double) GTModHandler.getFuelValue(fuelItemStack)) / 1600, + isAllowedInSteelBoiler, + isHighTierAllowed)) .orElse(null); } - private GTRecipe addRecipe(GTRecipe recipe, double baseBurnTime, boolean isHighTierAllowed) { + private GTRecipe addRecipe(GTRecipe recipe, double baseBurnTime, boolean isAllowedInSteelBoiler, + boolean isHighTierAllowed) { // Some recipes will have a burn time like 15.9999999 and % always rounds down double floatErrorCorrection = 0.0001; @@ -105,21 +124,13 @@ private GTRecipe addRecipe(GTRecipe recipe, double baseBurnTime, boolean isHighT double tungstensteelBurnTime = baseBurnTime * 0.15 + floatErrorCorrection; tungstensteelBurnTime -= tungstensteelBurnTime % 0.05; - if (isHighTierAllowed) { - recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - String.format("Titanium Boiler: %.4f", titaniumBurnTime), - String.format("Tungstensteel Boiler: %.4f", tungstensteelBurnTime)); - } else { - recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - "Titanium Boiler: Not allowed", - "Tungstenst. Boiler: Not allowed"); - } + recipe.setNeiDesc( + "Burn time in seconds:", + String.format("Bronze Boiler: %.4f", bronzeBurnTime), + "Steel Boiler: " + (isAllowedInSteelBoiler ? String.format("%.4f", steelBurnTime) : "Not allowed"), + "Titanium Boiler: " + (isHighTierAllowed ? String.format("%.4f", titaniumBurnTime) : "Not allowed"), + "Tungstenst. Boiler: " + + (isHighTierAllowed ? String.format("%.4f", tungstensteelBurnTime) : "Not allowed")); return compileRecipe(recipe); } diff --git a/src/main/java/gregtech/api/registries/LHECoolantRegistry.java b/src/main/java/gregtech/api/registries/LHECoolantRegistry.java index 084086c8417..f7f1834f7a8 100644 --- a/src/main/java/gregtech/api/registries/LHECoolantRegistry.java +++ b/src/main/java/gregtech/api/registries/LHECoolantRegistry.java @@ -30,7 +30,6 @@ public static void registerCoolant(String coldFluidName, String hotFluidName, do double superheatedThreshold) { var coolant = new LHECoolantInfo(coldFluidName, hotFluidName, steamMultiplier, superheatedThreshold); - lheCoolants.put(coldFluidName, coolant); lheCoolants.put(hotFluidName, coolant); } diff --git a/src/main/java/gregtech/api/util/GTLanguageManager.java b/src/main/java/gregtech/api/util/GTLanguageManager.java index 1a4c3bf0826..02bbbc99f28 100644 --- a/src/main/java/gregtech/api/util/GTLanguageManager.java +++ b/src/main/java/gregtech/api/util/GTLanguageManager.java @@ -334,12 +334,12 @@ public static void writePlaceholderStrings() { addStringLocalization("Interaction_DESCRIPTION_Index_130.1", "Fluids "); addStringLocalization("Interaction_DESCRIPTION_Index_131", "Items"); addStringLocalization("Interaction_DESCRIPTION_Index_131.1", "Items "); - addStringLocalization("Interaction_DESCRIPTION_Index_132", "Pipe is loose."); - addStringLocalization("Interaction_DESCRIPTION_Index_133", "Screws are loose."); - addStringLocalization("Interaction_DESCRIPTION_Index_134", "Something is stuck."); - addStringLocalization("Interaction_DESCRIPTION_Index_135", "Platings are dented."); - addStringLocalization("Interaction_DESCRIPTION_Index_136", "Circuitry burned out."); - addStringLocalization("Interaction_DESCRIPTION_Index_137", "That doesn't belong there."); + addStringLocalization("Interaction_DESCRIPTION_Index_132", "Pipe is loose. (Wrench)"); + addStringLocalization("Interaction_DESCRIPTION_Index_133", "Screws are loose. (Screwdriver)"); + addStringLocalization("Interaction_DESCRIPTION_Index_134", "Something is stuck. (Soft Mallet)"); + addStringLocalization("Interaction_DESCRIPTION_Index_135", "Platings are dented. (Hammer)"); + addStringLocalization("Interaction_DESCRIPTION_Index_136", "Circuitry burned out. (Soldering)"); + addStringLocalization("Interaction_DESCRIPTION_Index_137", "That doesn't belong there. (Crowbar)"); addStringLocalization("Interaction_DESCRIPTION_Index_138", "Incomplete Structure."); addStringLocalization("Interaction_DESCRIPTION_Index_139", "Hit with Soft Mallet"); addStringLocalization("Interaction_DESCRIPTION_Index_140", "to (re-)start the Machine"); diff --git a/src/main/java/gregtech/api/util/GTMusicSystem.java b/src/main/java/gregtech/api/util/GTMusicSystem.java index 48a78faa6fb..c2fd71d2ece 100644 --- a/src/main/java/gregtech/api/util/GTMusicSystem.java +++ b/src/main/java/gregtech/api/util/GTMusicSystem.java @@ -11,8 +11,10 @@ import java.util.Arrays; import java.util.Collections; import java.util.Map; +import java.util.Objects; import java.util.TreeMap; import java.util.UUID; +import java.util.stream.StreamSupport; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.SoundEventAccessorComposite; @@ -29,6 +31,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.gtnewhorizon.gtnhlib.api.MusicRecordMetadataProvider; import com.jcraft.jorbis.VorbisFile; import baubles.api.BaublesApi; @@ -442,27 +445,42 @@ public static void dumpAllRecordDurations() { // Cursed hack because JOrbis does not support seeking in anything other than filesystem files. // This is only a dev tool, so it can be a bit slow and use real files here. final File tempFile = File.createTempFile("mcdecode", ".ogg"); + final ArrayList resources = new ArrayList<>(); for (final ItemRecord record : allRecords.values()) { - try { + resources.clear(); + if (record instanceof MusicRecordMetadataProvider mrmp) { + StreamSupport.stream( + mrmp.getMusicRecordVariants() + .spliterator(), + false) + .map(mrmp::getMusicRecordResource) + .filter(Objects::nonNull) + .forEach(resources::add); + } else { final ResourceLocation res = record.getRecordResource(record.recordName); - SoundEventAccessorComposite registryEntry = (SoundEventAccessorComposite) sm.getObject(res); - if (registryEntry == null) { - registryEntry = (SoundEventAccessorComposite) sm.getObject( - new ResourceLocation(res.getResourceDomain(), "records." + res.getResourcePath())); - } - final ResourceLocation realPath = registryEntry.func_148720_g() - .getSoundPoolEntryLocation(); - try (final InputStream is = mc.getResourceManager() - .getResource(realPath) - .getInputStream(); final OutputStream os = FileUtils.openOutputStream(tempFile)) { - IOUtils.copy(is, os); - os.close(); - final VorbisFile vf = new VorbisFile(tempFile.getAbsolutePath()); - final float totalSeconds = vf.time_total(-1); - json.soundDurationsMs.put(res.toString(), (int) Math.ceil(totalSeconds * 1000.0f)); + resources + .add(new ResourceLocation(res.getResourceDomain(), "records." + res.getResourcePath())); + } + for (final ResourceLocation res : resources) { + try { + SoundEventAccessorComposite registryEntry = (SoundEventAccessorComposite) sm.getObject(res); + if (registryEntry == null) { + registryEntry = (SoundEventAccessorComposite) sm.getObject(res); + } + final ResourceLocation realPath = registryEntry.func_148720_g() + .getSoundPoolEntryLocation(); + try (final InputStream is = mc.getResourceManager() + .getResource(realPath) + .getInputStream(); final OutputStream os = FileUtils.openOutputStream(tempFile)) { + IOUtils.copy(is, os); + os.close(); + final VorbisFile vf = new VorbisFile(tempFile.getAbsolutePath()); + final float totalSeconds = vf.time_total(-1); + json.soundDurationsMs.put(res.toString(), (int) Math.ceil(totalSeconds * 1000.0f)); + } + } catch (Exception e) { + GTMod.GT_FML_LOGGER.warn("Skipping {}: {}", record.recordName, res, e); } - } catch (Exception e) { - GTMod.GT_FML_LOGGER.warn("Skipping {}", record.recordName, e); } } GTMod.GT_FML_LOGGER.info( diff --git a/src/main/java/gregtech/api/util/GTRecipeConstants.java b/src/main/java/gregtech/api/util/GTRecipeConstants.java index 883f1060ac7..e0af3d0d7d2 100644 --- a/src/main/java/gregtech/api/util/GTRecipeConstants.java +++ b/src/main/java/gregtech/api/util/GTRecipeConstants.java @@ -14,6 +14,8 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GTValues; import gregtech.api.enums.Materials; @@ -129,6 +131,12 @@ public class GTRecipeConstants { public static final RecipeMetadataKey FOG_PLASMA_MULTISTEP = SimpleRecipeMetadataKey .create(Boolean.class, "fog_plasma_multistep"); + /** + * FOG Shortened upgrade name. + */ + public static final RecipeMetadataKey FOG_UPGRADE_NAME_SHORT = SimpleRecipeMetadataKey + .create(String.class, "fog_plasma_upgrade_name_short"); + /** * DEFC Casing tier. */ @@ -235,19 +243,20 @@ public class GTRecipeConstants { if (aDuration <= 0) { return Collections.emptyList(); } - builder.duration(aDuration); boolean recycle = builder.getMetadataOrDefault(RECYCLE, false); Collection ret = new ArrayList<>(); for (Materials mat : new Materials[] { Materials.Argon, Materials.Nitrogen }) { - int tPlasmaAmount = (int) Math.max(1L, aDuration / (mat.getMass() * 16L)); + builder.duration(Math.max(1, mat == Materials.Nitrogen ? aDuration / 4 : aDuration / 24)); + int tPlasmaAmount = (int) Math.min(1L, aDuration / (mat.getMass() * 16L)); GTRecipeBuilder plasmaBuilder = builder.copy() .fluidInputs(mat.getPlasma(tPlasmaAmount)) .fluidOutputs(mat.getGas(tPlasmaAmount)); if (recycle) { - plasmaBuilder.recipeCategory(RecipeCategories.plasmaArcFurnaceRecycling); + continue; } ret.addAll(RecipeMaps.plasmaArcFurnaceRecipes.doAdd(plasmaBuilder)); } + builder.duration(aDuration); GTRecipeBuilder arcBuilder = builder.copy() .fluidInputs(Materials.Oxygen.getGas(aDuration)); if (recycle) { @@ -256,7 +265,6 @@ public class GTRecipeConstants { ret.addAll(RecipeMaps.arcFurnaceRecipes.doAdd(arcBuilder)); return ret; }); - /** * Add a chemical reactor recipe to both LCR and singleblocks. */ @@ -336,16 +344,18 @@ enum Wafer{ return GTUtility.concat( builder.copy() .itemInputs(itemInputs) - .fluidInputs(GTModHandler.getDistilledWater(100L)) + .fluidInputs(ArrayUtils.addAll(builder.fluidInputs, GTModHandler.getDistilledWater(100L))) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() .itemInputs(itemInputs) - .fluidInputs(Materials.Grade1PurifiedWater.getFluid(100L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade1PurifiedWater.getFluid(100L))) .duration(halfBoostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() .itemInputs(itemInputs) - .fluidInputs(Materials.Grade2PurifiedWater.getFluid(100L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade2PurifiedWater.getFluid(100L))) .duration(boostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes)); } @@ -353,11 +363,13 @@ enum Wafer{ // Require purified water for europium wafers, at least grade 3 return GTUtility.concat( builder.copy() - .fluidInputs(Materials.Grade3PurifiedWater.getFluid(100L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade3PurifiedWater.getFluid(100L))) .duration(recipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() - .fluidInputs(Materials.Grade4PurifiedWater.getFluid(100L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade4PurifiedWater.getFluid(100L))) .duration(boostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes)); } @@ -365,11 +377,13 @@ enum Wafer{ // Require purified water for americium wafers, at least grade 5 return GTUtility.concat( builder.copy() - .fluidInputs(Materials.Grade5PurifiedWater.getFluid(100L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade5PurifiedWater.getFluid(100L))) .duration(recipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() - .fluidInputs(Materials.Grade6PurifiedWater.getFluid(100L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade6PurifiedWater.getFluid(100L))) .duration(boostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes)); } @@ -378,15 +392,18 @@ enum Wafer{ // T1 masks require grade 1, 2 or 3 purified water return GTUtility.concat( builder.copy() - .fluidInputs(Materials.Grade1PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade1PurifiedWater.getFluid(32000L))) .duration(recipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() - .fluidInputs(Materials.Grade2PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade2PurifiedWater.getFluid(32000L))) .duration(halfBoostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() - .fluidInputs(Materials.Grade3PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade3PurifiedWater.getFluid(32000L))) .duration(boostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes)); } @@ -394,11 +411,13 @@ enum Wafer{ // T2 masks require grade 4 or 5 purified water return GTUtility.concat( builder.copy() - .fluidInputs(Materials.Grade4PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade4PurifiedWater.getFluid(32000L))) .duration(recipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() - .fluidInputs(Materials.Grade5PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade5PurifiedWater.getFluid(32000L))) .duration(boostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes)); } @@ -406,15 +425,18 @@ enum Wafer{ // T3 masks require grade 6, 7 or 8 purified water return GTUtility.concat( builder.copy() - .fluidInputs(Materials.Grade6PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade6PurifiedWater.getFluid(32000L))) .duration(recipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() - .fluidInputs(Materials.Grade7PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade7PurifiedWater.getFluid(32000L))) .duration(halfBoostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() - .fluidInputs(Materials.Grade8PurifiedWater.getFluid(32000L)) + .fluidInputs( + ArrayUtils.addAll(builder.fluidInputs, Materials.Grade8PurifiedWater.getFluid(32000L))) .duration(boostedRecipeTime) .addTo(RecipeMaps.laserEngraverRecipes)); } diff --git a/src/main/java/gregtech/api/util/GTRecipeRegistrator.java b/src/main/java/gregtech/api/util/GTRecipeRegistrator.java index 745a544a520..e474316ddb9 100644 --- a/src/main/java/gregtech/api/util/GTRecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GTRecipeRegistrator.java @@ -179,7 +179,10 @@ public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) { || aData.mMaterial.mAmount <= 0 || GTUtility.getFluidForFilledItem(aStack, false) != null || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES)) return; - registerReverseMacerating(GTUtility.copyAmount(1, aStack), aData, aData.mPrefix == null); + // Prevents registering a quartz block -> 9x quartz dust recipe + if (!GTUtility.areStacksEqual(new ItemStack(Blocks.quartz_block, 1), aStack)) { + registerReverseMacerating(GTUtility.copyAmount(1, aStack), aData, aData.mPrefix == null, true); + } if (!GTUtility.areStacksEqual(GTModHandler.getIC2Item("iridiumOre", 1L), aStack)) { registerReverseSmelting( GTUtility.copyAmount(1, aStack), @@ -190,7 +193,8 @@ public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) { GTUtility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, - aData.getByProduct(0)); + aData.getByProduct(0), + true); registerReverseArcSmelting(GTUtility.copyAmount(1, aStack), aData); } } @@ -199,9 +203,10 @@ public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) { * @param aStack the stack to be recycled. * @param aMaterial the Material. * @param aMaterialAmount the amount of it in Material Units. + * @param isRecycling whether to put in recycling tab. */ public static void registerReverseFluidSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByproduct) { + MaterialStack aByproduct, boolean isRecycling) { if (aStack == null || aMaterial == null || aMaterial.mSmeltInto.mStandardMoltenFluid == null || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) @@ -229,9 +234,9 @@ public static void registerReverseFluidSmelting(ItemStack aStack, Materials aMat } builder.fluidOutputs(aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize))) .duration((int) Math.max(1, (24 * aMaterialAmount) / M)) - .eut(powerUsage) - .recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); + .eut(powerUsage); + if (isRecycling) builder.recipeCategory(RecipeCategories.fluidExtractorRecycling); + builder.addTo(fluidExtractionRecipes); } /** @@ -352,7 +357,8 @@ public static void registerReverseArcSmelting(ItemStack aStack, ItemData aData) } public static void registerReverseMacerating(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) { + MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer, + boolean isRecycling) { registerReverseMacerating( aStack, new ItemData( @@ -360,10 +366,12 @@ public static void registerReverseMacerating(ItemStack aStack, Materials aMateri aByProduct01, aByProduct02, aByProduct03), - aAllowHammer); + aAllowHammer, + isRecycling); } - public static void registerReverseMacerating(ItemStack aStack, ItemData aData, boolean aAllowHammer) { + public static void registerReverseMacerating(ItemStack aStack, ItemData aData, boolean aAllowHammer, + boolean isRecycling) { if (aStack == null || aData == null) return; aData = new ItemData(aData); @@ -398,9 +406,9 @@ public static void registerReverseMacerating(ItemStack aStack, ItemData aData, b .itemOutputs(outputsArray) .duration( (aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M)) * TICKS) - .eut(4) - .recipeCategory(RecipeCategories.maceratorRecycling) - .addTo(maceratorRecipes); + .eut(4); + if (isRecycling) recipeBuilder.recipeCategory(RecipeCategories.maceratorRecycling); + recipeBuilder.addTo(maceratorRecipes); } } diff --git a/src/main/java/gregtech/api/util/GTUtilityClient.java b/src/main/java/gregtech/api/util/GTUtilityClient.java index a6039e10d30..f2df5760e06 100644 --- a/src/main/java/gregtech/api/util/GTUtilityClient.java +++ b/src/main/java/gregtech/api/util/GTUtilityClient.java @@ -3,15 +3,23 @@ import java.lang.reflect.Field; import java.util.List; +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.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; import com.google.common.collect.Lists; +import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; import cpw.mods.fml.relauncher.ReflectionHelper; +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.common.render.GTRenderUtil; public class GTUtilityClient { @@ -49,4 +57,54 @@ public static List getTooltip(ItemStack aStack, boolean aGuiStyle) { return Lists.newArrayList(aStack.getDisplayName()); } } + + public static void renderTurbineOverlay(IBlockAccess aWorld, int aX, int aY, int aZ, RenderBlocks aRenderer, + ExtendedFacing tExtendedFacing, Block tBlockOverride, IIconContainer[] tTextures) { + int[] tABCCoord = new int[] { -1, -1, 0 }; + int[] tXYZOffset = new int[3]; + final ForgeDirection tDirection = tExtendedFacing.getDirection(); + tExtendedFacing = ExtendedFacing.of(tDirection); + final LightingHelper tLighting = new LightingHelper(aRenderer); + + // for some reason +x and -z need this field set to true, but not any other sides + if (tDirection == ForgeDirection.NORTH || tDirection == ForgeDirection.EAST) aRenderer.field_152631_f = true; + + for (int i = 0; i < 9; i++) { + tExtendedFacing.getWorldOffset(tABCCoord, tXYZOffset); + // since structure check passed, we can assume it is turbine casing + int tX = tXYZOffset[0] + aX; + int tY = tXYZOffset[1] + aY; + int tZ = tXYZOffset[2] + aZ; + Block tBlock; + if (tBlockOverride == null) { + tBlock = aWorld.getBlock(aX + tDirection.offsetX, tY + tDirection.offsetY, aZ + tDirection.offsetZ); + } else { + tBlock = tBlockOverride; + } + // we skip the occlusion test, as we always require a working turbine to have a block of air before it + // so the front face cannot be occluded whatsoever in the most cases. + Tessellator.instance.setBrightness( + tBlock.getMixedBrightnessForBlock( + aWorld, + aX + tDirection.offsetX, + tY + tDirection.offsetY, + aZ + tDirection.offsetZ)); + tLighting.setupLighting(tBlock, tX, tY, tZ, tDirection) + .setupColor(tDirection, Dyes._NULL.mRGBa); + GTRenderUtil.renderBlockIcon( + aRenderer, + tBlock, + tX + tDirection.offsetX * 0.001, + tY + tDirection.offsetY * 0.001, + tZ + tDirection.offsetZ * 0.001, + tTextures[i].getIcon(), + tDirection); + if (++tABCCoord[0] == 2) { + tABCCoord[0] = -1; + tABCCoord[1]++; + } + } + + aRenderer.field_152631_f = false; + } } diff --git a/src/main/java/gregtech/api/util/LongData.java b/src/main/java/gregtech/api/util/LongData.java new file mode 100644 index 00000000000..6ad23bb0fe7 --- /dev/null +++ b/src/main/java/gregtech/api/util/LongData.java @@ -0,0 +1,23 @@ +package gregtech.api.util; + +import java.math.BigInteger; + +public interface LongData { + + default double avg() { + int size = size(); + if (size == 0) return 0d; + return sum().doubleValue() / size; + } + + default long avgLong() { + int size = size(); + if (size == 0) return 0; + return sum().divide(BigInteger.valueOf(size)) + .longValueExact(); + } + + int size(); + + BigInteger sum(); +} diff --git a/src/main/java/gregtech/api/util/LongRunningAverage.java b/src/main/java/gregtech/api/util/LongRunningAverage.java new file mode 100644 index 00000000000..c1e578bd6f7 --- /dev/null +++ b/src/main/java/gregtech/api/util/LongRunningAverage.java @@ -0,0 +1,175 @@ +package gregtech.api.util; + +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.util.Collection; +import java.util.Collections; +import java.util.WeakHashMap; + +public class LongRunningAverage implements LongData { + + private final long[] data; + private long sumHigh, sumLow; + private int ptr; + private boolean filled; + private final Collection views = Collections.newSetFromMap(new WeakHashMap<>()); + + public LongRunningAverage(final int size) { + if (size <= 1) { + throw new IllegalArgumentException("Size must be greater than 1"); + } + data = new long[size]; + } + + public void update(final long value) { + if (value < 0) { + throw new IllegalArgumentException("Value must not be negative"); + } + long high = sumHigh, low = sumLow; + low += value; + high += low < 0 ? 1 : 0; + low = low & 0x7FFFFFFFFFFFFFFFL; + if (filled) { + low -= data[ptr]; + high -= low < 0 ? 1 : 0; + low = low & 0x7FFFFFFFFFFFFFFFL; + } + sumHigh = high; + sumLow = low; + for (View view : views) { + view.update(value); + } + data[ptr++] = value; + if (ptr == data.length) { + ptr = 0; + filled = true; + } + } + + @Override + public int size() { + int length; + if (filled) { + length = data.length; + } else { + length = ptr; + } + return length; + } + + @Override + public BigInteger sum() { + long high = sumHigh, low = sumLow; + if ((high & 1) == 1) { + low |= 0x8000000000000000L; + } + high >>>= 1; + byte[] byteArray = new byte[16]; + ByteBuffer byteBuffer = ByteBuffer.wrap(byteArray); + byteBuffer.putLong(high); + byteBuffer.putLong(low); + return new BigInteger(byteArray); + } + + public LongData view(int size) { + if (size <= 1) { + throw new IllegalArgumentException("Size must be greater than 1"); + } + if (size > data.length) { + throw new IllegalArgumentException("Size must be less than or equal to limit of current ring buffer"); + } + if (size == data.length) { + return this; + } + return new View(size); + } + + private class View implements LongData { + + private final int size; + private long sumHigh, sumLow; + + public View(int size) { + this.size = size; + views.add(this); + if (ptr > 0 || filled) { + ByteBuffer buf = ByteBuffer.allocate(16); + buf.put(sumSlow().toByteArray()); + buf.flip(); + sumLow = buf.getLong(); + sumHigh = buf.getLong(); + } + } + + @Override + public int size() { + return Math.min(LongRunningAverage.this.size(), size); + } + + @Override + public BigInteger sum() { + long high = sumHigh, low = sumLow; + if ((high & 1) == 1) { + low |= 0x8000000000000000L; + } + high >>>= 1; + byte[] byteArray = new byte[16]; + ByteBuffer byteBuffer = ByteBuffer.wrap(byteArray); + byteBuffer.putLong(high); + byteBuffer.putLong(low); + return new BigInteger(byteArray); + } + + public BigInteger sumSlow() { + int start = getStart(); + long high = 0, low = data[start]; + int end = ptr; + for (int i = start + 1; i != end; i++) { + if (i == data.length) { + i = 0; + if (end == 0) break; + } + long num = data[i]; + low += num; + high += low < 0 ? 1 : 0; + low = low & 0x7FFFFFFFFFFFFFFFL; + } + if ((high & 1) == 1) { + low |= 0x8000000000000000L; + } + high >>>= 1; + byte[] byteArray = new byte[16]; + ByteBuffer byteBuffer = ByteBuffer.wrap(byteArray); + byteBuffer.putLong(high); + byteBuffer.putLong(low); + return new BigInteger(byteArray); + } + + private int getStart() { + int start = ptr - size; + if (start < 0) { + if (filled) { + start += data.length; + } else { + start = 0; + } + } + return start; + } + + public void update(long value) { + long high = sumHigh, low = sumLow; + low += value; + high += low < 0 ? 1 : 0; + low = low & 0x7FFFFFFFFFFFFFFFL; + int start = getStart(); + if (size() == size) { + low -= data[start]; + high -= low < 0 ? 1 : 0; + low = low & 0x7FFFFFFFFFFFFFFFL; + } + sumHigh = high; + sumLow = low; + } + } +} diff --git a/src/main/java/gregtech/api/util/OutputHatchWrapper.java b/src/main/java/gregtech/api/util/OutputHatchWrapper.java index 55f467198a1..5c3d64f9384 100644 --- a/src/main/java/gregtech/api/util/OutputHatchWrapper.java +++ b/src/main/java/gregtech/api/util/OutputHatchWrapper.java @@ -62,4 +62,8 @@ public boolean isEmptyAndAcceptsAnyFluid() { public boolean canStoreFluid(@NotNull FluidStack fluidStack) { return outputHatch.canStoreFluid(fluidStack) && filter.test(fluidStack); } + + public MTEHatchOutput unwrap() { + return outputHatch; + } } diff --git a/src/main/java/gregtech/api/util/VoidProtectionHelper.java b/src/main/java/gregtech/api/util/VoidProtectionHelper.java index cf98e26b66d..97728d14fd6 100644 --- a/src/main/java/gregtech/api/util/VoidProtectionHelper.java +++ b/src/main/java/gregtech/api/util/VoidProtectionHelper.java @@ -17,6 +17,7 @@ import gregtech.api.interfaces.tileentity.IVoidable; import gregtech.api.logic.FluidInventoryLogic; import gregtech.api.logic.ItemInventoryLogic; +import gregtech.common.tileentities.machines.MTEHatchOutputME; /** * Helper class to calculate how many parallels of items / fluids can fit in the output buses / hatches. @@ -255,7 +256,14 @@ private int calculateMaxFluidParallels() { } for (IFluidStore tHatch : hatches) { - int tSpaceLeft = tHatch.getCapacity() - tHatch.getFluidAmount(); + int tSpaceLeft; + if (tHatch instanceof MTEHatchOutputME tMEHatch) { + tSpaceLeft = tMEHatch.canAcceptFluid() ? Integer.MAX_VALUE : 0; + } else if (tHatch instanceof OutputHatchWrapper w && w.unwrap() instanceof MTEHatchOutputME tMEHatch) { + tSpaceLeft = tMEHatch.canAcceptFluid() ? Integer.MAX_VALUE : 0; + } else { + tSpaceLeft = tHatch.getCapacity() - tHatch.getFluidAmount(); + } // check if hatch filled if (tSpaceLeft <= 0) continue; @@ -289,7 +297,16 @@ private int calculateMaxFluidParallels() { ParallelStackInfo tParallel = aParallelQueue.poll(); assert tParallel != null; // will always be true, specifying assert here to avoid IDE/compiler warnings Integer tCraftSize = tFluidOutputMap.get(tParallel.stack); - int tSpaceLeft = tHatch.getCapacity(); + + int tSpaceLeft; + if (tHatch instanceof MTEHatchOutputME tMEHatch) { + tSpaceLeft = tMEHatch.canAcceptFluid() ? Integer.MAX_VALUE : 0; + } else if (tHatch instanceof OutputHatchWrapper w && w.unwrap() instanceof MTEHatchOutputME tMEHatch) { + tSpaceLeft = tMEHatch.canAcceptFluid() ? Integer.MAX_VALUE : 0; + } else { + tSpaceLeft = tHatch.getCapacity(); + } + tParallel.batch += (tParallel.partial + tSpaceLeft) / tCraftSize; tParallel.partial = (tParallel.partial + tSpaceLeft) % tCraftSize; aParallelQueue.add(tParallel); diff --git a/src/main/java/gregtech/common/GTProxy.java b/src/main/java/gregtech/common/GTProxy.java index ed5ffeb4c8f..2bedabd299c 100644 --- a/src/main/java/gregtech/common/GTProxy.java +++ b/src/main/java/gregtech/common/GTProxy.java @@ -78,7 +78,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; -import net.minecraft.world.WorldSettings.GameType; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ForgeEventFactory; @@ -109,6 +108,7 @@ import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.FMLNetworkEvent; import cpw.mods.fml.common.registry.GameRegistry; @@ -157,9 +157,7 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder; import gregtech.common.config.OPStuff; -import gregtech.common.items.IDMetaTool01; import gregtech.common.items.MetaGeneratedItem98; -import gregtech.common.items.MetaGeneratedTool01; import gregtech.common.misc.GlobalEnergyWorldSavedData; import gregtech.common.misc.GlobalMetricsCoverDatabase; import gregtech.common.misc.spaceprojects.SpaceProjectWorldSavedData; @@ -2235,27 +2233,6 @@ public void onPlayerTickEventServer(TickEvent.PlayerTickEvent aEvent) { return; } - if ((aEvent.player.ticksExisted % 200 == 0) && (aEvent.player.capabilities.allowEdit) - && (!aEvent.player.capabilities.isCreativeMode) - && (this.mSurvivalIntoAdventure)) { - aEvent.player.setGameType(GameType.ADVENTURE); - aEvent.player.capabilities.allowEdit = false; - if (this.mAxeWhenAdventure) { - GTUtility.sendChatToPlayer( - aEvent.player, - GTLanguageManager.addStringLocalization( - "Interaction_DESCRIPTION_Index_097", - "It's dangerous to go alone! Take this.")); - aEvent.player.worldObj.spawnEntityInWorld( - new EntityItem( - aEvent.player.worldObj, - aEvent.player.posX, - aEvent.player.posY, - aEvent.player.posZ, - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.AXE.ID, 1, Materials.Flint, Materials.Wood, null))); - } - } final boolean tHungerEffect = (this.mHungerEffect) && (aEvent.player.ticksExisted % 2400 == 1200); if (aEvent.player.ticksExisted % 120 != 0) { @@ -2792,4 +2769,23 @@ public void onItemTooltip(ItemTooltipEvent event) { } } } + + /// Used for tool sounds in the crafting grid + @SubscribeEvent + public void onPlayerCrafting(ItemCraftedEvent event) { + for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { + ItemStack stack = event.craftMatrix.getStackInSlot(i); + + if (stack != null && stack.getItem() instanceof MetaGeneratedTool mgt) { + if (this.mTicksUntilNextCraftSound <= 0) { + this.mTicksUntilNextCraftSound = 10; + IToolStats tStats = mgt.getToolStats(stack); + boolean playBreak = (MetaGeneratedTool.getToolDamage(stack) + + tStats.getToolDamagePerContainerCraft()) >= MetaGeneratedTool.getToolMaxDamage(stack); + String sound = playBreak ? tStats.getBreakingSound() : tStats.getCraftingSound(); + GTUtility.doSoundAtClient(sound, 1, 1.0F); + } + } + } + } } diff --git a/src/main/java/gregtech/common/bees/GTAlleleHelper.java b/src/main/java/gregtech/common/bees/GTAlleleHelper.java index 88c46fed3d9..30945e7a203 100644 --- a/src/main/java/gregtech/common/bees/GTAlleleHelper.java +++ b/src/main/java/gregtech/common/bees/GTAlleleHelper.java @@ -152,13 +152,13 @@ public static void initialisation() { public & IChromosomeType> void set(IAllele[] alleles, T chromosomeType, IAllele allele) { if (allele == null) { - GTMod.GT_FML_LOGGER.info("Allele is null!"); + GTMod.GT_FML_LOGGER.warn("Allele is null!"); return; } if (!chromosomeType.getAlleleClass() .isInstance(allele)) { - GTMod.GT_FML_LOGGER.info("chromosomeType is not an instance of allele!" + allele.getName()); + GTMod.GT_FML_LOGGER.warn("chromosomeType is not an instance of allele!" + allele.getName()); return; } diff --git a/src/main/java/gregtech/common/blocks/BlockCasings10.java b/src/main/java/gregtech/common/blocks/BlockCasings10.java index ada1c589270..e8b976ab3aa 100644 --- a/src/main/java/gregtech/common/blocks/BlockCasings10.java +++ b/src/main/java/gregtech/common/blocks/BlockCasings10.java @@ -72,8 +72,8 @@ public IIcon getIcon(int ordinalSide, int aMeta) { case 6 -> Textures.BlockIcons.NEUTRONIUM_CASING.getIcon(); case 7 -> Textures.BlockIcons.NEUTRONIUM_ACTIVE_CASING.getIcon(); case 8 -> Textures.BlockIcons.NEUTRONIUM_STABLE_CASING.getIcon(); - case 9 -> Textures.BlockIcons.MACHINE_CASING_PIPE_TUNGSTENSTEEL.getIcon(); - case 10 -> Textures.BlockIcons.MACHINE_CASING_PIPE_BRONZE.getIcon(); + case 9 -> Textures.BlockIcons.COOLANT_DUCT_CASING.getIcon(); + case 10 -> Textures.BlockIcons.HEATING_DUCT_CASING.getIcon(); case 11 -> Textures.BlockIcons.EXTREME_DENSITY_CASING.getIcon(); case 12 -> Textures.BlockIcons.RADIATION_ABSORBENT_CASING.getIcon(); case 13 -> Textures.BlockIcons.MACHINE_CASING_MS160.getIcon(); diff --git a/src/main/java/gregtech/common/blocks/BlockCasings2.java b/src/main/java/gregtech/common/blocks/BlockCasings2.java index 441bbd9b82d..ad2f4748707 100644 --- a/src/main/java/gregtech/common/blocks/BlockCasings2.java +++ b/src/main/java/gregtech/common/blocks/BlockCasings2.java @@ -36,7 +36,7 @@ public BlockCasings2() { GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Bronze Gear Box Casing"); GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Steel Gear Box Casing"); GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Titanium Gear Box Casing"); - GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Assembling Line Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Assembly Line Casing"); GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Processor Machine Casing"); GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Data Drive Machine Casing"); GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Containment Field Machine Casing"); diff --git a/src/main/java/gregtech/common/blocks/BlockFrameBox.java b/src/main/java/gregtech/common/blocks/BlockFrameBox.java index ab05d950325..305919c9482 100644 --- a/src/main/java/gregtech/common/blocks/BlockFrameBox.java +++ b/src/main/java/gregtech/common/blocks/BlockFrameBox.java @@ -103,6 +103,8 @@ private void createFrame(World worldIn, int x, int y, int z, BaseMetaPipeEntity Materials material = getMaterial(meta); MTEFrame frame = new MTEFrame("GT_Frame_" + material, material); baseMte.setMetaTileEntity(frame); + baseMte.setInitialValuesAsNBT(null, (short) (4096 + meta)); // 4096 is found in LoaderMetaTileEntities for + // frames frame.setBaseMetaTileEntity(baseMte); } @@ -111,6 +113,7 @@ private BaseMetaPipeEntity spawnFrameEntity(World worldIn, int x, int y, int z) BaseMetaPipeEntity newTileEntity = new BaseMetaPipeEntity(); createFrame(worldIn, x, y, z, newTileEntity); worldIn.setTileEntity(x, y, z, newTileEntity); + return newTileEntity; } diff --git a/src/main/java/gregtech/common/config/Client.java b/src/main/java/gregtech/common/config/Client.java index 5f5041720f9..1fa2766f8ed 100644 --- a/src/main/java/gregtech/common/config/Client.java +++ b/src/main/java/gregtech/common/config/Client.java @@ -213,10 +213,6 @@ public static class RecipeCategories { @Config.DefaultEnum("ENABLE") public RecipeCategorySetting arcFurnaceRecycling = ENABLE; - @Config.LangKey("gt.recipe.category.plasma_arc_furnace_recycling") - @Config.DefaultEnum("ENABLE") - public RecipeCategorySetting plasmaArcFurnaceRecycling = ENABLE; - @Config.LangKey("gt.recipe.category.macerator_recycling") @Config.DefaultEnum("ENABLE") public RecipeCategorySetting maceratorRecycling = ENABLE; diff --git a/src/main/java/gregtech/common/config/MachineStats.java b/src/main/java/gregtech/common/config/MachineStats.java index ce679052b88..59f60e66b2e 100644 --- a/src/main/java/gregtech/common/config/MachineStats.java +++ b/src/main/java/gregtech/common/config/MachineStats.java @@ -127,7 +127,7 @@ public static class MassFabricator { public int UUAPerUUM; @Config.Comment("Speed bonus delivered by the UUA.") - @Config.DefaultInt(40) + @Config.DefaultInt(4) @Config.RequiresMcRestart public int UUASpeedBonus; } diff --git a/src/main/java/gregtech/common/covers/redstone/CoverWirelessDoesWorkDetector.java b/src/main/java/gregtech/common/covers/redstone/CoverWirelessDoesWorkDetector.java index 54d71d2c8b2..1d5f89ee902 100644 --- a/src/main/java/gregtech/common/covers/redstone/CoverWirelessDoesWorkDetector.java +++ b/src/main/java/gregtech/common/covers/redstone/CoverWirelessDoesWorkDetector.java @@ -76,6 +76,8 @@ public ActivityTransmitterData doCoverThingsImpl(ForgeDirection side, byte aInpu final long hash = hashCoverCoords(aTileEntity, side); setSignalAt(aCoverVariable.getUuid(), aCoverVariable.getFrequency(), hash, signal); + aTileEntity.setOutputRedstoneSignal(side, signal); + return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/redstone/CoverWirelessFluidDetector.java b/src/main/java/gregtech/common/covers/redstone/CoverWirelessFluidDetector.java index cfea9b7b280..9c7de19a01f 100644 --- a/src/main/java/gregtech/common/covers/redstone/CoverWirelessFluidDetector.java +++ b/src/main/java/gregtech/common/covers/redstone/CoverWirelessFluidDetector.java @@ -51,6 +51,8 @@ public FluidTransmitterData doCoverThingsImpl(ForgeDirection side, byte aInputRe final long hash = hashCoverCoords(aTileEntity, side); setSignalAt(aCoverVariable.getUuid(), aCoverVariable.getFrequency(), hash, signal); + aTileEntity.setOutputRedstoneSignal(side, signal); + return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/redstone/CoverWirelessItemDetector.java b/src/main/java/gregtech/common/covers/redstone/CoverWirelessItemDetector.java index 19cefdabcfc..72b6d25e736 100644 --- a/src/main/java/gregtech/common/covers/redstone/CoverWirelessItemDetector.java +++ b/src/main/java/gregtech/common/covers/redstone/CoverWirelessItemDetector.java @@ -59,6 +59,8 @@ public ItemTransmitterData doCoverThingsImpl(ForgeDirection side, byte aInputRed final long hash = hashCoverCoords(aTileEntity, side); setSignalAt(aCoverVariable.getUuid(), aCoverVariable.getFrequency(), hash, signal); + aTileEntity.setOutputRedstoneSignal(side, signal); + return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/redstone/CoverWirelessMaintenanceDetector.java b/src/main/java/gregtech/common/covers/redstone/CoverWirelessMaintenanceDetector.java index f3d62f2c816..a71e597969e 100644 --- a/src/main/java/gregtech/common/covers/redstone/CoverWirelessMaintenanceDetector.java +++ b/src/main/java/gregtech/common/covers/redstone/CoverWirelessMaintenanceDetector.java @@ -96,6 +96,8 @@ public MaintenanceTransmitterData doCoverThingsImpl(ForgeDirection side, byte aI final long hash = hashCoverCoords(aTileEntity, side); setSignalAt(aCoverVariable.getUuid(), aCoverVariable.getFrequency(), hash, signal); + aTileEntity.setOutputRedstoneSignal(side, signal); + return aCoverVariable; } diff --git a/src/main/java/gregtech/common/items/IDMetaTool01.java b/src/main/java/gregtech/common/items/IDMetaTool01.java index 684636100bd..9dbd41dccd6 100644 --- a/src/main/java/gregtech/common/items/IDMetaTool01.java +++ b/src/main/java/gregtech/common/items/IDMetaTool01.java @@ -3,11 +3,6 @@ public enum IDMetaTool01 { // Please pretty please, add your entries while conserving the order - SWORD(0), - PICKAXE(2), - SHOVEL(4), - AXE(6), - HOE(8), SAW(10), HARDHAMMER(12), SOFTMALLET(14), @@ -24,10 +19,6 @@ public enum IDMetaTool01 { UNIVERSALSPADE(32), KNIFE(34), BUTCHERYKNIFE(36), - @Deprecated - SICKLE(38), - SENSE(40), - PLOW(42), PLUNGER(44), ROLLING_PIN(46), DRILL_LV(100), diff --git a/src/main/java/gregtech/common/items/MetaGeneratedItem01.java b/src/main/java/gregtech/common/items/MetaGeneratedItem01.java index 32c2254374e..0b96caea028 100644 --- a/src/main/java/gregtech/common/items/MetaGeneratedItem01.java +++ b/src/main/java/gregtech/common/items/MetaGeneratedItem01.java @@ -460,7 +460,6 @@ import static gregtech.common.items.IDMetaItem01.ZPM5; import static gregtech.common.items.IDMetaItem01.ZPM6; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -2934,19 +2933,19 @@ public MetaGeneratedItem01() { addItem( Cover_Chest_Basic.ID, "Basic Item Holder", - "Hold a few item for use within machine GUI", + "Holds 9 item for use within machine GUI (as Cover)", new TCAspects.TC_AspectStack(TCAspects.VACUOS, 2L))); ItemList.Cover_Chest_Good.set( addItem( Cover_Chest_Good.ID, "Good Item Holder", - "Hold a few item for use within machine GUI", + "Holds 12 item for use within machine GUI (as Cover)", new TCAspects.TC_AspectStack(TCAspects.VACUOS, 2L))); ItemList.Cover_Chest_Advanced.set( addItem( Cover_Chest_Advanced.ID, "Advanced Item Holder", - "Hold a few item for use within machine GUI", + "Holds 15 item for use within machine GUI (as Cover)", new TCAspects.TC_AspectStack(TCAspects.VACUOS, 2L))); ItemList.Cover_Screen.set( @@ -3511,15 +3510,16 @@ protected void addAdditionalToolTips(List aList, ItemStack aStack, Entit } public boolean isPlasmaCellUsed(OrePrefixes aPrefix, Materials aMaterial) { - Collection fusionRecipes = RecipeMaps.fusionRecipes.getAllRecipes(); - if (aPrefix == OrePrefixes.cellPlasma && aMaterial.getPlasma(1L) != null) { // Materials has a plasma fluid - for (GTRecipe recipe : fusionRecipes) { // Loop through fusion recipes - if (recipe.getFluidOutput(0) != null) { // Make sure fluid output can't be null (not sure if possible) + // Materials has a plasma fluid + if (aPrefix == OrePrefixes.cellPlasma && aMaterial.getPlasma(1L) != null) { + if (aMaterial.mHasPlasma) return true; + // Loop through fusion recipes + for (GTRecipe recipe : RecipeMaps.fusionRecipes.getAllRecipes()) { + // Make sure fluid output can't be null (not sure if possible) + if (recipe.getFluidOutput(0) != null) { + // Fusion recipe output matches current plasma cell fluid if (recipe.getFluidOutput(0) - .isFluidEqual(aMaterial.getPlasma(1L))) return true; // Fusion recipe - // output matches - // current plasma - // cell fluid + .isFluidEqual(aMaterial.getPlasma(1L))) return true; } } } diff --git a/src/main/java/gregtech/common/items/MetaGeneratedItem02.java b/src/main/java/gregtech/common/items/MetaGeneratedItem02.java index d0e66fe9aaa..9f097741f67 100644 --- a/src/main/java/gregtech/common/items/MetaGeneratedItem02.java +++ b/src/main/java/gregtech/common/items/MetaGeneratedItem02.java @@ -261,20 +261,20 @@ public class MetaGeneratedItem02 extends MetaGeneratedItemX32 { public MetaGeneratedItem02() { super( "metaitem.02", - OrePrefixes.toolHeadSword, - OrePrefixes.toolHeadPickaxe, - OrePrefixes.toolHeadShovel, - OrePrefixes.toolHeadAxe, - OrePrefixes.toolHeadHoe, + OrePrefixes.___placeholder___, + OrePrefixes.___placeholder___, + OrePrefixes.___placeholder___, + OrePrefixes.___placeholder___, + OrePrefixes.___placeholder___, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, - OrePrefixes.toolHeadUniversalSpade, - OrePrefixes.toolHeadSense, - OrePrefixes.toolHeadPlow, + OrePrefixes.___placeholder___, + OrePrefixes.___placeholder___, + OrePrefixes.___placeholder___, OrePrefixes.___placeholder___, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, diff --git a/src/main/java/gregtech/common/items/MetaGeneratedTool01.java b/src/main/java/gregtech/common/items/MetaGeneratedTool01.java index 11c3fa104ef..555c180ee56 100644 --- a/src/main/java/gregtech/common/items/MetaGeneratedTool01.java +++ b/src/main/java/gregtech/common/items/MetaGeneratedTool01.java @@ -1,6 +1,5 @@ package gregtech.common.items; -import static gregtech.common.items.IDMetaTool01.AXE; import static gregtech.common.items.IDMetaTool01.BRANCHCUTTER; import static gregtech.common.items.IDMetaTool01.BUTCHERYKNIFE; import static gregtech.common.items.IDMetaTool01.BUZZSAW_HV; @@ -15,12 +14,9 @@ import static gregtech.common.items.IDMetaTool01.DRILL_MV; import static gregtech.common.items.IDMetaTool01.FILE; import static gregtech.common.items.IDMetaTool01.HARDHAMMER; -import static gregtech.common.items.IDMetaTool01.HOE; import static gregtech.common.items.IDMetaTool01.JACKHAMMER; import static gregtech.common.items.IDMetaTool01.KNIFE; import static gregtech.common.items.IDMetaTool01.MORTAR; -import static gregtech.common.items.IDMetaTool01.PICKAXE; -import static gregtech.common.items.IDMetaTool01.PLOW; import static gregtech.common.items.IDMetaTool01.PLUNGER; import static gregtech.common.items.IDMetaTool01.POCKET_BRANCHCUTTER; import static gregtech.common.items.IDMetaTool01.POCKET_FILE; @@ -36,18 +32,14 @@ import static gregtech.common.items.IDMetaTool01.SCREWDRIVER_HV; import static gregtech.common.items.IDMetaTool01.SCREWDRIVER_LV; import static gregtech.common.items.IDMetaTool01.SCREWDRIVER_MV; -import static gregtech.common.items.IDMetaTool01.SENSE; -import static gregtech.common.items.IDMetaTool01.SHOVEL; import static gregtech.common.items.IDMetaTool01.SOFTMALLET; import static gregtech.common.items.IDMetaTool01.SOLDERING_IRON_HV; import static gregtech.common.items.IDMetaTool01.SOLDERING_IRON_LV; import static gregtech.common.items.IDMetaTool01.SOLDERING_IRON_MV; -import static gregtech.common.items.IDMetaTool01.SWORD; import static gregtech.common.items.IDMetaTool01.TURBINE; import static gregtech.common.items.IDMetaTool01.TURBINE_HUGE; import static gregtech.common.items.IDMetaTool01.TURBINE_LARGE; import static gregtech.common.items.IDMetaTool01.TURBINE_SMALL; -import static gregtech.common.items.IDMetaTool01.UNIVERSALSPADE; import static gregtech.common.items.IDMetaTool01.WIRECUTTER; import static gregtech.common.items.IDMetaTool01.WRENCH; import static gregtech.common.items.IDMetaTool01.WRENCH_HV; @@ -66,7 +58,6 @@ import gregtech.api.items.MetaGeneratedTool; import gregtech.api.util.GTModHandler; import gregtech.api.util.GTOreDictUnificator; -import gregtech.common.tools.ToolAxe; import gregtech.common.tools.ToolBranchCutter; import gregtech.common.tools.ToolButcheryKnife; import gregtech.common.tools.ToolBuzzSaw; @@ -79,28 +70,21 @@ import gregtech.common.tools.ToolDrillMV; import gregtech.common.tools.ToolFile; import gregtech.common.tools.ToolHardHammer; -import gregtech.common.tools.ToolHoe; import gregtech.common.tools.ToolJackHammer; import gregtech.common.tools.ToolKnife; import gregtech.common.tools.ToolMortar; -import gregtech.common.tools.ToolPickaxe; -import gregtech.common.tools.ToolPlow; import gregtech.common.tools.ToolPlunger; import gregtech.common.tools.ToolRollingPin; import gregtech.common.tools.ToolSaw; import gregtech.common.tools.ToolScoop; import gregtech.common.tools.ToolScrewdriver; import gregtech.common.tools.ToolScrewdriverLV; -import gregtech.common.tools.ToolSense; -import gregtech.common.tools.ToolShovel; import gregtech.common.tools.ToolSoftHammer; import gregtech.common.tools.ToolSolderingIron; -import gregtech.common.tools.ToolSword; import gregtech.common.tools.ToolTurbineHuge; import gregtech.common.tools.ToolTurbineLarge; import gregtech.common.tools.ToolTurbineNormal; import gregtech.common.tools.ToolTurbineSmall; -import gregtech.common.tools.ToolUniversalSpade; import gregtech.common.tools.ToolWireCutter; import gregtech.common.tools.ToolWrench; import gregtech.common.tools.ToolWrenchHV; @@ -121,48 +105,6 @@ public class MetaGeneratedTool01 extends MetaGeneratedTool { public MetaGeneratedTool01() { super("metatool.01"); INSTANCE = this; - addTool( - SWORD.ID, - "Sword", - "", - new ToolSword(), - ToolDictNames.craftingToolSword, - ToolDictNames.craftingToolBlade, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.TELUM, 4L)); - addTool( - PICKAXE.ID, - "Pickaxe", - "", - new ToolPickaxe(), - ToolDictNames.craftingToolPickaxe, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.PERFODIO, 4L)); - addTool( - SHOVEL.ID, - "Shovel", - "", - new ToolShovel(), - ToolDictNames.craftingToolShovel, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.PERFODIO, 4L)); - addTool( - AXE.ID, - "Axe", - "", - new ToolAxe(), - ToolDictNames.craftingToolAxe, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.METO, 2L), - new TCAspects.TC_AspectStack(TCAspects.ARBOR, 2L)); - addTool( - HOE.ID, - "Hoe", - "", - new ToolHoe(), - ToolDictNames.craftingToolHoe, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.MESSIS, 4L)); addTool( SAW.ID, "Saw", @@ -273,21 +215,6 @@ public MetaGeneratedTool01() { new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), new TCAspects.TC_AspectStack(TCAspects.METO, 2L), new TCAspects.TC_AspectStack(TCAspects.HERBA, 2L)); - GregTechAPI.registerTool( - addTool( - UNIVERSALSPADE.ID, - "Universal Spade", - "", - new ToolUniversalSpade(), - ToolDictNames.craftingToolBlade, - ToolDictNames.craftingToolShovel, - ToolDictNames.craftingToolCrowbar, - ToolDictNames.craftingToolSaw, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.TELUM, 1L), - new TCAspects.TC_AspectStack(TCAspects.METO, 1L), - new TCAspects.TC_AspectStack(TCAspects.FABRICO, 1L)), - GregTechAPI.sCrowbarList); addTool( KNIFE.ID, "Knife", @@ -308,25 +235,6 @@ public MetaGeneratedTool01() { new TCAspects.TC_AspectStack(TCAspects.FABRICO, 2L), new TCAspects.TC_AspectStack(TCAspects.CORPUS, 4L)); - addTool( - SENSE.ID, - "Sense", - "Because a Scythe doesn't make Sense", - new ToolSense(), - ToolDictNames.craftingToolBlade, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.METO, 2L), - new TCAspects.TC_AspectStack(TCAspects.HERBA, 2L), - new TCAspects.TC_AspectStack(TCAspects.MORTUUS, 2L)); - addTool( - PLOW.ID, - "Plow", - "Used to get rid of Snow", - new ToolPlow(), - ToolDictNames.craftingToolPlow, - new TCAspects.TC_AspectStack(TCAspects.INSTRUMENTUM, 2L), - new TCAspects.TC_AspectStack(TCAspects.METO, 2L), - new TCAspects.TC_AspectStack(TCAspects.GELUM, 2L)); addTool( PLUNGER.ID, "Plunger", @@ -705,31 +613,6 @@ private void initCraftingShapedRecipes() { new Object[] { " S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.IronWood), 'S', OrePrefixes.stick.get(Materials.IronWood) }); - GTModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(SWORD.ID, 1, Materials.Flint, Materials.Wood, null), - GTModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "F", "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GTModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(PICKAXE.ID, 1, Materials.Flint, Materials.Wood, null), - GTModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "FFF", " S ", " S ", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GTModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(SHOVEL.ID, 1, Materials.Flint, Materials.Wood, null), - GTModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "F", "S", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GTModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(AXE.ID, 1, Materials.Flint, Materials.Wood, null), - GTModHandler.RecipeBits.MIRRORED | GTModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "FF", "FS", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); - GTModHandler.addCraftingRecipe( - INSTANCE.getToolWithStats(HOE.ID, 1, Materials.Flint, Materials.Wood, null), - GTModHandler.RecipeBits.MIRRORED | GTModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', - new ItemStack(Items.flint, 1) }); GTModHandler.addCraftingRecipe( INSTANCE.getToolWithStats(KNIFE.ID, 1, Materials.Flint, Materials.Wood, null), GTModHandler.RecipeBits.NOT_REMOVABLE, diff --git a/src/main/java/gregtech/common/items/flinttools/FlintAxe.java b/src/main/java/gregtech/common/items/flinttools/FlintAxe.java new file mode 100644 index 00000000000..207165ef60c --- /dev/null +++ b/src/main/java/gregtech/common/items/flinttools/FlintAxe.java @@ -0,0 +1,30 @@ +package gregtech.common.items.flinttools; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.Item; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; + +public class FlintAxe extends ItemAxe { + + public FlintAxe() { + super(FlintTools.FLINT_MATERIAL); + this.setUnlocalizedName("flintAxe"); + this.setTextureName("gregtech:tools/flintAxe"); + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List subItems) { + // Create the default sword item + ItemStack flintTool = new ItemStack(this); + + // Enchant the sword with Fire Aspect I + flintTool.addEnchantment(Enchantment.fireAspect, 1); + + // Add the enchanted sword to the creative tab and NEI + subItems.add(flintTool); + } +} diff --git a/src/main/java/gregtech/common/items/flinttools/FlintHoe.java b/src/main/java/gregtech/common/items/flinttools/FlintHoe.java new file mode 100644 index 00000000000..7e0e1ddc1dd --- /dev/null +++ b/src/main/java/gregtech/common/items/flinttools/FlintHoe.java @@ -0,0 +1,12 @@ +package gregtech.common.items.flinttools; + +import net.minecraft.item.ItemHoe; + +public class FlintHoe extends ItemHoe { + + public FlintHoe() { + super(FlintTools.FLINT_MATERIAL); + this.setUnlocalizedName("flintHoe"); + this.setTextureName("gregtech:tools/flintHoe"); + } +} diff --git a/src/main/java/gregtech/common/items/flinttools/FlintPickaxe.java b/src/main/java/gregtech/common/items/flinttools/FlintPickaxe.java new file mode 100644 index 00000000000..eb090652611 --- /dev/null +++ b/src/main/java/gregtech/common/items/flinttools/FlintPickaxe.java @@ -0,0 +1,12 @@ +package gregtech.common.items.flinttools; + +import net.minecraft.item.ItemPickaxe; + +public class FlintPickaxe extends ItemPickaxe { + + public FlintPickaxe() { + super(FlintTools.FLINT_MATERIAL); + this.setUnlocalizedName("flintPickaxe"); + this.setTextureName("gregtech:tools/flintPickaxe"); + } +} diff --git a/src/main/java/gregtech/common/items/flinttools/FlintShovel.java b/src/main/java/gregtech/common/items/flinttools/FlintShovel.java new file mode 100644 index 00000000000..708b055f017 --- /dev/null +++ b/src/main/java/gregtech/common/items/flinttools/FlintShovel.java @@ -0,0 +1,12 @@ +package gregtech.common.items.flinttools; + +import net.minecraft.item.ItemSpade; + +public class FlintShovel extends ItemSpade { + + public FlintShovel() { + super(FlintTools.FLINT_MATERIAL); + this.setUnlocalizedName("flintShovel"); + this.setTextureName("gregtech:tools/flintShovel"); + } +} diff --git a/src/main/java/gregtech/common/items/flinttools/FlintSword.java b/src/main/java/gregtech/common/items/flinttools/FlintSword.java new file mode 100644 index 00000000000..0dc482cf556 --- /dev/null +++ b/src/main/java/gregtech/common/items/flinttools/FlintSword.java @@ -0,0 +1,30 @@ +package gregtech.common.items.flinttools; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; + +public class FlintSword extends ItemSword { + + public FlintSword() { + super(FlintTools.FLINT_MATERIAL); + this.setUnlocalizedName("flintSword"); + this.setTextureName("gregtech:tools/flintSword"); + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List subItems) { + // Create the default sword item + ItemStack flintTool = new ItemStack(this); + + // Enchant the sword with Fire Aspect I + flintTool.addEnchantment(Enchantment.fireAspect, 1); + + // Add the enchanted sword to the creative tab and NEI + subItems.add(flintTool); + } +} diff --git a/src/main/java/gregtech/common/items/flinttools/FlintTools.java b/src/main/java/gregtech/common/items/flinttools/FlintTools.java new file mode 100644 index 00000000000..f883ef05a84 --- /dev/null +++ b/src/main/java/gregtech/common/items/flinttools/FlintTools.java @@ -0,0 +1,181 @@ +package gregtech.common.items.flinttools; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.oredict.ShapedOreRecipe; + +import org.jetbrains.annotations.NotNull; + +import com.gtnewhorizons.postea.api.ItemStackReplacementManager; + +import cpw.mods.fml.common.registry.GameRegistry; + +public class FlintTools { + + public static Item.ToolMaterial FLINT_MATERIAL = EnumHelper.addToolMaterial("FLINT", 1, 128, 4.0F, 1.0F, 5); + + public static Item AXE; + public static Item SWORD; + public static Item PICKAXE; + public static Item SHOVEL; + public static Item HOE; + + public static void registerTools() { + // Create items. + AXE = new FlintAxe(); + SWORD = new FlintSword(); + PICKAXE = new FlintPickaxe(); + SHOVEL = new FlintShovel(); + HOE = new FlintHoe(); + + // Register them with minecraft. + GameRegistry.registerItem(AXE, "flintAxe"); + GameRegistry.registerItem(SWORD, "flintSword"); + GameRegistry.registerItem(PICKAXE, "flintPickaxe"); + GameRegistry.registerItem(SHOVEL, "flintShovel"); + GameRegistry.registerItem(HOE, "flintHoe"); + } + + public static void registerRecipes() { + // Flint Sword Recipe, with + GameRegistry.addRecipe( + new EnchantedRecipe( + new ItemStack(FlintTools.SWORD), + " F ", + " F ", + " S ", + 'F', + Items.flint, + 'S', + Items.stick)); + + // Flint Pickaxe Recipe + GameRegistry + .addRecipe(new ItemStack(FlintTools.PICKAXE), "FFF", " S ", " S ", 'F', Items.flint, 'S', Items.stick); + + // Flint Axe Recipe with Fire Aspect I + GameRegistry.addRecipe( + new EnchantedRecipe( + new ItemStack(FlintTools.AXE), + "FF ", + "FS ", + " S ", + 'F', + Items.flint, + 'S', + Items.stick)); + + GameRegistry.addRecipe( + new EnchantedRecipe( + new ItemStack(FlintTools.AXE), + " FF", + " SF", + " S ", + 'F', + Items.flint, + 'S', + Items.stick)); + + // Flint Shovel Recipe + GameRegistry + .addRecipe(new ItemStack(FlintTools.SHOVEL), " F ", " S ", " S ", 'F', Items.flint, 'S', Items.stick); + + // Flint Hoe Recipe + GameRegistry.addRecipe(new ItemStack(FlintTools.HOE), "FF ", " S ", " S ", 'F', Items.flint, 'S', Items.stick); + + GameRegistry.addRecipe(new ItemStack(FlintTools.HOE), " FF", " S ", " S ", 'F', Items.flint, 'S', Items.stick); + } + + public static NBTTagCompound transformFlintTool(NBTTagCompound tagCompound) { + int oldId = tagCompound.getShort("Damage"); + int id; + boolean fireAspect = false; + + switch (oldId) { + case 0: + id = Item.getIdFromItem(FlintTools.SWORD); + fireAspect = true; + break; + case 2: + id = Item.getIdFromItem(FlintTools.PICKAXE); + break; + case 4: + id = Item.getIdFromItem(FlintTools.SHOVEL); + break; + case 6: + id = Item.getIdFromItem(FlintTools.AXE); + fireAspect = true; + break; + case 8: + id = Item.getIdFromItem(FlintTools.HOE); + break; + case 40: // Sense tool + id = 0; + break; + default: + return tagCompound; // No transform needed. + } + + tagCompound.setShort("id", (short) id); + tagCompound.setShort("Damage", (short) 0); + tagCompound.setTag("tag", new NBTTagCompound()); // Erase old GT data. + + // Apply Fire Aspect enchantment if fireAspect is true + if (fireAspect) { + NBTTagCompound enchantTag = getEnchantedTagCompound(); + + // Attach the new tag containing the enchantments to the tool + tagCompound.setTag("tag", enchantTag); + } + + return tagCompound; + } + + @NotNull + private static NBTTagCompound getEnchantedTagCompound() { + NBTTagCompound enchantTag = new NBTTagCompound(); + NBTTagList enchantments = new NBTTagList(); + + // Add Fire Aspect enchantment + NBTTagCompound fireAspectTag = new NBTTagCompound(); + fireAspectTag.setShort("id", (short) Enchantment.fireAspect.effectId); // Fire Aspect ID + fireAspectTag.setShort("lvl", (short) 1); // Level 1 + enchantments.appendTag(fireAspectTag); + + // Attach enchantments list to the "tag" NBTTagCompound + enchantTag.setTag("ench", enchantments); + return enchantTag; + } + + public static void registerPosteaTransformations() { + ItemStackReplacementManager.addItemReplacement("gregtech:gt.metatool.01", FlintTools::transformFlintTool); + } + + private static class EnchantedRecipe extends ShapedOreRecipe { + + private final ItemStack result; + + public EnchantedRecipe(ItemStack result, Object... recipe) { + super(result, recipe); + this.result = result; + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting inventory) { + ItemStack craftedItem = result.copy(); + craftedItem.addEnchantment(Enchantment.fireAspect, 1); // Add Fire Aspect I + return craftedItem; + } + + @Override + public ItemStack getRecipeOutput() { + return result; + } + } +} diff --git a/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java b/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java index a84cb8ac910..9364fd35b24 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java @@ -361,7 +361,7 @@ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aInde @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { - return isAutomatable() && (aIndex == 0 && isItemValidFluidFilledItem(aStack)) + return isAutomatable() && (aIndex == 0 && isValidFluidInputSlotItem(aStack)) || (aIndex == 2 && isItemValidFuel(aStack)); } @@ -432,7 +432,7 @@ protected IDrawable[] getAshSlotBackground() { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new SlotWidget(inventoryHandler, 0).setFilter(this::isItemValidFluidFilledItem) + new SlotWidget(inventoryHandler, 0).setFilter(this::isValidFluidInputSlotItem) .setPos(43, 25) .setBackground(getGUITextureSet().getItemSlot(), getOverlaySlotIn())) .widget( @@ -473,8 +473,9 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .setSize(18, 18)); } - private boolean isItemValidFluidFilledItem(@NotNull ItemStack stack) { - return isFluidInputAllowed(GTUtility.getFluidForFilledItem(stack, true)); + private boolean isValidFluidInputSlotItem(@NotNull ItemStack stack) { + return GTUtility.fillFluidContainer(GTModHandler.getSteam(getSteamCapacity()), stack, false, true) != null + || isFluidInputAllowed(GTUtility.getFluidForFilledItem(stack, true)); } protected Widget createFuelSlot() { diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java index d1bc27310a1..b6a8cacc8e3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java @@ -187,7 +187,7 @@ public void updateSlotFluids() { public boolean isItemEmpty() { updateSlotItems(); - return itemInventory.isEmpty() && sharedItemGetter.getSharedItem().length == 0; + return itemInventory.isEmpty(); } public boolean isFluidEmpty() { @@ -201,13 +201,13 @@ public boolean isEmpty() { @Override public ItemStack[] getItemInputs() { - if (isItemEmpty()) return new ItemStack[0]; + if (isEmpty()) return new ItemStack[0]; return ArrayUtils.addAll(itemInventory.toArray(new ItemStack[0]), sharedItemGetter.getSharedItem()); } @Override public FluidStack[] getFluidInputs() { - if (isFluidEmpty()) return new FluidStack[0]; + if (isEmpty()) return new FluidStack[0]; return fluidInventory.toArray(new FluidStack[0]); } diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java index 7ddf136a728..a9208d0e63a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java @@ -157,7 +157,7 @@ private long getCacheCapacity() { * Check if the internal cache can still fit more fluids in it */ public boolean canAcceptFluid() { - return getCachedAmount() < getCacheCapacity(); + return getCachedAmount() < getCacheCapacity() || lastInputTick == tickCounter; } /** diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEBetterJukebox.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEBetterJukebox.java index 8f1db317a28..960ebb20dd5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEBetterJukebox.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEBetterJukebox.java @@ -27,6 +27,7 @@ import org.joml.Vector4i; import com.google.common.collect.ImmutableList; +import com.gtnewhorizon.gtnhlib.api.MusicRecordMetadataProvider; import com.gtnewhorizons.modularui.api.drawable.FallbackableUITexture; import com.gtnewhorizons.modularui.api.drawable.UITexture; import com.gtnewhorizons.modularui.api.math.Pos2d; @@ -230,16 +231,21 @@ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { updateEmitterList(); } if (doesSlotContainValidRecord(playbackSlot) - && mInventory[playbackSlot].getItem() instanceof ItemRecord record) { - final ResourceLocation resource = record.getRecordResource(record.recordName); + && mInventory[getInputSlot() + playbackSlot].getItem() instanceof ItemRecord record) { + final ResourceLocation resource, playPath; + if (record instanceof MusicRecordMetadataProvider mrmp) { + resource = mrmp.getMusicRecordResource(mInventory[getInputSlot() + playbackSlot]); + playPath = resource; + } else { + resource = record.getRecordResource(record.recordName); + playPath = new ResourceLocation(resource.getResourceDomain(), "records." + resource.getResourcePath()); + } currentlyPlaying = record; // Assume a safe disc duration of 500 seconds if not known in the registry discDurationMs = GTMusicSystem.getMusicRecordDurations() .getOrDefault(resource, 500_000); discStartMs = System.currentTimeMillis() - discProgressMs; - musicSource.setRecord( - new ResourceLocation(resource.getResourceDomain(), "records." + resource.getResourcePath()), - discProgressMs); + musicSource.setRecord(playPath, discProgressMs); } } @@ -318,10 +324,18 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { stopCurrentSong(now); } else if (canStartPlaying && mInventory[getInputSlot() + playbackSlot].getItem() instanceof ItemRecord record) { - final ResourceLocation resource = record.getRecordResource(record.recordName); + final ResourceLocation resource, playPath; + if (record instanceof MusicRecordMetadataProvider mrmp) { + resource = mrmp.getMusicRecordResource(mInventory[getInputSlot() + playbackSlot]); + playPath = resource; + } else { + resource = record.getRecordResource(record.recordName); + playPath = new ResourceLocation( + resource.getResourceDomain(), + "records." + resource.getResourcePath()); + } currentlyPlaying = record; - musicSource.setRecord( - new ResourceLocation(resource.getResourceDomain(), "records." + resource.getResourcePath())); + musicSource.setRecord(playPath); // Assume a safe disc duration of 500 seconds if not known in the registry discDurationMs = GTMusicSystem.getMusicRecordDurations() .getOrDefault(resource, 500_000); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEScanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEScanner.java index 742a6a0e842..628b8b62baa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEScanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEScanner.java @@ -349,14 +349,16 @@ else if (stackItemDamage == 2 && aStack.toString() if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { for (GTRecipe.RecipeAssemblyLine tRecipe : GTRecipe.RecipeAssemblyLine.sAssemblylineRecipes) { if (GTUtility.areStacksEqual(tRecipe.mResearchItem, aStack, true)) { - boolean failScanner = true; + GTRecipe matchingRecipe = null; + for (GTRecipe scannerRecipe : scannerFakeRecipes.getAllRecipes()) { if (GTUtility.areStacksEqual(scannerRecipe.mInputs[0], aStack, true)) { - failScanner = false; + matchingRecipe = scannerRecipe; break; } } - if (failScanner) { + + if (matchingRecipe == null || aStack.stackSize < matchingRecipe.mInputs[0].stackSize) { return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } @@ -364,7 +366,7 @@ else if (stackItemDamage == 2 && aStack.toString() // Use Assline Utils if (AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(this.mOutputItems[0], tRecipe)) { - aStack.stackSize -= 1; + aStack.stackSize -= matchingRecipe.mInputs[0].stackSize; calculateOverclockedNess(30, tRecipe.mResearchTime); // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEAssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEAssemblyLine.java index 382400c3b1e..a60b939bbb1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEAssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEAssemblyLine.java @@ -131,7 +131,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Assembling Line") + tt.addMachineType("Assembly Line, Assline, AL") .addInfo("Used to make complex machine parts (LuV+)") .addInfo("Does not make Assembler items") .addInfo("Recipe tier is at most Energy Hatch tier + 1.") @@ -140,7 +140,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addStructureInfo( "Layer 1 - Solid Steel Machine Casing, Input Bus (last can be Output Bus), Solid Steel Machine Casing") .addStructureInfo( - "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") + "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembly Line Casing, Reinforced Glass") .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes") @@ -349,7 +349,7 @@ public CheckRecipeResult checkProcessing() { batchMultiplierMax = Math .min(batchMultiplierMax, (double) currentParallel / maxParallelBeforeBatchMode); } - int finalParallel = (int) (batchMultiplierMax * maxParallelBeforeBatchMode); + int finalParallel = (int) (batchMultiplierMax * currentParallelBeforeBatchMode); lEUt = calculator.getConsumption(); mMaxProgresstime = (int) (calculator.getDuration() * batchMultiplierMax); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEBrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEBrickedBlastFurnace.java index 6bd9cb66c8e..e0423d2eb8c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEBrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEBrickedBlastFurnace.java @@ -69,7 +69,7 @@ public String[] getSecondaryDescription() { protected MultiblockTooltipBuilder getTooltip() { if (tooltipBuilder == null) { tooltipBuilder = new MultiblockTooltipBuilder(); - tooltipBuilder.addMachineType("Blast Furnace") + tooltipBuilder.addMachineType("Blast Furnace, BBF") .addInfo("Usable for Steel and general Pyrometallurgy") .addInfo("Has a useful interface, unlike other gregtech multis") .addPollutionAmount(GTMod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java index 47cb6b410a0..4e0413f9a6d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java @@ -19,11 +19,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import gregtech.api.GregTechAPI; import gregtech.api.enums.TierEU; @@ -42,6 +48,7 @@ import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GTLog; +import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.config.MachineStats; @@ -808,4 +815,19 @@ protected int getDoorOrientation(int bottomMeta, int topMeta) { // Invalid combination? return -1; } + + @Override + protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { + super.drawTexts(screenElements, inventorySlot); + screenElements + .widget( + new TextWidget() + .setStringSupplier( + () -> StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + GTUtility.formatNumbers(mEfficiency / 100D) + + "%") + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget(new FakeSyncWidget.IntegerSyncer(() -> mEfficiency, eff -> mEfficiency = eff)); + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDieselEngine.java index e0ee2c144b3..1ba66f1856f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDieselEngine.java @@ -95,7 +95,7 @@ public MTEDieselEngine(String aName) { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Combustion Generator") + tt.addMachineType("Combustion Generator, LCE") .addInfo("Supply Diesel Fuels and 1000L of Lubricant per hour to run") .addInfo("Supply 40L/s of Oxygen to boost output (optional)") .addInfo("Default: Produces 2048EU/t at 100% fuel efficiency") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java index 93b64c16a80..d695e8b9efe 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDistillationTower.java @@ -132,7 +132,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Distillery") + tt.addMachineType("Distillery, DT") .addInfo("Fluids are only put out at the correct height") .addInfo("The correct height equals the slot number in the NEI recipe") .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java index 551efca6844..ffe7efa0ba5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java @@ -117,7 +117,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Blast Furnace") + tt.addMachineType("Blast Furnace, EBF") .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") .addInfo("Each 1800K over the min. Heat allows for an overclock to be upgraded to a perfect overclock.") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEExtremeDieselEngine.java index 8c708dacca7..b6d0b8c5480 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEExtremeDieselEngine.java @@ -40,7 +40,7 @@ public MTEExtremeDieselEngine(String aName) { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Combustion Generator") + tt.addMachineType("Combustion Generator, ECE") .addInfo("Supply high rating fuel and 8000L of Lubricant per hour to run") .addInfo("Supply 40L/s of Liquid Oxygen to boost output (optional)") .addInfo("Default: Produces 10900EU/t at 100% fuel efficiency") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java index 66f78a09dba..17a55c45204 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java @@ -583,7 +583,8 @@ public int getGUIHeight() { public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder .widget( - new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mMachine) .setPos(10, 8)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java index ab5fcd65f5c..5c24ba42c5d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java @@ -107,7 +107,7 @@ public MTEHeatExchanger(String aName) { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Heat Exchanger") + tt.addMachineType("Heat Exchanger, LHE") .addInfo("More complicated than a Fusion Reactor. Seriously") .addInfo("Inputs are Hot Coolant or Lava") .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEImplosionCompressor.java index 742ff79ff60..6a264133c03 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEImplosionCompressor.java @@ -2,14 +2,22 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static gregtech.api.enums.HatchElement.Energy; +import static gregtech.api.enums.HatchElement.InputBus; +import static gregtech.api.enums.HatchElement.Maintenance; +import static gregtech.api.enums.HatchElement.Muffler; +import static gregtech.api.enums.HatchElement.OutputBus; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW; +import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.structure.IStructureElement; import gregtech.GTMod; @@ -17,6 +25,7 @@ import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -123,6 +132,11 @@ protected IStructureElement> getCasingElement() { return ofChain(ofBlock(GregTechAPI.sBlockCasings2, 0), ofBlock(GregTechAPI.sBlockCasings3, 4)); } + @Override + protected List>> getAllowedHatches() { + return ImmutableList.of(InputBus, OutputBus, Maintenance, Energy, Muffler); + } + @Override protected int getHatchTextureIndex() { return 16; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java index c20ec1a016c..7bcd39d1295 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java @@ -210,7 +210,7 @@ public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirect @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Electromagnetic Separator/Polarizer") + tt.addMachineType("Electromagnetic Separator, Polarizer") .addInfo("Use screwdriver to switch mode") .addInfo("Insert an electromagnet into the electromagnet housing to use") .addInfo("Better electromagnets give further bonuses") @@ -218,7 +218,7 @@ protected MultiblockTooltipBuilder createTooltip() { .beginStructureBlock(7, 6, 7, false) .addController("Front Center") .addCasingInfoMin("MagTech Casings", MIN_CASING, false) - .addOtherStructurePart("Any glass", "x12") + .addCasingInfoExactly("Any Glass", 12, false) .addOtherStructurePart("Magnetic Neodymium Frame Box", "x37") .addOtherStructurePart("Electromagnet Housing", "1 Block Above/Behind Controller", 2) .addInputBus("Any Casing", 1) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java index a82e5555474..9ae573798e8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java @@ -172,7 +172,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addController("Front Center") .addCasingInfoMin("Stainless Steel Machine Casing", 45, false) .addCasingInfoExactly("Item Pipe Casing", 19, true) - .addCasingInfoExactly("EV+ Glass", 8, false) + .addCasingInfoExactly("Any Glass", 8, false) .addInputBus("Any Stainless Steel Casing", 1) .addOutputBus("Any Stainless Steel Casing", 1) .addEnergyHatch("Any Stainless Steel Casing", 1) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java index 19f38e4ac3e..314bbfb16e7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java @@ -234,14 +234,13 @@ public void onBlockDestroyed() { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Laser Engraver") + tt.addMachineType("Laser Engraver, HILE") .addInfo("200% faster than single block machines of the same voltage") .addInfo("Uses 80% of the EU normally required") .addInfo("Laser source hatch determines maximum recipe tier and parallels") .addInfo("Can perform recipes up to laser source tier + 1") .addInfo("Parallels equal to the cube root of laser source amperage input") .addInfo("Glass tier determines maximum laser source tier") - .addInfo("Only accepts borosilicate glass (no, really)") .addInfo("UMV glass accepts all laser source hatches") .addInfo("Use screwdriver to disable laser rendering") .addInfo("Use wire cutter to toggle realism mode if you hate angled lasers") @@ -249,8 +248,8 @@ protected MultiblockTooltipBuilder createTooltip() { .addController("Front Center") .addCasingInfoMin("Laser Containment Casing", 35, false) .addCasingInfoExactly("Tungstensteel Frame Box", 9, false) + .addCasingInfoExactly("Glass", 3, true) .addOtherStructurePart("Laser Resistant Plate", "x1") - .addOtherStructurePart("Borosilicate Glass", "x3") .addOtherStructurePart("Laser Source Hatch", "x1", 3) .addInputBus("Any Casing", 1) .addInputHatch("Any Casing", 1) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java index e3691268951..12e600d10f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java @@ -186,7 +186,7 @@ public IStructureDefinition getStructureDefinition() { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Ore Processor") + tt.addMachineType("Ore Processor, IOF") .addInfo("It is OP. I mean ore processor.") .addInfo("Do all ore processing in one step.") .addInfo("Can process up to 1024 ores at a time.") @@ -334,7 +334,7 @@ public CheckRecipeResult checkProcessing() { batchMultiplierMax = Math.min(batchMultiplierMax, (double) currentParallel / maxParallelBeforeBatchMode); } - int finalParallel = (int) (batchMultiplierMax * maxParallelBeforeBatchMode); + int finalParallel = (int) (batchMultiplierMax * currentParallelBeforeBatchMode); // for scanner setCurrentParallelism(finalParallel); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java index 4c310eb2f8b..e566dcb44ab 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java @@ -334,7 +334,8 @@ public CheckRecipeResult checkProcessing() { this.mMaxProgresstime += this.excessFuel / 80; this.excessFuel %= 80; this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); - this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime)); + int burnTime = (int) (this.mMaxProgresstime * getLongBurntimeRatio(tInput)); + this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(burnTime)); this.mEUt = adjustEUtForConfig(getEUt()); this.mOutputItems = new ItemStack[] { GTUtility.getContainerItem(tInput, true) }; tInput.stackSize -= 1; @@ -354,6 +355,11 @@ public CheckRecipeResult checkProcessing() { return CheckRecipeResultRegistry.NO_FUEL_FOUND; } + private double getLongBurntimeRatio(ItemStack tInput) { + double logScale = Math.log((float) GTModHandler.getFuelValue(tInput) / 1600) / Math.log(9); + return 1 + logScale * 0.025; + } + abstract int runtimeBoost(int mTime); abstract boolean isSuperheated(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerBronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerBronze.java index 5d0032df6a4..f06ddfed921 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerBronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerBronze.java @@ -19,6 +19,8 @@ public MTELargeBoilerBronze(String aName) { pollutionPerSecond = GTMod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond; } + public static final int EUT_GENERATED = 400; + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new MTELargeBoilerBronze(this.mName); @@ -76,7 +78,7 @@ public byte getFireboxTextureIndex() { @Override public int getEUt() { - return 400; + return MTELargeBoilerBronze.EUT_GENERATED; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerSteel.java index 32f78c15efb..68ab6c14157 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerSteel.java @@ -19,6 +19,8 @@ public MTELargeBoilerSteel(String aName) { pollutionPerSecond = GTMod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond; } + public static final int EUT_GENERATED = 1000; + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new MTELargeBoilerSteel(this.mName); @@ -76,7 +78,7 @@ public byte getFireboxTextureIndex() { @Override public int getEUt() { - return 1000; + return MTELargeBoilerSteel.EUT_GENERATED; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTitanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTitanium.java index 2893a720087..92007549807 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTitanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTitanium.java @@ -19,6 +19,8 @@ public MTELargeBoilerTitanium(String aName) { pollutionPerSecond = GTMod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond; } + public static final int EUT_GENERATED = 4000; + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new MTELargeBoilerTitanium(this.mName); @@ -76,7 +78,7 @@ public byte getFireboxTextureIndex() { @Override public int getEUt() { - return 4000; + return MTELargeBoilerTitanium.EUT_GENERATED; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTungstenSteel.java index e47c74d58a1..056b6777eaa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoilerTungstenSteel.java @@ -19,6 +19,8 @@ public MTELargeBoilerTungstenSteel(String aName) { pollutionPerSecond = GTMod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond; } + public static final int EUT_GENERATED = 16000; + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new MTELargeBoilerTungstenSteel(this.mName); @@ -76,7 +78,7 @@ public byte getFireboxTextureIndex() { @Override public int getEUt() { - return 16000; + return MTELargeBoilerTungstenSteel.EUT_GENERATED; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java index fcfa5b49231..02c8f19ae0c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java @@ -103,7 +103,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override public MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Chemical Reactor") + tt.addMachineType("Chemical Reactor, LCR") .addInfo("Does not lose efficiency when overclocked") .addInfo("Accepts fluids instead of fluid cells") .beginStructureBlock(3, 3, 3, false) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java index c9c643de8c5..aac42f28c4f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java @@ -20,7 +20,6 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -43,8 +42,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Dyes; import gregtech.api.enums.SoundResource; +import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.MetaGeneratedTool; @@ -53,11 +52,10 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GTUtility; -import gregtech.api.util.LightingHelper; +import gregtech.api.util.GTUtilityClient; import gregtech.api.util.TurbineStatCalculator; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.common.items.MetaGeneratedTool01; -import gregtech.common.render.GTRenderUtil; public abstract class MTELargeTurbine extends MTEEnhancedMultiBlockBase implements ISurvivalConstructable { @@ -81,8 +79,7 @@ protected IStructureDefinition computeValue(Class type) { .addElement( 'h', lazy( - t -> buildHatchAdder(MTELargeTurbine.class) - .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) + t -> buildHatchAdder(MTELargeTurbine.class).atLeast(t.getHatchElements()) .casingIndex(t.getCasingTextureIndex()) .dot(2) .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) @@ -144,6 +141,25 @@ public boolean isRotationChangeAllowed() { return false; } + @SuppressWarnings("unchecked") + protected IHatchElement[] getHatchElements() { + if (getPollutionPerTick(null) == 0) + return new IHatchElement[] { Maintenance, InputHatch, OutputHatch, OutputBus, InputBus }; + return new IHatchElement[] { Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler }; + } + + @Override + public boolean checkStructure(boolean aForceReset, IGregTechTileEntity aBaseMetaTileEntity) { + boolean f = super.checkStructure(aForceReset, aBaseMetaTileEntity); + if (f && getBaseMetaTileEntity().isServerSide()) { + // while is this a client side field, blockrenderer will reuse the server world for client side rendering + // so we must set it as well... + mFormed = true; + return true; + } + return f; + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { return checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) && mMaintenanceHatches.size() == 1 @@ -175,57 +191,13 @@ public IIconContainer[] getTurbineTextureEmpty() { @Override public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { if (!isNewStyleRendering() || !mFormed) return false; - int[] tABCCoord = new int[] { -1, -1, 0 }; - int[] tXYZOffset = new int[3]; - final ForgeDirection tFacing = getBaseMetaTileEntity().getFrontFacing(); - final ExtendedFacing tExtendedFacing = getExtendedFacing(); - final ForgeDirection tDirection = tExtendedFacing.getDirection(); - final LightingHelper tLighting = new LightingHelper(aRenderer); - - // for some reason +x and -z need this field set to true, but not any other sides - if (tFacing == ForgeDirection.NORTH || tFacing == ForgeDirection.EAST) aRenderer.field_152631_f = true; - final Block tBlock = getCasingBlock(); IIconContainer[] tTextures; if (getBaseMetaTileEntity().isActive()) tTextures = getTurbineTextureActive(); else if (hasTurbine()) tTextures = getTurbineTextureFull(); else tTextures = getTurbineTextureEmpty(); - - assert tTextures != null && tTextures.length == tABCCoord.length; - - for (int i = 0; i < 9; i++) { - if (i != 4) { // do not draw ourselves again. - tExtendedFacing.getWorldOffset(tABCCoord, tXYZOffset); - // since structure check passed, we can assume it is turbine casing - int tX = tXYZOffset[0] + aX; - int tY = tXYZOffset[1] + aY; - int tZ = tXYZOffset[2] + aZ; - // we skip the occlusion test, as we always require a working turbine to have a block of air before it - // so the front face cannot be occluded whatsoever in the most cases. - Tessellator.instance.setBrightness( - tBlock.getMixedBrightnessForBlock( - aWorld, - aX + tDirection.offsetX, - tY + tDirection.offsetY, - aZ + tDirection.offsetZ)); - tLighting.setupLighting(tBlock, tX, tY, tZ, tFacing) - .setupColor(tFacing, Dyes._NULL.mRGBa); - GTRenderUtil.renderBlockIcon( - aRenderer, - tBlock, - tX + tDirection.offsetX * 0.001, - tY + tDirection.offsetY * 0.001, - tZ + tDirection.offsetZ * 0.001, - tTextures[i].getIcon(), - tFacing); - } - if (++tABCCoord[0] == 2) { - tABCCoord[0] = -1; - tABCCoord[1]++; - } - } - - aRenderer.field_152631_f = false; + GTUtilityClient + .renderTurbineOverlay(aWorld, aX, aY, aZ, aRenderer, getExtendedFacing(), getCasingBlock(), tTextures); return false; } @@ -252,11 +224,13 @@ public boolean addToMachineList(IGregTechTileEntity tTileEntity, int aBaseCasing @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); + aNBT.setBoolean("turbineFitting", looseFit); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); + looseFit = aNBT.getBoolean("turbineFitting"); } @Override @@ -416,7 +390,8 @@ public String[] getInfoData() { + EnumChatFormatting.YELLOW + GTUtility.formatNumbers(GTUtility.safeInt((long) realOptFlow)) + EnumChatFormatting.RESET - + " L/t" + + " L/" // based on processing time uses ticks or seconds (for plasma) + + (this.mMaxProgresstime == 1 ? 't' : 's') + /* 4 */ EnumChatFormatting.YELLOW + " (" + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGas.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGas.java index a125b5bf335..e7b005f86e1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGas.java @@ -55,10 +55,8 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Gas Turbine") + tt.addMachineType("Gas Turbine, LGT") .addInfo("Needs a Turbine, place inside controller") - .addInfo("Warning: Will be capped at 8192 EU/t in a future update") - .addInfo("See the Advanced Large Gas Turbine as the next, uncapped, option") // .addInfo("The excess fuel that gets consumed will be voided!") .addPollutionAmount(getPollutionPerSecond(null)) .beginStructureBlock(3, 3, 4, true) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGasAdvanced.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGasAdvanced.java index b17c8b325af..2cce05ac745 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGasAdvanced.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineGasAdvanced.java @@ -56,8 +56,8 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Gas Turbine") - .addInfo(EnumChatFormatting.DARK_RED + "Warning: This is an experimental multiblock, subject to changes ") + tt.addMachineType("Gas Turbine, ALGT") + .addInfo(EnumChatFormatting.RED + "DEPRECATED! This machine will be removed in the next major update.") .addInfo("Needs a Turbine, place inside controller") .addInfo("Only accepts gases above 800k EU/bucket") .addInfo("Has no maximum EU/t output, only depends on the Dynamo Hatch") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineHPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineHPSteam.java index 731d6daeb94..6e5404f992c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineHPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineHPSteam.java @@ -11,7 +11,6 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -195,16 +194,4 @@ float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMu public int getDamageToComponent(ItemStack aStack) { return (looseFit && XSTR_INSTANCE.nextInt(4) == 0) ? 0 : 1; } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setBoolean("turbineFitting", looseFit); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - looseFit = aNBT.getBoolean("turbineFitting"); - } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbinePlasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbinePlasma.java index 41f3b74c493..a3eebf3dace 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbinePlasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbinePlasma.java @@ -58,7 +58,7 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Plasma Turbine") + tt.addMachineType("Plasma Turbine, LPT") .addInfo("Needs a Turbine, place inside controller") .addInfo("Use your Fusion Reactor to produce the Plasma") .beginStructureBlock(3, 3, 4, true) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineSteam.java index b0ad701cc98..757e3381c1f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbineSteam.java @@ -12,7 +12,6 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -59,7 +58,7 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Steam Turbine") + tt.addMachineType("Steam Turbine, LST") .addInfo("Needs a Turbine, place inside controller") .addInfo("Outputs Distilled Water as well as producing power") .addInfo("Power output depends on turbine and fitting") @@ -208,16 +207,4 @@ public int getDamageToComponent(ItemStack aStack) { public String[] getInfoData() { return super.getInfoData(); } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setBoolean("turbineFitting", looseFit); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - looseFit = aNBT.getBoolean("turbineFitting"); - } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java index 7a3a0da1367..3297e33545d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java @@ -123,9 +123,8 @@ public void setCoilLevel(HeatingCoilLevel aCoilLevel) { this.heatLevel = aCoilLevel; } - public Integer getCoilTier() { - return (int) this.getCoilLevel() - .getTier() + 1; + public int getCoilTier() { + return heatLevel == null ? 0 : (int) this.heatLevel.getTier() + 1; } private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java index bf5ed7ac42b..f5727274ce8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java @@ -139,7 +139,7 @@ public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirect @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Canner/Fluid Canner") + tt.addMachineType("Canner, Fluid Canner") .addInfo("Use screwdriver to switch mode") .addInfo("100% faster than single block machines of the same voltage") .addInfo("Gains 8 parallels per voltage tier") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiFurnace.java index 7227e022e54..5dab48aba09 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiFurnace.java @@ -198,7 +198,7 @@ public CheckRecipeResult checkProcessing() { batchMultiplierMax = (double) getMaxBatchSize() / calculator.getDuration(); batchMultiplierMax = Math.min(batchMultiplierMax, (double) currentParallel / maxParallelBeforeBatchMode); } - int finalParallel = (int) (batchMultiplierMax * maxParallelBeforeBatchMode); + int finalParallel = (int) (batchMultiplierMax * currentParallelBeforeBatchMode); // Consume inputs and generate outputs ArrayList smeltedOutputs = new ArrayList<>(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java index bc686957386..7206abafd9f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java @@ -137,28 +137,22 @@ private int getPipeTier() { STRUCTURE_PIECE_BODY, (transpose( new String[][] { { " ", "AAAAAAA", " ", " " }, - { "DBCCCCD", "DBCCCCD", "DBCCCCD", " " }, { "DBCCCCD", "DBFFFFD", "DBCCCCD", " " }, - { "DBCCCCD", "DBCCCCD", "DBCCCCD", " " }, { "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA" } }))) + { "ABCCCCA", "ABCCCCA", "ABCCCCA", " " }, { "ABCCCCA", "ABFFFFA", "ABCCCCA", " " }, + { "ABCCCCA", "ABCCCCA", "ABCCCCA", " " }, { "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA" } }))) .addShape( STRUCTURE_PIECE_BODY_ALT, (transpose( new String[][] { { " ", "AAAAAAA", " ", " " }, - { "DCCCCBD", "DCCCCBD", "DCCCCBD", " " }, { "DCCCCBD", "DFFFFBD", "DCCCCBD", " " }, - { "DCCCCBD", "DCCCCBD", "DCCCCBD", " " }, { "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA" } }))) + { "ACCCCBA", "ACCCCBA", "ACCCCBA", " " }, { "ACCCCBA", "AFFFFBA", "ACCCCBA", " " }, + { "ACCCCBA", "ACCCCBA", "ACCCCBA", " " }, { "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA" } }))) .addElement( 'A', - buildHatchAdder(MTEMultiLathe.class).atLeast(Maintenance, Muffler, Energy) + buildHatchAdder(MTEMultiLathe.class).atLeast(InputBus, OutputBus, Maintenance, Muffler, Energy) .casingIndex(((BlockCasings2) GregTechAPI.sBlockCasings2).getTextureIndex(0)) .dot(1) .buildAndChain(onElementPass(MTEMultiLathe::onCasingAdded, ofBlock(GregTechAPI.sBlockCasings2, 0)))) .addElement('B', ofBlock(GregTechAPI.sBlockCasings3, 10)) // Steel Casings .addElement('C', Glasses.chainAllGlasses()) // Glass - .addElement( - 'D', - buildHatchAdder(MTEMultiLathe.class).atLeast(InputBus, OutputBus, Maintenance, Muffler, Energy) - .casingIndex(((BlockCasings2) GregTechAPI.sBlockCasings2).getTextureIndex(0)) - .dot(1) - .buildAndChain(onElementPass(MTEMultiLathe::onCasingAdded, ofBlock(GregTechAPI.sBlockCasings2, 0)))) .addElement( 'F', ofBlocksTiered( @@ -249,8 +243,9 @@ protected MultiblockTooltipBuilder createTooltip() { .addController("Front Center") .addCasingInfoMin("Solid Steel Machine Casing", 42, false) .addCasingInfoExactly("Grate Machine Casing", 9, false) - .addInputBus("Any of the 9 Solid Steel Casing at Each End", 1) - .addOutputBus("Any of the 9 Solid Steel Casing at Each End", 1) + .addCasingInfoExactly("Any Glass", 32, false) + .addInputBus("Any Solid Steel Casing", 1) + .addOutputBus("Any Solid Steel Casing", 1) .addEnergyHatch("Any Solid Steel Casing", 1) .addMaintenanceHatch("Any Solid Steel Casing", 1) .addMufflerHatch("Any Solid Steel Casing", 1) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java index d6c32a2185c..26403cbaa5b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java @@ -75,6 +75,7 @@ public class MTEMultiSolidifier extends MTEExtendedPowerMultiBlockBase= (91 + width * 20) && mMaintenanceHatches.size() == 1; + return casingAmount >= (91 + width * 20); } @Override @@ -344,7 +345,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } public int getMaxParallelRecipes() { - return 4 + (width * PARALLELS_PER_WIDTH) * GTUtility.getTier(this.getMaxInputVoltage()); + return (BASE_PARALLELS + (width * PARALLELS_PER_WIDTH)) * GTUtility.getTier(this.getMaxInputVoltage()); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java index 66bad3d4924..d0bf7d39a67 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java @@ -29,6 +29,7 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; @@ -349,6 +350,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve screenElements .widget( new TextWidget(StatCollector.translateToLocal("GT5U.gui.button.tier") + " " + mSpecialTier) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) .widget( @@ -381,13 +383,13 @@ protected MultiblockTooltipBuilder createTooltip() { .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 2 + EnumChatFormatting.GRAY) .addStructureInfo( EnumChatFormatting.GOLD + "148" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembling Line Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembly Line Casing") .addStructureInfo("") .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 3 + EnumChatFormatting.GRAY) .addStructureInfo( EnumChatFormatting.GOLD + "228" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") .addStructureInfo(EnumChatFormatting.GOLD + "84" + EnumChatFormatting.GRAY + " Stellar Alloy Frame Box") - .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembling Line Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembly Line Casing") .addStructureInfo("") .addStructureInfo( "Requires " + EnumChatFormatting.GOLD diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java index 8e1c170fb4e..99c79b5311d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java @@ -30,7 +30,6 @@ import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; @@ -62,7 +61,7 @@ public abstract class MTEOilDrillBase extends MTEDrillerBase implements IMetricsExporter { private final ArrayList mOilFieldChunks = new ArrayList<>(); - private int mOilId = 0; + private Fluid mOil = null; private int mOilFlow = 0; private int chunkRangeConfig = getRangeInChunks(); @@ -104,14 +103,12 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setInteger("mOilId", mOilId); aNBT.setInteger("chunkRangeConfig", chunkRangeConfig); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - mOilId = aNBT.getInteger("mOilId"); if (aNBT.hasKey("chunkRangeConfig")) chunkRangeConfig = aNBT.getInteger("chunkRangeConfig"); } @@ -120,7 +117,7 @@ protected MultiblockTooltipBuilder createTooltip(String tierSuffix) { .getDisplayName(); final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Pump") + tt.addMachineType("Pump, FDP") .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") .addInfo("Use a Screwdriver to configure range") .addInfo("Use Programmed Circuits to ignore near exhausted oil field") @@ -235,16 +232,16 @@ protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int private boolean tryFillChunkList() { FluidStack tFluid, tOil; - if (mOilId <= 0) { + if (mOil == null) { tFluid = undergroundOilReadInformation(getBaseMetaTileEntity()); if (tFluid == null) return false; - mOilId = tFluid.getFluidID(); + mOil = tFluid.getFluid(); } if (debugDriller) { - GTLog.out.println(" Driller on fluid = " + mOilId); + GTLog.out.println(" Driller on fluid = " + mOil == null ? null : mOil.getName()); } - tOil = new FluidStack(FluidRegistry.getFluid(mOilId), 0); + tOil = new FluidStack(mOil, 0); if (mOilFieldChunks.isEmpty()) { Chunk tChunk = getBaseMetaTileEntity().getWorld() @@ -300,7 +297,7 @@ private boolean tryFillChunkList() { * If vein is depleted, it returns a result with VALID and null fluid. */ protected ValidationResult tryPumpOil(float speed) { - if (mOilId <= 0) return null; + if (mOil == null) return null; if (debugDriller) { GTLog.out.println(" pump speed = " + speed); } @@ -330,7 +327,7 @@ protected FluidStack pumpOil(@Nonnegative float speed, boolean simulate) { } ArrayList emptyChunks = new ArrayList<>(); - FluidStack returnOil = new FluidStack(FluidRegistry.getFluid(mOilId), 0); + FluidStack returnOil = new FluidStack(mOil, 0); for (Chunk tChunk : mOilFieldChunks) { FluidStack pumped = undergroundOil(tChunk, simulate ? -speed : speed); @@ -430,9 +427,8 @@ protected int getFlowRatePerTick() { @NotNull private String getFluidName() { - if (mOilId > 0) { - final Fluid fluid = FluidRegistry.getFluid(mOilId); - return fluid.getLocalizedName(new FluidStack(fluid, 0)); + if (mOil != null) { + return mOil.getLocalizedName(new FluidStack(mOil, 0)); } return "None"; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillInfinite.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillInfinite.java index c722c819b1b..1c24e43d911 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillInfinite.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillInfinite.java @@ -27,7 +27,7 @@ protected MultiblockTooltipBuilder createTooltip() { .getDisplayName(); final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Pump") + tt.addMachineType("Pump, FDP") .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") .beginStructureBlock(3, 7, 3, false) .addController("Front bottom") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java index 13a7396b8b2..c6ac4adf3ec 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java @@ -612,7 +612,7 @@ protected MultiblockTooltipBuilder createTooltip(String tierSuffix) { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); final int baseCycleTime = calculateMaxProgressTime(getMinTier()); - tt.addMachineType("Miner") + tt.addMachineType("Miner, MBM") .addInfo("Use a Screwdriver to configure block radius") .addInfo("Maximum radius is " + GTUtility.formatNumbers((long) getRadiusInChunks() << 4) + " blocks") .addInfo("Use Soldering iron to turn off chunk mode") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java index 5045645956f..bba75222527 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java @@ -31,10 +31,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -76,7 +74,6 @@ import gregtech.api.metatileentity.implementations.MTEHatch; import gregtech.api.metatileentity.implementations.MTEHatchEnergy; import gregtech.api.metatileentity.implementations.MTEHatchInput; -import gregtech.api.objects.GTChunkManager; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.check.CheckRecipeResult; @@ -548,8 +545,6 @@ public class MTEPlasmaForge extends MTEExtendedPowerMultiBlockBase STRUCTURE_DEFINITION = StructureDefinition .builder() @@ -837,7 +832,6 @@ private boolean checkCatalyst() { * extraCatalystNeeded, Integer.MAX_VALUE); selectedCatalyst.amount = neededAmount; - startRecipeProcessing(); for (MTEHatchInput hatch : filterValidMTEs(mInputHatches)) { FluidStack checked = hatch.drain(ForgeDirection.UNKNOWN, selectedCatalyst, true); @@ -848,11 +842,9 @@ private boolean checkCatalyst() { neededAmount -= checked.amount; if (neededAmount == 0) { - endRecipeProcessing(); return true; } } - endRecipeProcessing(); return false; } @@ -1074,48 +1066,6 @@ private double calculateTier(long voltage) { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide() && !aBaseMetaTileEntity.isAllowedToWork()) { - // If machine has stopped, stop chunkloading. - GTChunkManager.releaseTicket((TileEntity) aBaseMetaTileEntity); - isMultiChunkloaded = false; - } else if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && !isMultiChunkloaded) { - // Load a 3x3 area centered on controller when machine is running. - GTChunkManager.releaseTicket((TileEntity) aBaseMetaTileEntity); - - int ControllerXCoordinate = ((TileEntity) aBaseMetaTileEntity).xCoord; - int ControllerZCoordinate = ((TileEntity) aBaseMetaTileEntity).zCoord; - - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate + 16)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate - 16)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate + 16)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate - 16)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate + 16)); - GTChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate - 16)); - - isMultiChunkloaded = true; - } - super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEResearchCompleter.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEResearchCompleter.java new file mode 100644 index 00000000000..2ce4950f1d9 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEResearchCompleter.java @@ -0,0 +1,389 @@ +package gregtech.common.tileentities.machines.multi; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GTStructureUtility.ofHatchAdder; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; +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.MTEEnhancedMultiBlockBase; +import gregtech.api.net.GTPacketNodeInfo; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GTUtility; +import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.api.util.shutdown.ShutDownReasonRegistry; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.research.ResearchCategories; +import thaumcraft.api.research.ResearchItem; +import thaumcraft.common.Thaumcraft; +import thaumcraft.common.config.ConfigBlocks; +import thaumcraft.common.config.ConfigItems; +import thaumcraft.common.lib.research.ResearchManager; +import thaumcraft.common.lib.research.ResearchNoteData; +import thaumcraft.common.tiles.TileNode; + +public class MTEResearchCompleter extends MTEEnhancedMultiBlockBase { + + private static final int CASING_INDEX = 184; + private static final int MAX_LENGTH = 13; + private static final int RECIPE_LENGTH = 1200; + private static final int RECIPE_EUT = 120; + private static final float NODE_COST_MULTIPLIER = 1.0f; + + private int recipeAspectCost; + private int aspectsAbsorbed; + + protected int mLength; + protected int mCasing; + protected boolean endFound; + + // For displaying beam + private int lastNodeDistance; + private int lastNodeColor; + private int syncTimer; + + private static final String STRUCTURE_PIECE_FIRST = "first"; + private static final String STRUCTURE_PIECE_LATER = "later"; + private static final String STRUCTURE_PIECE_LAST = "last"; + private static final String STRUCTURE_PIECE_LATER_HINT = "laterHint"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { { "ccc" }, { "g~g" }, { "ccc" }, })) + .addShape(STRUCTURE_PIECE_LATER, transpose(new String[][] { { "c c" }, { "gxg" }, { "c c" }, })) + .addShape(STRUCTURE_PIECE_LAST, transpose(new String[][] { { "c" }, { "g" }, { "c" }, })) + .addShape(STRUCTURE_PIECE_LATER_HINT, transpose(new String[][] { { "c c" }, { "g g" }, { "c c" }, })) + .addElement( + 'c', + ofChain( // Magical machine casing or hatch + ofHatchAdder(MTEResearchCompleter::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(MTEResearchCompleter::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(MTEResearchCompleter::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(MTEResearchCompleter::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass(MTEResearchCompleter::onCasingFound, ofBlock(GregTechAPI.sBlockCasings8, 8)))) + .addElement( + 'x', + ofChain( // Check for the end but otherwise treat as a skipped spot + onElementPass(MTEResearchCompleter::onEndFound, ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)), + isAir(), // Forgive me + notAir())) + .addElement('g', ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)) // Warded glass + .build(); + + public MTEResearchCompleter(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public MTEResearchCompleter(String aName) { + super(aName); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("recipeAspectCost", recipeAspectCost); + aNBT.setInteger("aspectsAbsorbed", aspectsAbsorbed); + aNBT.setInteger("mLength", mLength); + + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + recipeAspectCost = aNBT.getInteger("recipeAspectCost"); + aspectsAbsorbed = aNBT.getInteger("aspectsAbsorbed"); + mLength = aNBT.getInteger("mLength"); + + super.loadNBTData(aNBT); + } + + // For client beam animation + public void setNodeValues(int nodeDistance, int nodeColor) { + this.lastNodeDistance = nodeDistance; + this.lastNodeColor = nodeColor; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isClientSide()) { + if (aBaseMetaTileEntity.isActive()) { + int xDir = aBaseMetaTileEntity.getBackFacing().offsetX; + int yDir = aBaseMetaTileEntity.getBackFacing().offsetY; + int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ; + double xCoord = aBaseMetaTileEntity.getXCoord() + 0.5; + double yCoord = aBaseMetaTileEntity.getYCoord() + 0.5; + double zCoord = aBaseMetaTileEntity.getZCoord() + 0.5; + Thaumcraft.proxy.beam( + aBaseMetaTileEntity.getWorld(), + xCoord + 0.5 * xDir, + yCoord + 0.5 * yDir, + zCoord + 0.5 * zDir, + xCoord + xDir * lastNodeDistance, + yCoord + yDir * lastNodeDistance, + zCoord + zDir * lastNodeDistance, + 3, + lastNodeColor, + true, + 2, + 1); + } else { + lastNodeDistance = 0; + lastNodeColor = 0; + } + } + + super.onPostTick(aBaseMetaTileEntity, aTick); + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + float progressAmount = ((float) this.mProgresstime) / this.mMaxProgresstime; + int requiredVis = (int) Math.ceil(progressAmount * recipeAspectCost - aspectsAbsorbed); + syncTimer--; + + IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); + int xDir = aBaseMetaTileEntity.getBackFacing().offsetX; + int yDir = aBaseMetaTileEntity.getBackFacing().offsetY; + int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ; + int i = 1; + + // Loop through node spaces and drain them from front to back + while (i < this.mLength - 1 && requiredVis > 0) { + int nodeX = aBaseMetaTileEntity.getXCoord() + xDir * i; + int nodeY = aBaseMetaTileEntity.getYCoord() + yDir * i; + int nodeZ = aBaseMetaTileEntity.getZCoord() + zDir * i; + TileEntity tileEntity = aBaseMetaTileEntity.getWorld() + .getTileEntity(nodeX, nodeY, nodeZ); + + if (tileEntity instanceof TileNode) { + TileNode aNode = (TileNode) tileEntity; + AspectList aspectsBase = aNode.getAspectsBase(); + + for (Aspect aspect : aspectsBase.getAspects()) { + int aspectAmount = aspectsBase.getAmount(aspect); + int drainAmount = Math.min(requiredVis, aspectAmount); + aNode.setNodeVisBase(aspect, (short) (aspectAmount - drainAmount)); + aNode.takeFromContainer(aspect, drainAmount); + requiredVis -= drainAmount; + aspectsAbsorbed += drainAmount; + + if (requiredVis <= 0) { + if (i != lastNodeDistance || aspect.getColor() != lastNodeColor) + sendClientAnimationUpdate(aBaseMetaTileEntity, i, aspect.getColor()); + + break; + } + } + + if (aspectsBase.visSize() <= 0) aBaseMetaTileEntity.getWorld() + .setBlockToAir(nodeX, nodeY, nodeZ); + else { + aNode.markDirty(); + aBaseMetaTileEntity.getWorld() + .markBlockForUpdate(nodeX, nodeY, nodeZ); + } + } + i++; + } + + if (syncTimer <= 0) sendClientAnimationUpdate(aBaseMetaTileEntity, lastNodeDistance, lastNodeColor); + + if (requiredVis > 0) this.stopMachine(ShutDownReasonRegistry.CRITICAL_NONE); + + return super.onRunningTick(aStack); + } + + private void sendClientAnimationUpdate(IGregTechTileEntity aBaseMetaTileEntity, int nodeDistance, int nodeColor) { + int xCoord = aBaseMetaTileEntity.getXCoord(); + int yCoord = aBaseMetaTileEntity.getYCoord(); + int zCoord = aBaseMetaTileEntity.getZCoord(); + int dim = aBaseMetaTileEntity.getWorld().provider.dimensionId; + + GTPacketNodeInfo packet = new GTPacketNodeInfo(xCoord, yCoord, zCoord, dim, nodeDistance, nodeColor); + GTValues.NW.sendToAllAround(packet, new NetworkRegistry.TargetPoint(dim, xCoord, yCoord, zCoord, 128)); + + lastNodeDistance = nodeDistance; + lastNodeColor = nodeColor; + syncTimer = 100; + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ArrayList tInputList = this.getStoredInputs(); + + for (ItemStack stack : tInputList) { + if (GTUtility.isStackValid(stack) && stack.stackSize > 0) { + if (stack.getItem() == ConfigItems.itemResearchNotes + && !stack.stackTagCompound.getBoolean("complete")) { + ResearchNoteData noteData = ResearchManager.getData(stack); + if (noteData == null) continue; + ResearchItem researchItem = ResearchCategories.getResearch(noteData.key); + if (researchItem == null) continue; + + this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; + this.mEfficiencyIncrease = 10000; + this.calculateOverclockedNessMultiInternal( + RECIPE_EUT, + RECIPE_LENGTH, + 1, + this.getMaxInputVoltage(), + false); + if (this.mMaxProgresstime == 2147483646 && this.mEUt == 2147483646) { + return false; + } + if (this.mEUt > 0) { + this.mEUt = -this.mEUt; + } + + // Create a completed version of the note to output + this.mOutputItems = new ItemStack[] { GTUtility.copyAmount(1, stack) }; + this.mOutputItems[0].stackTagCompound.setBoolean("complete", true); + this.mOutputItems[0].setItemDamage(64); + stack.stackSize -= 1; + this.aspectsAbsorbed = 0; + this.recipeAspectCost = (int) Math.ceil(researchItem.tags.visSize() * NODE_COST_MULTIPLIER); + + this.lastNodeDistance = 0; + this.lastNodeColor = 0; + + this.sendLoopStart((byte) 20); + this.updateSlots(); + return true; + } + } + } + + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + mLength = 1; + mCasing = 0; + endFound = false; + + // check front + if (!checkPiece(STRUCTURE_PIECE_FIRST, 1, 1, 0)) return false; + + // check middle pieces + while (!endFound && mLength++ < MAX_LENGTH) { + if (!checkPiece(STRUCTURE_PIECE_LATER, 1, 1, -(mLength - 1))) return false; + } + + return endFound && mLength >= 3 + && checkPiece(STRUCTURE_PIECE_LAST, 0, 1, -(mLength - 1)) + && mCasing >= mLength * 3; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MTEResearchCompleter(this.mName); + } + + protected void onCasingFound() { + mCasing++; + } + + protected void onEndFound() { + endFound = true; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int ColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_GLOW) + .extFacing() + .glow() + .build() }; + } + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected MultiblockTooltipBuilder createTooltip() { + MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); + tt.addMachineType("Research Completer") + .addInfo("Completes Thaumcraft research notes using EU and Thaumcraft nodes") + .addInfo("Place nodes in the center row") + .beginVariableStructureBlock(3, 3, 3, 3, 3, MAX_LENGTH, true) + .addController("Front center") + .addOtherStructurePart("Magical machine casing", "Top and bottom layers outside. 3 x L minimum") + .addOtherStructurePart("Warded glass", "Middle layer outside") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addOutputBus("Any casing") + .toolTipFinisher(); + return tt; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_FIRST, stackSize, hintsOnly, 1, 1, 0); + int tTotalLength = Math.min(MAX_LENGTH, stackSize.stackSize + 2); + for (int i = 1; i < tTotalLength; i++) { + buildPiece(STRUCTURE_PIECE_LATER_HINT, stackSize, hintsOnly, 1, 1, -i); + } + buildPiece(STRUCTURE_PIECE_LAST, stackSize, hintsOnly, 0, 1, -(tTotalLength - 1)); + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTETranscendentPlasmaMixer.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTETranscendentPlasmaMixer.java index d0262198fa1..daaf772ae54 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTETranscendentPlasmaMixer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTETranscendentPlasmaMixer.java @@ -40,6 +40,7 @@ import org.jetbrains.annotations.NotNull; +import com.google.common.collect.ImmutableMap; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; @@ -89,7 +90,8 @@ public class MTETranscendentPlasmaMixer extends MTEEnhancedMultiBlockBase getStructureDefinition() @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Transcendent Mixer") + tt.addMachineType("Transcendent Mixer, TPM") .addInfo("Assisting in all your DTPF needs.") .addInfo("This multiblock will run in parallel according to the amount set") .addInfo("in the parallel menu. All inputs will scale, except time.") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java index 76d36bbe739..c069c7e2b7c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java @@ -54,7 +54,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Vacuum Freezer") + tt.addMachineType("Vacuum Freezer, VF") .addInfo("Cools hot ingots and cells") .beginStructureBlock(3, 3, 3, true) .addController("Front center") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEWormholeGenerator.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEWormholeGenerator.java index 283aee3c293..022dd14d2d0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEWormholeGenerator.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEWormholeGenerator.java @@ -42,6 +42,7 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; @@ -1150,7 +1151,8 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve } return "§7Wormhole status: Inactive§f"; - }), + }) + .setTextAlignment(Alignment.CenterLeft), TextWidget.dynamicString(() -> { if (mLink == null) { @@ -1162,6 +1164,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve return String.format("§7Wormhole diameter: §b%,d§7 ŧf", (long) (radius * 2)); }) + .setTextAlignment(Alignment.CenterLeft) .setEnabled(w -> mWormholeEnergy_UI > 0), TextWidget.dynamicString(() -> { @@ -1175,6 +1178,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve return String.format("§7Max I/O per hatch: §b%,d§7 EU/t§f", (long) (mLink.mWormholeEnergy / 20)); } }) + .setTextAlignment(Alignment.CenterLeft) .setEnabled(w -> mWormholeEnergy_UI > 0), new FakeSyncWidget.DoubleSyncer( diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java index 35aad1292ad..4fc4ecc99f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java @@ -314,13 +314,12 @@ public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirect @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Compressor/Advanced Neutronium Compressor") + tt.addMachineType("Compressor, Advanced Neutronium Compressor") .addInfo(EnumChatFormatting.LIGHT_PURPLE + "Uses the immense power of the event horizon to compress things") .addInfo( EnumChatFormatting.LIGHT_PURPLE + "No longer requires heat management to perform superdense compression") .addInfo(EnumChatFormatting.LIGHT_PURPLE + "Can create advanced singularities!") - .addInfo(EnumChatFormatting.BLUE + "Use circuit 20 for Compressor and 21 for Neutronium Compressor") .addSeparator() .addInfo( "Insert a " + EnumChatFormatting.WHITE @@ -340,7 +339,6 @@ protected MultiblockTooltipBuilder createTooltip() { .addInfo("At 0 stability, the black hole is " + EnumChatFormatting.DARK_RED + "UNSTABLE") .addInfo("Once the black hole becomes unstable, it will void recipes and eventually close itself!") .addSeparator() - .addInfo("Running recipes in the machine will slow the decay rate by " + EnumChatFormatting.RED + "25%") .addInfo( "The decay can be " + EnumChatFormatting.BOLD + "halted" @@ -363,6 +361,7 @@ protected MultiblockTooltipBuilder createTooltip() { + " to close the black hole") .addInfo("To restore stability and reset spacetime costs, close the black hole and open a new one") .addSeparator() + .addInfo(EnumChatFormatting.WHITE + "Use circuit 20 for Compressor and 21 for Neutronium Compressor") .addInfo("400% faster than singleblock machines of the same voltage") .addInfo("Only uses 70% of the EU/t normally required") .addInfo("Gains 8 parallels per voltage tier") @@ -498,6 +497,7 @@ private void searchAndDecrementCatalysts() { blackHoleStatus = 1; blackHoleStability = 100; catalyzingCostModifier = 1; + catalyzingCounter = 0; if (rendererTileEntity != null) rendererTileEntity.startScaleChange(false); collapseTimer = 40; return; @@ -609,11 +609,6 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { // Only do loss reductions if the black hole is stable - unstable black hole can't be frozen if (blackHoleStability >= 0) { - // If the machine is running, reduce stability loss by 25% - if (this.maxProgresstime() != 0) { - stabilityDecrease = 0.75F; - } - // Search all hatches for catalyst fluid // If found enough, drain it and reduce stability loss to 0 // Every 30 drains, double the cost diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEHIPCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEHIPCompressor.java index b50f4171b68..c582cd80232 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEHIPCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEHIPCompressor.java @@ -106,7 +106,7 @@ public class MTEHIPCompressor extends MTEExtendedPowerMultiBlockBase currentTip, IWailaDat + EnumChatFormatting.RESET); } - private boolean doingHIP = false; - @Override protected ProcessingLogic createProcessingLogic() { return new ProcessingLogic() { @@ -365,18 +368,24 @@ protected ProcessingLogic createProcessingLogic() { @NotNull @Override protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) { - doingHIP = false; setSpeedBonus(1F / 3.5F); setEuModifier(0.75F); - if (cooling) { + int recipeReq = recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0); + + // Nerf when heated + if (overheated) { setSpeedBonus(2.5F); setEuModifier(1.1F); } - int recipeReq = recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0); + // If HIP required, check for overheat and potentially crash + // If Black Hole required, no recipe if (recipeReq == 1) { - doingHIP = true; + if (overheated) { + stopMachine(SimpleShutDownReason.ofCritical("overheated")); + return CheckRecipeResultRegistry.NO_RECIPE; + } } else if (recipeReq == 2) { return CheckRecipeResultRegistry.NO_RECIPE; } @@ -385,35 +394,35 @@ protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) { }.setMaxParallelSupplier(this::getMaxParallelRecipes); } - @Override - public boolean onRunningTick(ItemStack aStack) { - if (cooling && doingHIP) { - stopMachine(SimpleShutDownReason.ofCritical("overheated")); - doingHIP = false; - } - return super.onRunningTick(aStack); - } + private int coolingTimer = 0; @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aTick % 20 == 0) { + if (aTick % 20 != 0 || aBaseMetaTileEntity.isClientSide()) return; - // Default to cooling by 2% - float heatMod = -2; + // Default to cooling by 2% + float heatMod = -2; - // If the machine is running, heat by 5% x 0.90 ^ (Coil Tier) - // Cupronickel is 0, so base will be 5% increase - if (this.maxProgresstime() != 0) { - heatMod = (float) (5 * Math.pow(0.9, coilTier)); - } + // If the machine is running, heat by 5% x 0.90 ^ (Coil Tier) + // Cupronickel is 0, so base will be 5% increase + // Also reset cooling speed + if (this.maxProgresstime() != 0) { + heatMod = (float) (5 * Math.pow(0.9, coilTier)); + coolingTimer = 0; + } else { + // If the machine isn't running, add and increment the cooling timer + heatMod -= coolingTimer; + coolingTimer += 2; + } - heat = MathUtils.clamp(heat + heatMod, 0, 100); + heat = MathUtils.clamp(heat + heatMod, 0, 100); - if ((cooling && heat <= 0) || (!cooling && heat >= 100)) { - cooling = !cooling; - } + // Switch overheated conditionally and reset the cooling speed + if ((overheated && heat <= 0) || (!overheated && heat >= 100)) { + overheated = !overheated; + coolingTimer = 0; } // Update all the sensors @@ -424,7 +433,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } public int getMaxParallelRecipes() { - return cooling ? GTUtility.getTier(this.getMaxInputVoltage()) + return overheated ? GTUtility.getTier(this.getMaxInputVoltage()) : (4 * GTUtility.getTier(this.getMaxInputVoltage())); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEIndustrialCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEIndustrialCompressor.java index 313f24f41de..c62cf22896b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEIndustrialCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEIndustrialCompressor.java @@ -63,7 +63,7 @@ public class MTEIndustrialCompressor extends MTEExtendedPowerMultiBlockBase !mMachine)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); screenElements.widget( - new TextWidget("Hit with Soft Mallet to start.").setDefaultColor(EnumChatFormatting.BLACK) + new TextWidget("Hit with Soft Mallet to start.").setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(EnumChatFormatting.BLACK) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())) .widget( @@ -589,7 +591,8 @@ private void drawTopText(DynamicPositionedColumn screenElements) { () -> getBaseMetaTileEntity().isActive(), val -> getBaseMetaTileEntity().setActive(val))); screenElements.widget( - new TextWidget(GTUtility.trans("142", "Running perfectly.")).setDefaultColor(EnumChatFormatting.GREEN) + new TextWidget(GTUtility.trans("142", "Running perfectly.")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(EnumChatFormatting.GREEN) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && getBaseMetaTileEntity().isActive())); screenElements.widget( @@ -690,7 +693,11 @@ private Widget makeUnitStatusWidget(LinkedPurificationUnit unit) { .getLocalName(); String statusString = name + " " + unit.getStatusString(); - final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + int widgetWidth = 0; + if (NetworkUtils.isClient()) { + final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + widgetWidth = fontRenderer.getStringWidth(statusString) + 25; + } row.widget( TextWidget.dynamicString(() -> statusString) @@ -703,7 +710,7 @@ private Widget makeUnitStatusWidget(LinkedPurificationUnit unit) { unit.metaTileEntity() .makeSyncerWidgets()) .widget(new FakeSyncWidget.BooleanSyncer(unit::isActive, unit::setActive)) - .setSize(fontRenderer.getStringWidth(statusString) + 25, 20); + .setSize(widgetWidth, 20); return row; } @@ -716,7 +723,11 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont // Draw basic recipe info final DynamicPositionedColumn controlTextArea = new DynamicPositionedColumn(); drawTopText(controlTextArea); - builder.widget(controlTextArea); + builder.widget( + new Scrollable().setVerticalScroll() + .widget(controlTextArea) + .setPos(10, 7) + .setSize(182, 24)); // Draw line separator builder.widget( diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBaryonicPerfection.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBaryonicPerfection.java index 96e1c8e9c93..b510b4a3414 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBaryonicPerfection.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBaryonicPerfection.java @@ -52,6 +52,7 @@ import gregtech.common.items.IDMetaItem03; import gregtech.common.items.MetaGeneratedItem03; import gregtech.common.tileentities.machines.MTEHatchInputBusME; +import gregtech.loaders.postload.chains.PurifiedWaterRecipes; public class MTEPurificationUnitBaryonicPerfection extends MTEPurificationUnitBase implements ISurvivalConstructable { @@ -311,7 +312,9 @@ protected MultiblockTooltipBuilder createTooltip() { + CATALYST_BASE_COST + "L" + EnumChatFormatting.WHITE - + " Molten Infinity") + + " Molten Infinity" + + EnumChatFormatting.GRAY + + ".") .addInfo("For every duplicate occurrence of an inserted catalyst in the sequence, this cost is doubled.") .addSeparator() .addInfo("Keeps track of the entire sequence of catalysts inserted this recipe.") @@ -321,8 +324,18 @@ protected MultiblockTooltipBuilder createTooltip() { + BARYONIC_MATTER_OUTPUT + "L " + EnumChatFormatting.WHITE - + "Stabilised Baryonic Matter") - .addInfo("At the end of the recipe, all incorrectly inserted catalysts are returned in the output bus.") + + "Stabilised Baryonic Matter" + + EnumChatFormatting.GRAY + + ".") + .addInfo( + "At the end of a successful recipe, outputs additional " + EnumChatFormatting.RED + + PurifiedWaterRecipes.extraBaryonicOutput + + "L " + + EnumChatFormatting.WHITE + + "Stabilised Baryonic Matter" + + EnumChatFormatting.GRAY + + " per parallel.") + .addInfo("At the end of the recipe, returns all incorrectly inserted catalysts in the output bus.") .addSeparator() .addInfo( EnumChatFormatting.AQUA + "" diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java index 14ac444842e..714d189fa29 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java @@ -416,8 +416,8 @@ public void startCycle(int cycleTime, int progressTime) { } public void addRecipeOutputs() { - this.addFluidOutputs(mOutputFluids); - this.addItemOutputs(mOutputItems); + if (mOutputFluids != null) this.addFluidOutputs(mOutputFluids); + if (mOutputItems != null) this.addItemOutputs(mOutputItems); } public void endCycle() { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitDegasser.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitDegasser.java index 34be1df762f..bf503ed6a34 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitDegasser.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitDegasser.java @@ -66,7 +66,7 @@ public class MTEPurificationUnitDegasser extends MTEPurificationUnitBase info = new ArrayList<>(Arrays.asList(super.getInfoData())); - info.add("Current control signal: " + EnumChatFormatting.YELLOW + controlSignal.toString()); + info.add("Current control signal (binary): 0b" + EnumChatFormatting.YELLOW + controlSignal.toString()); info.add("Current output multiplier: " + EnumChatFormatting.YELLOW + outputMultiplier); for (FluidStack stack : insertedStuffThisCycle.values()) { info.add( diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java index f7fd9b041bd..9ceb4f89581 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java @@ -187,14 +187,18 @@ protected MultiblockTooltipBuilder createTooltip() { + MAX_OZONE_GAS_FOR_EXPLOSION + "L " + EnumChatFormatting.WHITE - + "Ozone Gas.") + + "Ozone Gas" + + EnumChatFormatting.GRAY + + ".") .addInfo( "Receives a " + EnumChatFormatting.RED + "20%" + EnumChatFormatting.GRAY + " bonus to success chance for every doubling of " + EnumChatFormatting.WHITE - + "Ozone Gas.") + + "Ozone Gas" + + EnumChatFormatting.GRAY + + ".") .addSeparator() .addInfo( EnumChatFormatting.AQUA + "" diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java index b1301157da7..b8a45b810af 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java @@ -300,7 +300,9 @@ protected MultiblockTooltipBuilder createTooltip() { // TODO: Refer to heating cycles in another way to avoid confusion "Each completed heating cycle boosts success chance by " + EnumChatFormatting.RED + SUCCESS_PER_CYCLE - + "%.") + + "%" + + EnumChatFormatting.GRAY + + ".") .addInfo( "If the temperature ever reaches " + EnumChatFormatting.RED + MAX_TEMP @@ -322,7 +324,9 @@ protected MultiblockTooltipBuilder createTooltip() { + "L/s " + EnumChatFormatting.WHITE + coolantMaterial.getFluid(1) - .getLocalizedName()) + .getLocalizedName() + + EnumChatFormatting.GRAY + + ".") .addInfo( EnumChatFormatting.RED + "Raises " + EnumChatFormatting.GRAY diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java index eaa5a0d5dfe..28c5c82c91a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java @@ -253,7 +253,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addInfo("Removing a lens too early will fail the recipe.") .addInfo("Find the order of lenses in the recipe in NEI,") .addInfo("or use a portable scanner to view the currently requested lens.") - .addInfo("The recipe always starts at the Orundum Lens") + .addInfo("The recipe always starts at the Orundum Lens.") .addSeparator() .addInfo( EnumChatFormatting.AQUA + "" diff --git a/src/main/java/gregtech/common/tools/ToolAxe.java b/src/main/java/gregtech/common/tools/ToolAxe.java deleted file mode 100644 index 03b761227c7..00000000000 --- a/src/main/java/gregtech/common/tools/ToolAxe.java +++ /dev/null @@ -1,175 +0,0 @@ -package gregtech.common.tools; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraft.world.World; -import net.minecraftforge.event.world.BlockEvent; - -import gregtech.api.GregTechAPI; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; - -public class ToolAxe extends GTTool { - - @Override - public int getToolDamagePerBlockBreak() { - return 50; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 100; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 200; - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public float getBaseDamage() { - return 3.0F; - } - - @Override - public float getSpeedMultiplier() { - return 2.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public boolean canBlock() { - return false; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isWeapon() { - return true; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "axe") - || GTToolHarvestHelper.isAppropriateMaterial(aBlock, Material.wood) - || GTToolHarvestHelper.isSpecialBlock(aBlock, Blocks.ladder); - } - - @Override - public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, - int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { - int rAmount = 0; - if ((GregTechAPI.sTimber) && (!aPlayer.isSneaking()) - && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { - int tY = aY + 1; - for (int tH = aPlayer.worldObj.getHeight(); tY < tH; tY++) { - if ((aPlayer.worldObj.getBlock(aX, tY, aZ) != aBlock) - || (!aPlayer.worldObj.func_147480_a(aX, tY, aZ, true))) { - break; - } - rAmount++; - } - } - return rAmount; - } - - @Override - public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, - int aX, int aY, int aZ) { - - if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) - && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))) { - float rAmount = 1.0F; - float tIncrement = 1.0F; - if ((GregTechAPI.sTimber) && !aPlayer.isSneaking()) { - int tY = aY + 1; - for (int tH = aPlayer.worldObj.getHeight(); (tY < tH) - && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); tY++) { - tIncrement += 0.1F; - rAmount += tIncrement; - } - } - return 2.0F * aDefault / rAmount; - } - - return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) - || (aBlock.getMaterial() == Material.plants) - || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault; - } - - @Override - public ItemStack getBrokenItem(ItemStack aStack) { - return null; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? MetaGeneratedTool.getPrimaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.toolHeadAxe.mTextureIndex] - : MetaGeneratedTool.getSecondaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.stick.mTextureIndex]; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID) {} - - @Override - public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " has been chopped by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); - } -} diff --git a/src/main/java/gregtech/common/tools/ToolHoe.java b/src/main/java/gregtech/common/tools/ToolHoe.java deleted file mode 100644 index 8c68d41b44c..00000000000 --- a/src/main/java/gregtech/common/tools/ToolHoe.java +++ /dev/null @@ -1,132 +0,0 @@ -package gregtech.common.tools; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; - -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; -import gregtech.common.items.behaviors.BehaviourHoe; - -public class ToolHoe extends GTTool { - - @Override - public int getToolDamagePerBlockBreak() { - return 50; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 100; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 200; - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public float getBaseDamage() { - return 1.75F; - } - - @Override - public float getSpeedMultiplier() { - return 1.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public boolean canBlock() { - return false; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "hoe") - || GTToolHarvestHelper.isAppropriateMaterial(aBlock, Material.gourd); - } - - @Override - public ItemStack getBrokenItem(ItemStack aStack) { - return null; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? MetaGeneratedTool - .getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadHoe.mTextureIndex] - : MetaGeneratedTool - .getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID) { - aItem.addItemBehavior(aID, new BehaviourHoe(100)); - } - - @Override - public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { - super.onToolCrafted(aStack, aPlayer); - aPlayer.triggerAchievement(AchievementList.buildHoe); - } - - @Override - public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " has been called a stupid Hoe by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); - } -} diff --git a/src/main/java/gregtech/common/tools/ToolKnife.java b/src/main/java/gregtech/common/tools/ToolKnife.java index 908a9daaadc..c5b8273d254 100644 --- a/src/main/java/gregtech/common/tools/ToolKnife.java +++ b/src/main/java/gregtech/common/tools/ToolKnife.java @@ -1,5 +1,7 @@ package gregtech.common.tools; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -9,8 +11,10 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.MetaGeneratedTool; +import gregtech.api.util.GTToolHarvestHelper; -public class ToolKnife extends ToolSword { +public class ToolKnife extends GTTool { @Override public int getToolDamagePerBlockBreak() { @@ -52,11 +56,55 @@ public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override + public boolean canBlock() { + return true; + } + + @Override + public boolean isCrowbar() { + return false; + } + + @Override + public boolean isWeapon() { + return true; + } + + @Override + public boolean isMinableBlock(Block aBlock, byte aMetaData) { + return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "sword") + || GTToolHarvestHelper.isAppropriateMaterial( + aBlock, + Material.leaves, + Material.gourd, + Material.vine, + Material.web, + Material.cloth, + Material.carpet, + Material.plants, + Material.cactus, + Material.cake, + Material.tnt, + Material.sponge); + } + + @Override + public ItemStack getBrokenItem(ItemStack aStack) { + return null; // Copied from ToolSword + } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.KNIFE : null; } + @Override + public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { + return !aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa + : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; + } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( diff --git a/src/main/java/gregtech/common/tools/ToolPickaxe.java b/src/main/java/gregtech/common/tools/ToolPickaxe.java deleted file mode 100644 index 91be7dae29f..00000000000 --- a/src/main/java/gregtech/common/tools/ToolPickaxe.java +++ /dev/null @@ -1,139 +0,0 @@ -package gregtech.common.tools; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; - -import gregtech.GTMod; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; - -public class ToolPickaxe extends GTTool { - - @Override - public int getToolDamagePerBlockBreak() { - return 50; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 100; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 200; - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public float getBaseDamage() { - return 1.5F; - } - - @Override - public float getSpeedMultiplier() { - return 1.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public boolean canBlock() { - return false; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "pickaxe") // - || GTToolHarvestHelper.isAppropriateMaterial( - aBlock, // - Material.rock, - Material.iron, - Material.anvil, - Material.glass); - } - - @Override - public ItemStack getBrokenItem(ItemStack aStack) { - return null; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? MetaGeneratedTool.getPrimaryMaterial( - aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPickaxe.mTextureIndex] - : MetaGeneratedTool - .getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID) {} - - @Override - public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { - super.onToolCrafted(aStack, aPlayer); - aPlayer.triggerAchievement(AchievementList.buildPickaxe); - aPlayer.triggerAchievement(AchievementList.buildBetterPickaxe); - try { - GTMod.achievements.issueAchievement(aPlayer, "flintpick"); - } catch (Exception ignored) {} - } - - @Override - public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " got mined by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); - } -} diff --git a/src/main/java/gregtech/common/tools/ToolPlow.java b/src/main/java/gregtech/common/tools/ToolPlow.java deleted file mode 100644 index e0f25fa2f13..00000000000 --- a/src/main/java/gregtech/common/tools/ToolPlow.java +++ /dev/null @@ -1,110 +0,0 @@ -package gregtech.common.tools; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntitySnowman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraft.world.World; -import net.minecraftforge.event.world.BlockEvent; - -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; - -public class ToolPlow extends GTTool { - - private final ThreadLocal sIsHarvestingRightNow = new ThreadLocal<>(); - - @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, - EntityPlayer aPlayer) { - return (aEntity instanceof EntitySnowman) ? aOriginalDamage * 4.0F : aOriginalDamage; - } - - @Override - public float getBaseDamage() { - return 1.0F; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "plow") - || GTToolHarvestHelper.isAppropriateMaterial(aBlock, Material.snow, Material.craftedSnow); - } - - @Override - public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, - int aX, int aY, int aZ) { - // Speed nerf for using AOE tools to break single block - if (aPlayer != null && aPlayer.isSneaking()) { - return aDefault / 2; - } - return super.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, worldObj, aX, aY, aZ); - } - - @Override - public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, - int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { - int rConversions = 0; - if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { - this.sIsHarvestingRightNow.set(this); - - if (!aPlayer.isSneaking()) { - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int k = -1; k < 2; k++) { - if (((i != 0) || (j != 0) || (k != 0)) && (aStack.getItem() - .getDigSpeed( - aStack, - aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), - aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) - > 0.0F) - && (((EntityPlayerMP) aPlayer).theItemInWorldManager - .tryHarvestBlock(aX + i, aY + j, aZ + k))) { - rConversions++; - } - } - } - } - } - - this.sIsHarvestingRightNow.set(null); - } - return rConversions; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? MetaGeneratedTool.getPrimaryMaterial( - aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPlow.mTextureIndex] - : MetaGeneratedTool - .getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE - + " plew through the yard of " - + EnumChatFormatting.RED - + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE); - } -} diff --git a/src/main/java/gregtech/common/tools/ToolSense.java b/src/main/java/gregtech/common/tools/ToolSense.java deleted file mode 100644 index 55a3882db54..00000000000 --- a/src/main/java/gregtech/common/tools/ToolSense.java +++ /dev/null @@ -1,114 +0,0 @@ -package gregtech.common.tools; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraft.world.World; -import net.minecraftforge.event.world.BlockEvent; - -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; -import gregtech.common.items.behaviors.BehaviourSense; - -public class ToolSense extends GTTool { - - private final ThreadLocal sIsHarvestingRightNow = new ThreadLocal<>(); - - @Override - public float getBaseDamage() { - return 3.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 4.0F; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "sense", "scythe") - || GTToolHarvestHelper.isAppropriateMaterial(aBlock, Material.plants, Material.leaves); - } - - @Override - public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, - int aX, int aY, int aZ) { - // Speed nerf for using AOE tools to break single block - if (aPlayer != null && aPlayer.isSneaking()) { - return aDefault / 2; - } - return super.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, worldObj, aX, aY, aZ); - } - - @Override - public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, - int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { - int rConversions = 0; - if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { - this.sIsHarvestingRightNow.set(this); - - if (!aPlayer.isSneaking()) { - for (int i = -2; i < 3; i++) { - for (int j = -2; j < 3; j++) { - for (int k = -2; k < 3; k++) { - if (((i != 0) || (j != 0) || (k != 0)) && (aStack.getItem() - .getDigSpeed( - aStack, - aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), - aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) - > 0.0F) - && (((EntityPlayerMP) aPlayer).theItemInWorldManager - .tryHarvestBlock(aX + i, aY + j, aZ + k))) { - rConversions++; - } - } - } - } - } - - this.sIsHarvestingRightNow.set(null); - } - return rConversions; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? MetaGeneratedTool.getPrimaryMaterial( - aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSense.mTextureIndex] - : MetaGeneratedTool - .getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID) { - aItem.addItemBehavior(aID, new BehaviourSense(getToolDamagePerBlockBreak())); - } - - @Override - public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE - + " has taken the Soul of " - + EnumChatFormatting.RED - + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE); - } - -} diff --git a/src/main/java/gregtech/common/tools/ToolShovel.java b/src/main/java/gregtech/common/tools/ToolShovel.java deleted file mode 100644 index d4676efeedb..00000000000 --- a/src/main/java/gregtech/common/tools/ToolShovel.java +++ /dev/null @@ -1,127 +0,0 @@ -package gregtech.common.tools; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; - -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; - -public class ToolShovel extends GTTool { - - @Override - public int getToolDamagePerBlockBreak() { - return 50; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 100; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 200; - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public float getBaseDamage() { - return 1.5F; - } - - @Override - public float getSpeedMultiplier() { - return 1.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public boolean canBlock() { - return false; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "shovel") - || GTToolHarvestHelper.isAppropriateMaterial( - aBlock, - Material.sand, - Material.grass, - Material.ground, - Material.snow, - Material.clay); - } - - @Override - public ItemStack getBrokenItem(ItemStack aStack) { - return null; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? MetaGeneratedTool.getPrimaryMaterial( - aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadShovel.mTextureIndex] - : MetaGeneratedTool - .getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID) {} - - @Override - public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " got dug up by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); - } -} diff --git a/src/main/java/gregtech/common/tools/ToolSword.java b/src/main/java/gregtech/common/tools/ToolSword.java deleted file mode 100644 index 03c76f92c6f..00000000000 --- a/src/main/java/gregtech/common/tools/ToolSword.java +++ /dev/null @@ -1,128 +0,0 @@ -package gregtech.common.tools; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; - -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; - -public class ToolSword extends GTTool { - - @Override - public int getToolDamagePerBlockBreak() { - return 200; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 100; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 100; - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public float getBaseDamage() { - return 4.0F; - } - - @Override - public float getSpeedMultiplier() { - return 1.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public boolean canBlock() { - return true; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isWeapon() { - return true; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "sword") - || GTToolHarvestHelper.isAppropriateMaterial( - aBlock, - Material.leaves, - Material.gourd, - Material.vine, - Material.web, - Material.cloth, - Material.carpet, - Material.plants, - Material.cactus, - Material.cake, - Material.tnt, - Material.sponge); - } - - @Override - public ItemStack getBrokenItem(ItemStack aStack) { - return null; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? MetaGeneratedTool.getPrimaryMaterial( - aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSword.mTextureIndex] - : Textures.ItemIcons.HANDLE_SWORD; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { - super.onToolCrafted(aStack, aPlayer); - aPlayer.triggerAchievement(AchievementList.buildSword); - } -} diff --git a/src/main/java/gregtech/common/tools/ToolUniversalSpade.java b/src/main/java/gregtech/common/tools/ToolUniversalSpade.java deleted file mode 100644 index 9333e1f19ca..00000000000 --- a/src/main/java/gregtech/common/tools/ToolUniversalSpade.java +++ /dev/null @@ -1,160 +0,0 @@ -package gregtech.common.tools; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; - -import gregtech.GTMod; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.util.GTToolHarvestHelper; -import gregtech.common.items.behaviors.BehaviourCrowbar; - -public class ToolUniversalSpade extends GTTool { - - @Override - public int getToolDamagePerBlockBreak() { - return 50; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 400; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 100; - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public float getBaseDamage() { - return 3.0F; - } - - @Override - public float getSpeedMultiplier() { - return 0.75F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public boolean canBlock() { - return true; - } - - @Override - public boolean isCrowbar() { - return true; - } - - @Override - public boolean isWeapon() { - return true; - } - - @Override - public boolean isMinableBlock(Block aBlock, byte aMetaData) { - return GTToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "shovel", "axe", "saw", "sword", "crowbar") - || GTToolHarvestHelper.isAppropriateMaterial( - aBlock, - Material.sand, - Material.grass, - Material.ground, - Material.snow, - Material.clay, - Material.leaves, - Material.vine, - Material.wood, - Material.cactus, - Material.circuits, - Material.gourd, - Material.web, - Material.cloth, - Material.carpet, - Material.plants, - Material.cake, - Material.tnt, - Material.sponge); - } - - @Override - public ItemStack getBrokenItem(ItemStack aStack) { - return null; - } - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? MetaGeneratedTool.getPrimaryMaterial( - aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadUniversalSpade.mTextureIndex] - : MetaGeneratedTool - .getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; - } - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? MetaGeneratedTool.getPrimaryMaterial(aStack).mRGBa - : MetaGeneratedTool.getSecondaryMaterial(aStack).mRGBa; - } - - @Override - public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID) { - aItem.addItemBehavior(aID, new BehaviourCrowbar(2, 2000)); - } - - @Override - public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { - super.onToolCrafted(aStack, aPlayer); - aPlayer.triggerAchievement(AchievementList.buildSword); - try { - GTMod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (Exception ignored) {} - } - - @Override - public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " has been digged by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); - } -} diff --git a/src/main/java/gregtech/loaders/load/MTERecipeLoader.java b/src/main/java/gregtech/loaders/load/MTERecipeLoader.java index 46c55dbd828..d13740917bf 100644 --- a/src/main/java/gregtech/loaders/load/MTERecipeLoader.java +++ b/src/main/java/gregtech/loaders/load/MTERecipeLoader.java @@ -2193,11 +2193,6 @@ private static void registerShapedCraftingRecipes() { bits, new Object[] { "PhP", "PFP", aTextPlateWrench, 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'F', ItemList.Casing_Turbine }); - GTModHandler.addCraftingRecipe( - ItemList.Casing_TurbineGasAdvanced.get(1L), - bits, - new Object[] { "PhP", "PFP", aTextPlateWrench, 'P', OrePrefixes.plate.get(Materials.HSSS), 'F', - ItemList.Casing_Turbine }); GTModHandler.addCraftingRecipe( ItemList.Casing_Pipe_Bronze.get(1L), bits, @@ -3492,12 +3487,6 @@ private static void registerShapedCraftingRecipes() { new Object[] { "CPC", aTextPlateMotor, "BPB", 'M', ItemList.Hull_EV, 'B', OrePrefixes.pipeLarge.get(Materials.StainlessSteel), 'C', OrePrefixes.circuit.get(Materials.EV), 'P', OrePrefixes.gearGt.get(Materials.StainlessSteel) }); - GTModHandler.addCraftingRecipe( - ItemList.LargeAdvancedGasTurbine.get(1L), - bitsd, - new Object[] { "CPC", aTextPlateMotor, "BPB", 'M', ItemList.Hull_IV, 'B', - OrePrefixes.pipeLarge.get(Materials.TungstenSteel), 'C', OrePrefixes.circuit.get(Materials.LuV), 'P', - OrePrefixes.gearGt.get(Materials.HSSG) }); GTModHandler.addCraftingRecipe( ItemList.Pump_LV.get(1L), diff --git a/src/main/java/gregtech/loaders/materials/MaterialsInit1.java b/src/main/java/gregtech/loaders/materials/MaterialsInit1.java index a614cbddb87..df57d074af4 100644 --- a/src/main/java/gregtech/loaders/materials/MaterialsInit1.java +++ b/src/main/java/gregtech/loaders/materials/MaterialsInit1.java @@ -684,7 +684,7 @@ public static void load() { Materials.Cumene = new MaterialBuilder(688, TextureSet.SET_FLUID , "Isopropylbenzene").addCell().addFluid().setRGB(85, 34, 0).setColor(Dyes.dyeBrown).setMaterialList(new MaterialStack(Carbon, 9), new MaterialStack(Hydrogen, 12)).addElectrolyzerRecipe().constructMaterial(); Materials.PhosphoricAcid = new MaterialBuilder(689, TextureSet.SET_FLUID , "Phosphoric Acid").setName("PhosphoricAcid_GT5U").addCell().addFluid().setRGB(220, 220, 0).setColor(Dyes.dyeYellow).setMaterialList(new MaterialStack(Hydrogen, 3), new MaterialStack(Phosphorus, 1), new MaterialStack(Oxygen, 4)).constructMaterial(); Materials.SaltWater = new MaterialBuilder(692, TextureSet.SET_FLUID , "Salt Water").addCell().addFluid().setRGB(0, 0, 200).setColor(Dyes.dyeBlue).constructMaterial(); - Materials.IronIIIChloride = new MaterialBuilder(693, TextureSet.SET_FLUID , "Iron III Chloride").setName("IronIIIChloride").addCell().addFluid().setRGB(22, 21, 14).setColor(Dyes.dyeBlack).setMaterialList(new MaterialStack(Chlorine, 3), new MaterialStack(Iron, 1)).addElectrolyzerRecipe().constructMaterial(); + Materials.IronIIIChloride = new MaterialBuilder(693, TextureSet.SET_FLUID , "Iron III Chloride").setName("IronIIIChloride").addCell().addFluid().setRGB(22, 21, 14).setColor(Dyes.dyeBlack).setMaterialList(new MaterialStack(Iron, 1), new MaterialStack(Chlorine, 3)).addElectrolyzerRecipe().constructMaterial(); Materials.LifeEssence = new MaterialBuilder(694, TextureSet.SET_FLUID , "Life").setName("lifeessence").addCell().addFluid().setFuelPower(100).setFuelType(5).setRGB(110, 3, 3).setColor(Dyes.dyeRed).setMaterialList().constructMaterial(); Materials.RoastedCopper = new MaterialBuilder(546, TextureSet.SET_DULL , "Roasted Copper").setName("RoastedCopper").addDustItems().setRGB(77, 18, 18).constructMaterial(); diff --git a/src/main/java/gregtech/loaders/misc/GTBeeDefinition.java b/src/main/java/gregtech/loaders/misc/GTBeeDefinition.java index 59e4ca8cb9e..c7e32b9d676 100644 --- a/src/main/java/gregtech/loaders/misc/GTBeeDefinition.java +++ b/src/main/java/gregtech/loaders/misc/GTBeeDefinition.java @@ -87,6 +87,7 @@ import forestry.apiculture.genetics.IBeeDefinition; import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.core.genetics.alleles.AlleleHelper; +import gregtech.GTMod; import gregtech.api.GregTechAPI; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -101,6 +102,7 @@ import gregtech.common.items.CombType; import gregtech.common.items.DropType; import gregtech.common.items.PropolisType; +import gregtech.loaders.misc.bees.GTAlleleEffect; import gregtech.loaders.misc.bees.GTFlowers; import gtnhlanth.common.register.WerkstoffMaterialPool; @@ -1719,7 +1721,7 @@ public void accept(GTBeeDefinition dis) { beeSpecies.setHumidity(EnumHumidity.NORMAL); beeSpecies.setTemperature(COLD); beeSpecies.setHasEffect(); - }, template -> AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "freezing")), new Consumer<>() { + }, template -> AlleleHelper.instance.set(template, EFFECT, getEffect(FORESTRY, "Glacial")), new Consumer<>() { @Override public void accept(GTBeeDefinition dis) { @@ -1736,7 +1738,7 @@ public void accept(GTBeeDefinition dis) { beeSpecies.setHumidity(EnumHumidity.NORMAL); beeSpecies.setTemperature(ICY); beeSpecies.setHasEffect(); - }, template -> AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "freezing")), new Consumer<>() { + }, template -> AlleleHelper.instance.set(template, EFFECT, getEffect(FORESTRY, "Glacial")), new Consumer<>() { @Override public void accept(GTBeeDefinition dis) { @@ -2701,7 +2703,12 @@ static IAlleleBeeEffect getEffect(byte modid, String name) { case GREGTECH -> "gregtech.effect" + name; default -> "forestry.effect" + name; }; - return (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s); + IAlleleBeeEffect allele = (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s); + if (allele == null) { + GTMod.GT_FML_LOGGER.warn("Attempted to get unknown bee effect: " + s); + allele = GTAlleleEffect.FORESTRY_BASE_EFFECT; + } + return allele; } static IAlleleFlowers getFlowers(byte modid, String name) { @@ -2712,7 +2719,11 @@ static IAlleleFlowers getFlowers(byte modid, String name) { case GREGTECH -> "gregtech.flower" + name; default -> "forestry.flowers" + name; }; - return (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s); + IAlleleFlowers allele = (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s); + if (allele == null) { + GTMod.GT_FML_LOGGER.warn("Attempted to get unknown bee flower: " + s); + } + return allele; } private static IAlleleBeeSpecies getSpecies(byte modid, String name) { @@ -2725,6 +2736,7 @@ private static IAlleleBeeSpecies getSpecies(byte modid, String name) { }; IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s); if (ret == null) { + GTMod.GT_FML_LOGGER.warn("Attempted to get unknown bee species: " + s); ret = NAQUADRIA.species; } diff --git a/src/main/java/gregtech/loaders/misc/GTBranchDefinition.java b/src/main/java/gregtech/loaders/misc/GTBranchDefinition.java index 9bc4acb1141..c8fb4529544 100644 --- a/src/main/java/gregtech/loaders/misc/GTBranchDefinition.java +++ b/src/main/java/gregtech/loaders/misc/GTBranchDefinition.java @@ -22,7 +22,6 @@ import static gregtech.loaders.misc.GTBeeDefinition.getEffect; import static gregtech.loaders.misc.GTBeeDefinition.getFlowers; import static gregtech.loaders.misc.GTBeeDefinitionReference.EXTRABEES; -import static gregtech.loaders.misc.GTBeeDefinitionReference.MAGICBEES; import java.util.Arrays; import java.util.function.Consumer; @@ -95,7 +94,7 @@ public enum GTBranchDefinition { AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.END); AlleleHelper.instance.set(alleles, FLOWERING, Flowering.AVERAGE); AlleleHelper.instance.set(alleles, SPEED, GTBees.speedBlinding); - AlleleHelper.instance.set(alleles, SPEED, getEffect(EXTRABEES, "radioactive")); + AlleleHelper.instance.set(alleles, EFFECT, getEffect(EXTRABEES, "radioactive")); }), TWILIGHT("Nemoris Obscuri", alleles -> { AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); @@ -144,7 +143,7 @@ public enum GTBranchDefinition { INFUSEDSHARD("Infusa Shard", alleles -> { AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); AlleleHelper.instance.set(alleles, TOLERANT_FLYER, true); - AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(MAGICBEES, "rock")); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTEST); AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.SHORTEST); AlleleHelper.instance.set(alleles, SPEED, Speed.FASTEST); diff --git a/src/main/java/gregtech/loaders/misc/bees/GTAlleleEffect.java b/src/main/java/gregtech/loaders/misc/bees/GTAlleleEffect.java index 128e3dfeb16..e2403178d1d 100644 --- a/src/main/java/gregtech/loaders/misc/bees/GTAlleleEffect.java +++ b/src/main/java/gregtech/loaders/misc/bees/GTAlleleEffect.java @@ -38,11 +38,15 @@ public GTAlleleEffect setIsCombinable(boolean canCombine) { @Override public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - int ticksPassed = storedData.getInteger(0); - if (ticksPassed >= this.tickThrottle) { - storedData = this.doEffectTickThrottled(genome, storedData, housing); + if (storedData != null) { + int ticksPassed = storedData.getInteger(0); + if (ticksPassed >= this.tickThrottle) { + storedData = this.doEffectTickThrottled(genome, storedData, housing); + } else { + storedData.setInteger(0, ticksPassed + 1); + } } else { - storedData.setInteger(0, ticksPassed + 1); + storedData = this.doEffectTickThrottled(genome, storedData, housing); } return storedData; } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java index 58c59fa895e..01510eece20 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java @@ -70,7 +70,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic .addTo(cannerRecipes); } if (!aMaterial.mBlastFurnaceRequired) { - GTRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); + GTRecipeRegistrator + .registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null, false); if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { GTRecipeRegistrator.registerReverseArcSmelting( GTUtility.copyAmount(1, aStack), @@ -518,7 +519,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic .eut(4) .addTo(packagerRecipes); if (!aMaterial.mBlastFurnaceRequired) { - GTRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); + GTRecipeRegistrator + .registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null, true); if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { GTRecipeRegistrator.registerReverseArcSmelting( GTUtility.copyAmount(1, aStack), @@ -538,7 +540,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic .eut(4) .addTo(packagerRecipes); if (!aMaterial.mBlastFurnaceRequired) { - GTRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); + GTRecipeRegistrator + .registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null, true); if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { GTRecipeRegistrator.registerReverseArcSmelting( GTUtility.copyAmount(1, aStack), diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java index 6724a877988..e937f3f6a5d 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java @@ -74,9 +74,17 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic } // Reverse recipes { - GTRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); GTRecipeRegistrator - .registerReverseMacerating(aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false); + .registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null, false); + GTRecipeRegistrator.registerReverseMacerating( + aStack, + aMaterial, + aPrefix.mMaterialAmount, + null, + null, + null, + false, + false); if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) { GTRecipeRegistrator.registerReverseArcSmelting( GTUtility.copyAmount(1, aStack), diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java index b4df540003e..c0fa36ab323 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java @@ -66,9 +66,9 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic } } - GTRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); + GTRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null, true); GTRecipeRegistrator - .registerReverseMacerating(aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false); + .registerReverseMacerating(aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false, true); if (!aMaterial.contains(SubTag.NO_SMELTING) && GTOreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L) != null) { GTValues.RA.stdBuilder() diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java index 0f4b3d28b65..9a42178b1c4 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java @@ -327,47 +327,6 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic } } - if (GTOreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial.mSmeltInto, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs(GTUtility.copyAmount(2, aStack), ItemList.Shape_Extruder_Sword.get(0L)) - .itemOutputs(GTOreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial.mSmeltInto, tAmount)) - .duration(((int) Math.max(aMaterialMass * 2L * tAmount, tAmount)) * TICKS) - .eut(calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)) - .addTo(extruderRecipes); - } - if (GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial.mSmeltInto, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs(GTUtility.copyAmount(3, aStack), ItemList.Shape_Extruder_Pickaxe.get(0L)) - .itemOutputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial.mSmeltInto, tAmount)) - .duration(((int) Math.max(aMaterialMass * 3L * tAmount, tAmount)) * TICKS) - .eut(calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)) - .addTo(extruderRecipes); - } - if (GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, aMaterial.mSmeltInto, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs(GTUtility.copyAmount(1, aStack), ItemList.Shape_Extruder_Shovel.get(0L)) - .itemOutputs(GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, aMaterial.mSmeltInto, tAmount)) - .duration(((int) Math.max(aMaterialMass * 1L * tAmount, tAmount)) * TICKS) - .eut(calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)) - .addTo(extruderRecipes); - } - if (GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, aMaterial.mSmeltInto, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs(GTUtility.copyAmount(3, aStack), ItemList.Shape_Extruder_Axe.get(0L)) - .itemOutputs(GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, aMaterial.mSmeltInto, tAmount)) - .duration(((int) Math.max(aMaterialMass * 3L * tAmount, tAmount)) * TICKS) - .eut(calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)) - .addTo(extruderRecipes); - } - if (GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, aMaterial.mSmeltInto, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs(GTUtility.copyAmount(2, aStack), ItemList.Shape_Extruder_Hoe.get(0L)) - .itemOutputs(GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, aMaterial.mSmeltInto, tAmount)) - .duration(((int) Math.max(aMaterialMass * 2L * tAmount, tAmount)) * TICKS) - .eut(calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)) - .addTo(extruderRecipes); - } if (GTOreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial.mSmeltInto, 1L) != null) { GTValues.RA.stdBuilder() .itemInputs(GTUtility.copyAmount(6, aStack), ItemList.Shape_Extruder_Hammer.get(0L)) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java index 888c6221af0..f03cccaddb4 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java @@ -16,7 +16,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; import gregtech.api.enums.TierEU; -import gregtech.api.enums.ToolDictNames; import gregtech.api.util.GTModHandler; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; @@ -28,19 +27,11 @@ public class ProcessingToolHead implements gregtech.api.interfaces.IOreRecipeReg // HEAD??? generator public ProcessingToolHead() { - OrePrefixes.toolHeadAxe.add(this); OrePrefixes.toolHeadBuzzSaw.add(this); OrePrefixes.toolHeadChainsaw.add(this); OrePrefixes.toolHeadDrill.add(this); OrePrefixes.toolHeadFile.add(this); - OrePrefixes.toolHeadHoe.add(this); - OrePrefixes.toolHeadPickaxe.add(this); - OrePrefixes.toolHeadPlow.add(this); OrePrefixes.toolHeadSaw.add(this); - OrePrefixes.toolHeadSense.add(this); - OrePrefixes.toolHeadShovel.add(this); - OrePrefixes.toolHeadSword.add(this); - OrePrefixes.toolHeadUniversalSpade.add(this); OrePrefixes.toolHeadWrench.add(this); OrePrefixes.toolHeadHammer.add(this); OrePrefixes.turbineBlade.add(this); @@ -57,34 +48,6 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic boolean aProducesSoftMallet = aMaterial.contains(SubTag.BOUNCY) || aMaterial.contains(SubTag.WOOD) || aMaterial.contains(SubTag.SOFT); switch (aPrefix) { - case toolHeadAxe -> { - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.AXE.ID, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial) }); - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, aMaterial, 1L), - GTUtility.getIntegratedCircuit(2)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.AXE.ID, 1, aMaterial, aMaterial.mHandleMaterial, null)) - .duration(10 * SECONDS) - .eut(TierEU.RECIPE_MV) - .addTo(assemblerRecipes); - } - if (aSpecialRecipeReq1) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "PIh", "P ", "f ", 'P', OrePrefixes.plate.get(aMaterial), 'I', - OrePrefixes.ingot.get(aMaterial) }); - if (!aNoWorking) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "GG ", "G ", "f ", 'G', OrePrefixes.gem.get(aMaterial) }); - } case toolHeadBuzzSaw -> { GTModHandler.addCraftingRecipe( MetaGeneratedTool01.INSTANCE.getToolWithStats( @@ -555,105 +518,6 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic .addTo(assemblerRecipes); } } - case toolHeadHoe -> { - if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.HOE.ID, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial) }); - } - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, aMaterial, 1L), - GTUtility.getIntegratedCircuit(16)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.HOE.ID, 1, aMaterial, aMaterial.mHandleMaterial, null)) - .duration(10 * SECONDS) - .eut(calculateRecipeEU(aMaterial, (int) TierEU.RECIPE_MV)) - .addTo(assemblerRecipes); - } - if (aSpecialRecipeReq1) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "PIh", "f ", 'P', OrePrefixes.plate.get(aMaterial), 'I', - OrePrefixes.ingot.get(aMaterial) }); - if (!aNoWorking) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "GG ", "f ", " ", 'G', OrePrefixes.gem.get(aMaterial) }); - } - case toolHeadPickaxe -> { - if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { - - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.PICKAXE.ID, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial) }); - - if (aSpecialRecipeReq1) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "PII", "f h", 'P', OrePrefixes.plate.get(aMaterial), 'I', - OrePrefixes.ingot.get(aMaterial) }); - - if (!aNoWorking) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "GGG", "f ", 'G', OrePrefixes.gem.get(aMaterial) }); - } - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial, 1L), - GTUtility.getIntegratedCircuit(5)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE.getToolWithStats( - IDMetaTool01.PICKAXE.ID, - 1, - aMaterial, - aMaterial.mHandleMaterial, - null)) - .duration(10 * SECONDS) - .eut(calculateRecipeEU(aMaterial, (int) TierEU.RECIPE_MV)) - .addTo(assemblerRecipes); - } - } - case toolHeadPlow -> { - if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { - - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.PLOW.ID, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial) }); - - if (aSpecialRecipeReq1) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadPlow, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "PP", "PP", "hf", 'P', OrePrefixes.plate.get(aMaterial) }); - - if (!aNoWorking) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadPlow, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "GG", "GG", " f", 'G', OrePrefixes.gem.get(aMaterial) }); - } - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadPlow, aMaterial, 1L), - GTUtility.getIntegratedCircuit(6)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.PLOW.ID, 1, aMaterial, aMaterial.mHandleMaterial, null)) - .duration(10 * SECONDS) - .eut(calculateRecipeEU(aMaterial, (int) TierEU.RECIPE_MV)) - .addTo(assemblerRecipes); - } - } case toolHeadSaw -> { if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { @@ -687,134 +551,6 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic .addTo(assemblerRecipes); } } - case toolHeadSense -> { - if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { - - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.SENSE.ID, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial) }); - - if (aSpecialRecipeReq1) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadSense, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "PPI", "hf ", 'P', OrePrefixes.plate.get(aMaterial), 'I', - OrePrefixes.ingot.get(aMaterial) }); - - if (!aNoWorking) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadSense, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "GGG", " f ", " ", 'G', OrePrefixes.gem.get(aMaterial) }); - } - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadSense, aMaterial, 1L), - GTUtility.getIntegratedCircuit(8)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.SENSE.ID, 1, aMaterial, aMaterial.mHandleMaterial, null)) - .duration(10 * SECONDS) - .eut(calculateRecipeEU(aMaterial, (int) TierEU.RECIPE_MV)) - .addTo(assemblerRecipes); - } - } - case toolHeadShovel -> { - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.SHOVEL.ID, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial) }); - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, aMaterial, 1L), - GTUtility.getIntegratedCircuit(9)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE.getToolWithStats( - IDMetaTool01.SHOVEL.ID, - 1, - aMaterial, - aMaterial.mHandleMaterial, - null)) - .duration(10 * SECONDS) - .eut(calculateRecipeEU(aMaterial, (int) TierEU.RECIPE_MV)) - .addTo(assemblerRecipes); - } - if (aSpecialRecipeReq1) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "fPh", 'P', OrePrefixes.plate.get(aMaterial), 'I', - OrePrefixes.ingot.get(aMaterial) }); - if (!aNoWorking) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "fG", 'G', OrePrefixes.gem.get(aMaterial) }); - } - case toolHeadSword -> { - if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { - - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.SWORD.ID, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial) }); - - if (aSpecialRecipeReq1) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial, 1L), - GTProxy.tBits, - new Object[] { " P ", "fPh", 'P', OrePrefixes.plate.get(aMaterial), 'I', - OrePrefixes.ingot.get(aMaterial) }); - - if (!aNoWorking) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial, 1L), - GTProxy.tBits, - new Object[] { " G", "fG", 'G', OrePrefixes.gem.get(aMaterial) }); - } - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial, 1L), - GTUtility.getIntegratedCircuit(10)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.SWORD.ID, 1, aMaterial, aMaterial.mHandleMaterial, null)) - .duration(10 * SECONDS) - .eut(calculateRecipeEU(aMaterial, (int) TierEU.RECIPE_MV)) - .addTo(assemblerRecipes); - } - } - case toolHeadUniversalSpade -> { - GTModHandler.addShapelessCraftingRecipe( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.UNIVERSALSPADE.ID, 1, aMaterial, aMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial), OrePrefixes.screw.get(aMaterial), - ToolDictNames.craftingToolScrewdriver }); - if (GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L) != null - && GTOreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L) != null) { - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L), - GTOreDictUnificator.get(OrePrefixes.toolHeadUniversalSpade, aMaterial, 1L), - GTUtility.getIntegratedCircuit(11)) - .itemOutputs( - MetaGeneratedTool01.INSTANCE.getToolWithStats( - IDMetaTool01.UNIVERSALSPADE.ID, - 1, - aMaterial, - aMaterial.mHandleMaterial, - null)) - .duration(10 * SECONDS) - .eut(calculateRecipeEU(aMaterial, (int) TierEU.RECIPE_MV)) - .addTo(assemblerRecipes); - } - if (aSpecialRecipeReq2) GTModHandler.addCraftingRecipe( - GTOreDictUnificator.get(OrePrefixes.toolHeadUniversalSpade, aMaterial, 1L), - GTProxy.tBits, - new Object[] { "fX", 'X', OrePrefixes.toolHeadShovel.get(aMaterial) }); - } case toolHeadWrench -> { GTModHandler.addCraftingRecipe( MetaGeneratedTool01.INSTANCE.getToolWithStats( diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolOther.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolOther.java index 04aac52d4f2..252ce171604 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolOther.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolOther.java @@ -118,14 +118,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic new Object[] { "LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(aMaterial), 'P', OrePrefixes.plate.get(Materials.AnySyntheticRubber), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'L', ItemList.Battery_RE_HV_Lithium.get(1L) }); - GTModHandler.addCraftingRecipe( - (MetaGeneratedTool01.INSTANCE - .getToolWithStats(IDMetaTool01.POCKET_MULTITOOL.ID, 1, aMaterial, aMaterial, null)), - GTModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GTModHandler.RecipeBits.BUFFERED, - new Object[] { "ABC", "DEF", "CFG", 'A', OrePrefixes.stickLong.get(aMaterial), 'B', - OrePrefixes.toolHeadSaw.get(aMaterial), 'C', OrePrefixes.ring.get(aMaterial), 'D', - OrePrefixes.toolHeadFile.get(aMaterial), 'E', OrePrefixes.plate.get(aMaterial), 'F', - OrePrefixes.toolHeadSword.get(aMaterial), 'G', Dyes.dyeBlue }); + } } } diff --git a/src/main/java/gregtech/loaders/postload/BookAndLootLoader.java b/src/main/java/gregtech/loaders/postload/BookAndLootLoader.java index e227d7f21a2..ddeca38d976 100644 --- a/src/main/java/gregtech/loaders/postload/BookAndLootLoader.java +++ b/src/main/java/gregtech/loaders/postload/BookAndLootLoader.java @@ -259,20 +259,6 @@ public void run() { ChestGenHooks.addItem( "mineshaftCorridor", new WeightedRandomChestContent(GTOreDictUnificator.get(OrePrefixes.gem, Materials.Emerald, 1L), 1, 4, 2)); - ChestGenHooks.addItem( - "mineshaftCorridor", - new WeightedRandomChestContent( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.DamascusSteel, 1L), - 1, - 4, - 1)); - ChestGenHooks.addItem( - "mineshaftCorridor", - new WeightedRandomChestContent( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.DamascusSteel, 1L), - 1, - 4, - 1)); ChestGenHooks .addItem("villageBlacksmith", new WeightedRandomChestContent(ItemList.McGuffium_239.get(1L), 1, 1, 1)); @@ -319,19 +305,5 @@ public void run() { ChestGenHooks .addItem("strongholdCrossing", new WeightedRandomChestContent(ItemList.McGuffium_239.get(1L), 1, 1, 10)); - ChestGenHooks.addItem( - "strongholdCorridor", - new WeightedRandomChestContent( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.DamascusSteel, 1L), - 1, - 4, - 6)); - ChestGenHooks.addItem( - "strongholdCorridor", - new WeightedRandomChestContent( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.DamascusSteel, 1L), - 1, - 4, - 6)); } } diff --git a/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java b/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java index fb7871992fd..f54d15bcd79 100644 --- a/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java @@ -1838,12 +1838,6 @@ public void run() { OrePrefixes.dust.get(Materials.Graphite), 'S', OrePrefixes.plate.get(Materials.Beryllium) }); GTModHandler.removeRecipeByOutputDelayed(GTModHandler.getIC2Item("crophavester", 1L)); - GTModHandler.addCraftingRecipe( - GTModHandler.getIC2Item("crophavester", 1L), - bits_no_remove_buffered, - new Object[] { "ACA", "PMS", "WOW", 'M', ItemList.Hull_MV, 'C', OrePrefixes.circuit.get(Materials.MV), 'A', - ItemList.Robot_Arm_LV, 'P', ItemList.Electric_Piston_LV, 'S', ItemList.Sensor_LV, 'W', - OrePrefixes.toolHeadSense.get(Materials.Aluminium), 'O', ItemList.Conveyor_Module_LV }); GTModHandler.removeRecipeByOutputDelayed(GTModHandler.getIC2Item("RTGenerator", 1L)); GTModHandler.addCraftingRecipe( diff --git a/src/main/java/gregtech/loaders/postload/GTPostLoad.java b/src/main/java/gregtech/loaders/postload/GTPostLoad.java index 35c4e2d874b..d30ed643f29 100644 --- a/src/main/java/gregtech/loaders/postload/GTPostLoad.java +++ b/src/main/java/gregtech/loaders/postload/GTPostLoad.java @@ -15,16 +15,13 @@ import static gregtech.api.util.GTRecipeBuilder.TICKS; import java.util.Arrays; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; @@ -33,8 +30,6 @@ import com.google.common.base.Stopwatch; import cpw.mods.fml.common.ProgressManager; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gregtech.GTMod; import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; @@ -52,7 +47,6 @@ import gregtech.api.util.GTRecipeConstants; import gregtech.api.util.GTRecipeRegistrator; import gregtech.api.util.GTUtility; -import gregtech.common.items.MetaGeneratedTool01; import gregtech.common.items.behaviors.BehaviourDataOrb; import gregtech.common.tileentities.machines.basic.MTEMassfabricator; import ic2.api.recipe.IRecipeInput; @@ -439,53 +433,6 @@ public static void doActualRegistration(Materials m) { if (m.getBlocks(1) != null) GTRecipeRegistrator.registerUsagesForMaterials(null, noSmash, m.getBlocks(1)); } - public static void createGTtoolsCreativeTab() { - new CreativeTabs("GTtools") { - - @SideOnly(Side.CLIENT) - @Override - public ItemStack getIconItemStack() { - return ItemList.Tool_Cheat.get(1, new ItemStack(Blocks.iron_block, 1)); - } - - @SideOnly(Side.CLIENT) - @Override - public Item getTabIconItem() { - return ItemList.Circuit_Integrated.getItem(); - } - - @Override - public void displayAllReleventItems(List aList) { - - for (int i = 0; i < 32766; i += 2) { - if (MetaGeneratedTool01.INSTANCE.getToolStats(new ItemStack(MetaGeneratedTool01.INSTANCE, 1, i)) - == null) { - continue; - } - - ItemStack tStack = new ItemStack(MetaGeneratedTool01.INSTANCE, 1, i); - MetaGeneratedTool01.INSTANCE.isItemStackUsable(tStack); - aList - .add(MetaGeneratedTool01.INSTANCE.getToolWithStats(i, 1, Materials.Lead, Materials.Lead, null)); - aList.add( - MetaGeneratedTool01.INSTANCE.getToolWithStats(i, 1, Materials.Nickel, Materials.Nickel, null)); - aList.add( - MetaGeneratedTool01.INSTANCE.getToolWithStats(i, 1, Materials.Cobalt, Materials.Cobalt, null)); - aList.add( - MetaGeneratedTool01.INSTANCE.getToolWithStats(i, 1, Materials.Osmium, Materials.Osmium, null)); - aList.add( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(i, 1, Materials.Adamantium, Materials.Adamantium, null)); - aList.add( - MetaGeneratedTool01.INSTANCE - .getToolWithStats(i, 1, Materials.Neutronium, Materials.Neutronium, null)); - - } - super.displayAllReleventItems(aList); - } - }; - } - public static void addSolidFakeLargeBoilerFuels() { RecipeMaps.largeBoilerFakeFuels.getBackend() .addSolidRecipes( diff --git a/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java b/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java index d35645769af..2a4b38e7eff 100644 --- a/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java +++ b/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java @@ -48,6 +48,7 @@ public class PurifiedWaterRecipes { static final PurificationPlantBaseChanceKey BASE_CHANCE = PurificationPlantBaseChanceKey.INSTANCE; + public static final int extraBaryonicOutput = 500; public static void run() { final int duration = MTEPurificationPlant.CYCLE_TIME_TICKS; @@ -302,7 +303,9 @@ public static void run() { // real recipe GTValues.RA.stdBuilder() .fluidInputs(Materials.Grade7PurifiedWater.getFluid(1000L)) - .fluidOutputs(Materials.Grade8PurifiedWater.getFluid(900L), Materials.StableBaryonicMatter.getFluid(500)) + .fluidOutputs( + Materials.Grade8PurifiedWater.getFluid(900L), + Materials.StableBaryonicMatter.getFluid(extraBaryonicOutput)) .itemOutputs(ItemList.Quark_Creation_Catalyst_Unaligned.get(2L), Particle.getBaseParticle(Particle.UNKNOWN)) .outputChances(10000, 100) .ignoreCollision() diff --git a/src/main/java/gregtech/loaders/postload/recipes/AssemblerRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/AssemblerRecipes.java index 212943ba7c2..04616669f23 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/AssemblerRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/AssemblerRecipes.java @@ -1472,29 +1472,41 @@ public void run() { .eut(TierEU.RECIPE_LV) .addTo(assemblerRecipes); + final ItemStack certusQuartzSeed = getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 2L, 0); + NBTTagCompound certusQuartzTag = new NBTTagCompound(); + certusQuartzTag.setInteger("progress", 0); + certusQuartzSeed.setTagCompound(certusQuartzTag); GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.dust, Materials.CertusQuartz, 1), new ItemStack(Blocks.sand, 1, 32767)) - .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 2L, 0)) + .itemOutputs(certusQuartzSeed) .duration(3 * SECONDS + 4 * TICKS) .eut(8) .addTo(assemblerRecipes); + final ItemStack netherQuartzSeed = getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 2L, 600); + NBTTagCompound netherQuartzTag = new NBTTagCompound(); + netherQuartzTag.setInteger("progress", 600); + netherQuartzSeed.setTagCompound(netherQuartzTag); GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.dust, Materials.NetherQuartz, 1), new ItemStack(Blocks.sand, 1, 32767)) - .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 2L, 600)) + .itemOutputs(netherQuartzSeed) .duration(3 * SECONDS + 4 * TICKS) .eut(8) .addTo(assemblerRecipes); + final ItemStack fluixSeed = getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 2L, 1200); + NBTTagCompound fluixTag = new NBTTagCompound(); + fluixTag.setInteger("progress", 1200); + fluixSeed.setTagCompound(fluixTag); GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.dust, Materials.Fluix, 1), new ItemStack(Blocks.sand, 1, 32767)) - .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 2L, 1200)) + .itemOutputs(fluixSeed) .duration(3 * SECONDS + 4 * TICKS) .eut(8) .addTo(assemblerRecipes); @@ -2553,7 +2565,8 @@ public void run() { GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6), - GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1)) + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1), + GTUtility.getIntegratedCircuit(1)) .itemOutputs(ItemList.Casing_RobustTungstenSteel.get(1)) .duration(2 * SECONDS + 10 * TICKS) .eut(16) @@ -2571,7 +2584,8 @@ public void run() { GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 6), - GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Titanium, 1)) + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Titanium, 1), + GTUtility.getIntegratedCircuit(1)) .itemOutputs(ItemList.Casing_StableTitanium.get(1)) .duration(2 * SECONDS + 10 * TICKS) .eut(16) @@ -2598,7 +2612,8 @@ public void run() { GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6), - GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 1)) + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 1), + GTUtility.getIntegratedCircuit(1)) .itemOutputs(ItemList.Casing_MiningBlackPlutonium.get(1)) .duration(2 * SECONDS + 10 * TICKS) .eut(16) @@ -2924,356 +2939,6 @@ public void run() { .eut(20) .addTo(assemblerRecipes); - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.Wood, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.wooden_sword, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.Stone, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.stone_sword, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.Iron, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.iron_sword, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.Gold, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.golden_sword, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.Diamond, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.diamond_sword, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.Bronze, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Sword_Bronze.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.Steel, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Sword_Steel.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.Wood, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.wooden_pickaxe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.Stone, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.stone_pickaxe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.Iron, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.iron_pickaxe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.Gold, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.golden_pickaxe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.Diamond, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.diamond_pickaxe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.Bronze, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Pickaxe_Bronze.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadPickaxe, Materials.Steel, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Pickaxe_Steel.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.Wood, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.wooden_shovel, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.Stone, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.stone_shovel, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.Iron, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.iron_shovel, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.Gold, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.golden_shovel, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.Diamond, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.diamond_shovel, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.Bronze, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Shovel_Bronze.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.Steel, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Shovel_Steel.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.Wood, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.wooden_axe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.Stone, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.stone_axe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.Iron, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.iron_axe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.Gold, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.golden_axe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.Diamond, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.diamond_axe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.Bronze, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Axe_Bronze.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.Steel, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Axe_Steel.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, Materials.Wood, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.wooden_hoe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, Materials.Stone, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.stone_hoe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, Materials.Iron, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.iron_hoe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, Materials.Gold, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.golden_hoe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, Materials.Diamond, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(Items.diamond_hoe, 1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, Materials.Bronze, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Hoe_Bronze.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - - GTValues.RA.stdBuilder() - .itemInputs( - GTOreDictUnificator.get(OrePrefixes.toolHeadHoe, Materials.Steel, 1), - GTOreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(ItemList.Tool_Hoe_Steel.getUndamaged(1)) - .duration(5 * SECONDS) - .eut(16) - .addTo(assemblerRecipes); - // fuel rod assembler recipes GTValues.RA.stdBuilder() diff --git a/src/main/java/gregtech/loaders/postload/recipes/AutoclaveRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/AutoclaveRecipes.java index 932b1b71c52..67c46c0861a 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/AutoclaveRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/AutoclaveRecipes.java @@ -7,6 +7,9 @@ import static gregtech.api.util.GTRecipeBuilder.SECONDS; import static gregtech.api.util.GTRecipeBuilder.TICKS; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -39,8 +42,23 @@ public void run() { .eut(256) .addTo(autoclaveRecipes); + final ItemStack certusQuartzSeed = getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 0); + NBTTagCompound certusQuartzTag = new NBTTagCompound(); + certusQuartzTag.setInteger("progress", 0); + certusQuartzSeed.setTagCompound(certusQuartzTag); + + final ItemStack netherQuartzSeed = getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 600); + NBTTagCompound netherQuartzTag = new NBTTagCompound(); + netherQuartzTag.setInteger("progress", 600); + netherQuartzSeed.setTagCompound(netherQuartzTag); + + final ItemStack fluixSeed = getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 1200); + NBTTagCompound fluixTag = new NBTTagCompound(); + fluixTag.setInteger("progress", 1200); + fluixSeed.setTagCompound(fluixTag); + GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 0)) + .itemInputs(certusQuartzSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 10)) .outputChances(8000) .fluidInputs(Materials.Water.getFluid(200L)) @@ -49,7 +67,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 600)) + .itemInputs(netherQuartzSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 11)) .outputChances(8000) .fluidInputs(Materials.Water.getFluid(200L)) @@ -58,7 +76,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 1200)) + .itemInputs(fluixSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 12)) .outputChances(8000) .fluidInputs(Materials.Water.getFluid(200L)) @@ -67,7 +85,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 0)) + .itemInputs(certusQuartzSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 10)) .outputChances(9000) .fluidInputs(GTModHandler.getDistilledWater(100L)) @@ -76,7 +94,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 600)) + .itemInputs(netherQuartzSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 11)) .outputChances(9000) .fluidInputs(GTModHandler.getDistilledWater(100L)) @@ -85,7 +103,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 1200)) + .itemInputs(fluixSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 12)) .outputChances(9000) .fluidInputs(GTModHandler.getDistilledWater(100L)) @@ -94,7 +112,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 0)) + .itemInputs(certusQuartzSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 10)) .outputChances(10000) .fluidInputs(Materials.Void.getMolten(36L)) @@ -103,7 +121,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 600)) + .itemInputs(netherQuartzSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 11)) .outputChances(10000) .fluidInputs(Materials.Void.getMolten(36L)) @@ -112,7 +130,7 @@ public void run() { .addTo(autoclaveRecipes); GTValues.RA.stdBuilder() - .itemInputs(getModItem(AppliedEnergistics2.ID, "item.ItemCrystalSeed", 1L, 1200)) + .itemInputs(fluixSeed) .itemOutputs(getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 1L, 12)) .outputChances(10000) .fluidInputs(Materials.Void.getMolten(36L)) diff --git a/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java index 4f12d8d1980..14f812dc6fc 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java @@ -543,9 +543,9 @@ public void distillationTowerRecipes() { .itemInputs(GTUtility.getIntegratedCircuit(9)) .fluidInputs(Materials.OilHeavy.getFluid(1000)) .fluidOutputs( - Materials.SulfuricHeavyFuel.getFluid(450), - Materials.SulfuricLightFuel.getFluid(150), - Materials.SulfuricNaphtha.getFluid(300), + Materials.SulfuricHeavyFuel.getFluid(1000), + Materials.SulfuricLightFuel.getFluid(450), + Materials.SulfuricNaphtha.getFluid(150), MaterialsKevlar.NaphthenicAcid.getFluid(50), Materials.SulfuricGas.getGas(600)) .duration(5 * SECONDS) diff --git a/src/main/java/gregtech/loaders/postload/recipes/ImplosionCompressorRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/ImplosionCompressorRecipes.java index 80a35f1da03..0dd99356ec3 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/ImplosionCompressorRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/ImplosionCompressorRecipes.java @@ -13,6 +13,7 @@ import gregtech.api.enums.TierEU; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipeConstants; +import gtnhlanth.common.register.WerkstoffMaterialPool; public class ImplosionCompressorRecipes implements Runnable { @@ -38,6 +39,16 @@ public void run() { .eut(TierEU.RECIPE_LV) .addTo(implosionRecipes); + GTValues.RA.stdBuilder() + .itemInputs(WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.dust, 4)) + .itemOutputs( + WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.gem, 3), + GTOreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 12L)) + .metadata(GTRecipeConstants.ADDITIVE_AMOUNT, 4) + .duration(1 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(implosionRecipes); + if (GalacticraftMars.isModLoaded()) { GTValues.RA.stdBuilder() diff --git a/src/main/java/gregtech/loaders/postload/recipes/LatheRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/LatheRecipes.java index db2c79322fb..4e9f1242c99 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/LatheRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/LatheRecipes.java @@ -14,6 +14,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GTOreDictUnificator; +import gtnhlanth.common.register.WerkstoffMaterialPool; public class LatheRecipes implements Runnable { @@ -36,5 +37,14 @@ public void run() { .duration(2 * SECONDS + 10 * TICKS) .eut(8) .addTo(latheRecipes); + + GTValues.RA.stdBuilder() + .itemInputs(WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.gemFlawless, 1)) + .itemOutputs( + WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.stickLong, 1), + WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.dust, 1)) + .duration((100 * SECONDS)) + .eut(16) + .addTo(latheRecipes); } } diff --git a/src/main/java/gregtech/loaders/postload/recipes/MixerRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/MixerRecipes.java index 09400b8ba71..f6ed72c1f71 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/MixerRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/MixerRecipes.java @@ -72,6 +72,16 @@ public void run() { .eut(8) .addTo(mixerRecipes); + GTValues.RA.stdBuilder() + .itemInputs( + GTOreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1), + GTOreDictUnificator.get(OrePrefixes.dust, Materials.Tin, 1), + GTUtility.getIntegratedCircuit(5)) + .itemOutputs(GTOreDictUnificator.getDust(Materials.TinAlloy, 2L * OrePrefixes.dust.mMaterialAmount)) + .duration(5 * SECONDS) + .eut(8) + .addTo(mixerRecipes); + GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 4), @@ -1604,7 +1614,7 @@ public void registerSingleBlockAndMulti() { MaterialsUEVplus.DimensionallyTranscendentExoticCatalyst.getFluid(1000L), Materials.Lead.getPlasma(1000), Materials.Thorium.getPlasma(1000), - Materials.Naquadria.getPlasma(1000L), + Materials.Naquadria.getPlasma(100L), MaterialsUEVplus.RawStarMatter.getFluid(25L)) .fluidOutputs(MaterialsUEVplus.DimensionallyTranscendentStellarCatalyst.getFluid(1000L)) .duration(41 * MINUTES + 40 * SECONDS) diff --git a/src/main/java/gregtech/loaders/postload/recipes/Pulverizer.java b/src/main/java/gregtech/loaders/postload/recipes/Pulverizer.java index 83b39c01b23..356486bead4 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/Pulverizer.java +++ b/src/main/java/gregtech/loaders/postload/recipes/Pulverizer.java @@ -69,6 +69,27 @@ public void run() { .addTo(maceratorRecipes); } + GTValues.RA.stdBuilder() + .itemInputs(new ItemStack(Blocks.quartz_block, 1)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.dust, Materials.NetherQuartz, 4)) + .duration(19 * SECONDS + 12 * TICKS) + .eut(4) + .addTo(maceratorRecipes); + + GTValues.RA.stdBuilder() + .itemInputs(new ItemStack(Blocks.quartz_block, 1, 1)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.dust, Materials.NetherQuartz, 4)) + .duration(19 * SECONDS + 12 * TICKS) + .eut(4) + .addTo(maceratorRecipes); + + GTValues.RA.stdBuilder() + .itemInputs(new ItemStack(Blocks.quartz_block, 1, 2)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.dust, Materials.NetherQuartz, 4)) + .duration(19 * SECONDS + 12 * TICKS) + .eut(4) + .addTo(maceratorRecipes); + // marbe dust( stone dust GTValues.RA.stdBuilder() .itemInputs(GTOreDictUnificator.get(OrePrefixes.block, Materials.Marble, 1)) diff --git a/src/main/java/gregtech/loaders/postload/recipes/TranscendentPlasmaMixerRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/TranscendentPlasmaMixerRecipes.java index ab40600d497..797697bc840 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/TranscendentPlasmaMixerRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/TranscendentPlasmaMixerRecipes.java @@ -123,7 +123,7 @@ public void run() { Materials.Tin.getPlasma(1000), Materials.Lead.getPlasma(1000), Materials.Thorium.getPlasma(1000), - Materials.Naquadria.getPlasma(1000L), + Materials.Naquadria.getPlasma(100L), MaterialsUEVplus.RawStarMatter.getFluid(25L)) .fluidOutputs(MaterialsUEVplus.ExcitedDTSC.getFluid(1000L)) .duration(100) diff --git a/src/main/java/gregtech/loaders/preload/LoaderGTBlockFluid.java b/src/main/java/gregtech/loaders/preload/LoaderGTBlockFluid.java index 48921c3bc4d..dfb1c39788b 100644 --- a/src/main/java/gregtech/loaders/preload/LoaderGTBlockFluid.java +++ b/src/main/java/gregtech/loaders/preload/LoaderGTBlockFluid.java @@ -1471,7 +1471,7 @@ public void run() { GTMod.gregtechproxy.addAutogeneratedMoltenFluid(tMaterial.mSmeltInto); } } - if (tMaterial.mElement != null) { + if (tMaterial.mElement != null || (tMaterial.mHasPlasma && !tMaterial.mIconSet.is_custom)) { GTMod.gregtechproxy.addAutogeneratedPlasmaFluid(tMaterial); } if (tMaterial.hasCorrespondingFluid()) { @@ -2036,13 +2036,6 @@ public void run() { } } - GTValues.RA.stdBuilder() - .itemInputs(new ItemStack(Blocks.cobblestone, 1, WILDCARD)) - .itemOutputs(GTOreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)) - .duration(20 * SECONDS) - .eut(2) - .addTo(maceratorRecipes); - GTValues.RA.stdBuilder() .itemInputs(new ItemStack(Blocks.gravel, 1, WILDCARD)) .itemOutputs(GTOreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new ItemStack(Items.flint, 1)) diff --git a/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java b/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java index bfddb49278d..b34cd031ea3 100644 --- a/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java @@ -885,6 +885,7 @@ import static gregtech.api.enums.MetaTileEntityIDs.transformer_ZPM_LuV; import static gregtech.api.enums.Mods.Forestry; import static gregtech.api.enums.Mods.NewHorizonsCoreMod; +import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.recipe.RecipeMaps.alloySmelterRecipes; import static gregtech.api.recipe.RecipeMaps.amplifierRecipes; import static gregtech.api.recipe.RecipeMaps.arcFurnaceRecipes; @@ -1071,6 +1072,7 @@ import gregtech.common.tileentities.machines.multi.MTEPlasmaForge; import gregtech.common.tileentities.machines.multi.MTEProcessingArray; import gregtech.common.tileentities.machines.multi.MTEPyrolyseOven; +import gregtech.common.tileentities.machines.multi.MTEResearchCompleter; import gregtech.common.tileentities.machines.multi.MTETranscendentPlasmaMixer; import gregtech.common.tileentities.machines.multi.MTEVacuumFreezer; import gregtech.common.tileentities.machines.multi.MTEWormholeGenerator; @@ -1539,7 +1541,7 @@ private static void registerMultiblockControllers() { new MTEOilCracker(OIL_CRACKER_CONTROLLER.ID, "multimachine.cracker", "Oil Cracking Unit").getStackForm(1)); ItemList.Machine_Multi_Assemblyline.set( - new MTEAssemblyLine(ASSEMBLING_LINE_CONTROLLER.ID, "multimachine.assemblyline", "Assembling Line") + new MTEAssemblyLine(ASSEMBLING_LINE_CONTROLLER.ID, "multimachine.assemblyline", "Assembly Line") .getStackForm(1L)); ItemList.Machine_Multi_DieselEngine.set( new MTEDieselEngine(COMBUSTION_ENGINE_CONTROLLER.ID, "multimachine.dieselengine", "Large Combustion Engine") @@ -1630,6 +1632,12 @@ private static void registerMultiblockControllers() { ItemList.LargeFluidExtractor.set( new MTELargeFluidExtractor(LARGE_FLUID_EXTRACTOR.ID, "multimachine.fluidextractor", "Large Fluid Extractor") .getStackForm(1)); + + if (Thaumcraft.isModLoaded()) { + ItemList.ResearchCompleter.set( + new MTEResearchCompleter(ResearchCompleter.ID, "Research Completer", "Research Completer") + .getStackForm(1)); + } } private static void registerSteamMachines() { @@ -12368,47 +12376,46 @@ private static void generateWiresAndPipes() { makeWires(Materials.RedAlloy, 2000, 0L, 1L, 1L, GTValues.V[0], true, false); - makeWires(Materials.Cobalt, 1200, 2L, 4L, 2L, GTValues.V[1], true, false); + makeWires(Materials.Cobalt, 1200, 1L, 2L, 2L, GTValues.V[1], true, false); makeWires(Materials.Lead, 1220, 2L, 4L, 2L, GTValues.V[1], true, false); makeWires(Materials.Tin, 1240, 1L, 2L, 1L, GTValues.V[1], true, false); - makeWires(Materials.Zinc, 1260, 1L, 2L, 1L, GTValues.V[1], true, false); makeWires(Materials.SolderingAlloy, 1280, 1L, 2L, 1L, GTValues.V[1], true, false); makeWires(Materials.Iron, 1300, 3L, 6L, 2L, GTValues.V[2], true, false); makeWires(Materials.Nickel, 1320, 3L, 6L, 3L, GTValues.V[2], true, false); - makeWires(Materials.Cupronickel, 1340, 3L, 6L, 2L, GTValues.V[2], true, false); + makeWires(Materials.Cupronickel, 1340, 3L, 6L, 4L, GTValues.V[2], true, false); makeWires(Materials.Copper, 1360, 2L, 4L, 1L, GTValues.V[2], true, false); makeWires(Materials.AnnealedCopper, 1380, 1L, 2L, 1L, GTValues.V[2], true, false); - makeWires(Materials.Kanthal, 1400, 3L, 6L, 4L, GTValues.V[3], true, false); + makeWires(Materials.Kanthal, 1400, 3L, 6L, 5L, GTValues.V[3], true, false); makeWires(Materials.Gold, 1420, 2L, 4L, 3L, GTValues.V[3], true, false); - makeWires(Materials.Electrum, 1440, 2L, 4L, 2L, GTValues.V[3], true, false); + makeWires(Materials.Electrum, 1440, 1L, 2L, 2L, GTValues.V[3], true, false); makeWires(Materials.Silver, 1460, 1L, 2L, 1L, GTValues.V[3], true, false); makeWires(Materials.BlueAlloy, 1480, 1L, 2L, 2L, GTValues.V[3], true, false); - makeWires(Materials.Nichrome, 1500, 4L, 8L, 3L, GTValues.V[4], true, false); - makeWires(Materials.Steel, 1520, 2L, 4L, 2L, GTValues.V[4], true, false); - makeWires(Materials.BlackSteel, 1540, 2L, 4L, 3L, GTValues.V[4], true, false); + makeWires(Materials.Nichrome, 1500, 4L, 8L, 6L, GTValues.V[4], true, false); + makeWires(Materials.Steel, 1520, 3L, 6L, 2L, GTValues.V[4], true, false); + makeWires(Materials.BlackSteel, 1540, 1L, 2L, 4L, GTValues.V[4], true, false); makeWires(Materials.Titanium, 1560, 2L, 4L, 4L, GTValues.V[4], true, false); makeWires(Materials.Aluminium, 1580, 1L, 2L, 1L, GTValues.V[4], true, false); + makeWires(Materials.TPV, 1840, 1L, 2L, 6L, GTValues.V[4], true, false); makeWires(Materials.Graphene, 1600, 1L, 2L, 1L, GTValues.V[5], false, true); - makeWires(Materials.Osmium, 1620, 2L, 4L, 4L, GTValues.V[5], true, false); makeWires(Materials.Platinum, 1640, 1L, 2L, 2L, GTValues.V[5], true, false); - makeWires(Materials.TungstenSteel, 1660, 2L, 4L, 3L, GTValues.V[5], true, false); - makeWires(Materials.Tungsten, 1680, 2L, 4L, 2L, GTValues.V[5], true, false); + makeWires(Materials.TungstenSteel, 1660, 4L, 8L, 4L, GTValues.V[5], true, false); + makeWires(Materials.Tungsten, 1680, 2L, 4L, 6L, GTValues.V[5], true, false); + makeWires(Materials.Osmium, 1620, 2L, 4L, 4L, GTValues.V[6], true, false); makeWires(Materials.HSSG, 1700, 2L, 4L, 4L, GTValues.V[6], true, false); makeWires(Materials.NiobiumTitanium, 1720, 2L, 4L, 4L, GTValues.V[6], true, false); - makeWires(Materials.VanadiumGallium, 1740, 2L, 4L, 4L, GTValues.V[6], true, false); - makeWires(Materials.YttriumBariumCuprate, 1760, 4L, 8L, 4L, GTValues.V[6], true, false); + makeWires(Materials.VanadiumGallium, 1740, 4L, 8L, 4L, GTValues.V[6], true, false); + makeWires(Materials.YttriumBariumCuprate, 1760, 3L, 6L, 6L, GTValues.V[6], true, false); makeWires(Materials.Naquadah, 1780, 2L, 4L, 2L, GTValues.V[7], true, false); - makeWires(Materials.NaquadahAlloy, 1800, 4L, 8L, 2L, GTValues.V[8], true, false); - makeWires(Materials.Duranium, 1820, 8L, 16L, 1L, GTValues.V[8], true, false); - makeWires(Materials.TPV, 1840, 1L, 2L, 6L, GTValues.V[4], true, false); + makeWires(Materials.NaquadahAlloy, 1800, 4L, 8L, 6L, GTValues.V[8], true, false); + makeWires(Materials.Duranium, 1820, 2L, 4L, 4L, GTValues.V[8], true, false); // Superconductor base. makeWires(Materials.Pentacadmiummagnesiumhexaoxid, 2200, 1L, 2L, 1L, GTValues.V[2], false, false); @@ -12444,7 +12451,7 @@ private static void generateWiresAndPipes() { makeWires(Materials.SuperconductorUIV, 2081, 0L, 0L, 64L, GTValues.V[11], false, true); makeWires(Materials.SuperconductorUMV, 2089, 0L, 0L, 64L, GTValues.V[12], false, true); - makeWires(Materials.Ichorium, 2600, 2L, 2L, 12L, GTValues.V[9], false, true); + makeWires(Materials.Ichorium, 2600, 4L, 8L, 12L, GTValues.V[9], false, true); makeWires(MaterialsUEVplus.SpaceTime, 2606, 0L, 0L, 1_000_000L, GTValues.V[14], false, true); GTOreDictUnificator.registerOre( diff --git a/src/main/java/gregtech/mixin/Mixin.java b/src/main/java/gregtech/mixin/Mixin.java index 001477b5d1d..9d1a0164b3c 100644 --- a/src/main/java/gregtech/mixin/Mixin.java +++ b/src/main/java/gregtech/mixin/Mixin.java @@ -105,6 +105,12 @@ public enum Mixin { .setSide(Side.BOTH) .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.explosionPollutionAmount != 0F) .addTargetedMod(TargetedMod.VANILLA)), + + VANILLA_TRADING(new Builder("Change Vanilla Trades").setPhase(Phase.EARLY) + .addMixinClasses("minecraft.VanillaTradingMixin") + .addTargetedMod(VANILLA) + .setApplyIf(() -> true) + .setSide(Side.BOTH)), POLLUTION_IC2_IRON_FURNACE( new Builder("Ic2 Iron Furnace Pollutes").addMixinClasses("ic2.MixinIC2IronFurnacePollution") .setPhase(Phase.LATE) diff --git a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java index 504afc55d86..9c4ed451cab 100644 --- a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java @@ -10,6 +10,7 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; import gtPlusPlus.core.network.handler.AbstractClientMessageHandler; +import gtPlusPlus.core.network.packet.PacketTurbineHatchUpdate; import gtPlusPlus.core.network.packet.PacketVolumetricFlaskGui; import gtPlusPlus.core.network.packet.PacketVolumetricFlaskGui2; @@ -22,6 +23,7 @@ public class PacketHandler { public static void init() { registerMessage(PacketVolumetricFlaskGui.class, PacketVolumetricFlaskGui.class); registerMessage(PacketVolumetricFlaskGui2.class, PacketVolumetricFlaskGui2.class); + registerMessage(PacketTurbineHatchUpdate.class, PacketTurbineHatchUpdate.class); } /** diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index 49a22bc8a89..25e5a7dc2a6 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -691,6 +691,7 @@ public static void init() { toolGregtechPump.registerPumpType(1, "Advanced Hand Pump", 32000, 1); toolGregtechPump.registerPumpType(2, "Super Hand Pump", 128000, 2); toolGregtechPump.registerPumpType(3, "Ultimate Hand Pump", 512000, 3); + toolGregtechPump.registerPumpType(4, "Expandable Hand Pump", 0, 4); // Xp Fluids - Dev if (!FluidRegistry.isFluidRegistered("mobessence")) { diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java b/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java index f6533dad8e6..bab4eac684d 100644 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java +++ b/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java @@ -25,12 +25,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidContainerItem; -import net.minecraftforge.fluids.IFluidHandler; -import net.minecraftforge.fluids.IFluidTank; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; @@ -95,11 +91,8 @@ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, Entity private final HashMap mIconMap = new LinkedHashMap<>(); private final HashMap rarity = new LinkedHashMap<>(); - private final HashMap itemName = new LinkedHashMap<>(); - private final HashMap hasEffect = new LinkedHashMap<>(); public final HashMap mElectricStats = new LinkedHashMap<>(); - public final HashMap mBurnValues = new LinkedHashMap<>(); public void registerPumpType(final int aID, final String aPumpName, final int aEuMax, final int aTier) { ModItems.toolGregtechPump.registerItem( @@ -107,10 +100,12 @@ public void registerPumpType(final int aID, final String aPumpName, final int aE aPumpName, // Name aEuMax, // Eu Storage (short) aTier, // Tier/ Tooltip - aTier <= 0 ? EnumRarity.common - : aTier == 1 ? EnumRarity.uncommon - : aTier == 2 ? EnumRarity.rare : aTier == 3 ? EnumRarity.epic : EnumRarity.common, // Rarity - false // Effect? + switch (aTier) { + case 0 -> EnumRarity.common; + case 1 -> EnumRarity.uncommon; + case 2 -> EnumRarity.rare; + default -> EnumRarity.epic; + } // Rarity ); } @@ -134,18 +129,8 @@ public ItemGregtechPump(final String unlocalizedName, final CreativeTabs creativ } } - public void registerItem(final int id, final String localizedName, final long euStorage, final int tier) { - this.registerItem(id, localizedName, euStorage, (short) tier, EnumRarity.common, false); - } - - public void registerItem(final int id, final String localizedName, final long euStorage, final int tier, - final int burnTime) { - this.registerItem(id, localizedName, euStorage, (short) tier, EnumRarity.common, false); - this.setBurnValue(id, burnTime); - } - public void registerItem(final int id, final String localizedName, final long euStorage, final short tier, - final EnumRarity regRarity, final boolean Effect) { + final EnumRarity regRarity) { this.addItem( id, localizedName, @@ -153,8 +138,6 @@ public void registerItem(final int id, final String localizedName, final long eu if (euStorage > 0 && tier > 0) this.setElectricStats(this.mOffset + id, euStorage, GTValues.V[tier], tier, -3L, true); this.rarity.put(id, regRarity); - this.itemName.put(id, localizedName); - this.hasEffect.put(id, Effect); } @Override @@ -167,15 +150,6 @@ public EnumRarity getRarity(final ItemStack par1ItemStack) { return EnumRarity.common; } - @Override - public boolean hasEffect(final ItemStack par1ItemStack, final int pass) { - int h = getCorrectMetaForItemstack(par1ItemStack); - if (this.hasEffect.get(h) != null) { - return this.hasEffect.get(h); - } - return false; - } - @SuppressWarnings({ "unchecked" }) @Override public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) { @@ -185,21 +159,19 @@ public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, L GTLanguageManager .getTranslation("gtplusplus." + this.getUnlocalizedName(aStack) + "." + aOffsetMeta + ".tooltip")); - if (aOffsetMeta <= 3) { - FluidStack f = getFluid(aStack); - aList.add(StatCollector.translateToLocal("item.itemGregtechPump.tooltip.0")); - aList.add(StatCollector.translateToLocal("item.itemGregtechPump.tooltip.1")); - aList.add(EnumChatFormatting.DARK_GRAY + StatCollector.translateToLocal("item.itemGregtechPump.tooltip.2")); - aList.add( - EnumChatFormatting.BLUE + (f != null ? f.getLocalizedName() - : StatCollector.translateToLocal("item.itemGregtechPump.tooltip.3"))); - aList.add( - EnumChatFormatting.BLUE + (f != null ? "" + f.amount : "" + 0) - + "L" - + " / " - + formatNumbers(getCapacity(aStack)) - + "L"); - } + FluidStack f = getFluid(aStack); + aList.add(StatCollector.translateToLocal("item.itemGregtechPump.tooltip.0")); + aList.add(StatCollector.translateToLocal("item.itemGregtechPump.tooltip.1")); + aList.add(EnumChatFormatting.DARK_GRAY + StatCollector.translateToLocal("item.itemGregtechPump.tooltip.2")); + aList.add( + EnumChatFormatting.BLUE + (f != null ? f.getLocalizedName() + : StatCollector.translateToLocal("item.itemGregtechPump.tooltip.3"))); + aList.add( + EnumChatFormatting.BLUE + (f != null ? "" + formatNumbers(f.amount) : "" + 0) + + "L" + + " / " + + formatNumbers(getCapacity(aStack)) + + "L"); final Long[] tStats = this.getElectricStats(aStack); if (tStats != null) { @@ -455,25 +427,6 @@ public final IElectricItemManager getManager(final ItemStack aStack) { return this; } // We are our own Manager - /** - * Sets the Furnace Burn Value for the Item. - * - * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765] - * @param aValue 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU) - * @return the Item itself for convenience in constructing. - */ - public final ItemGregtechPump setBurnValue(final int aMetaValue, final int aValue) { - if ((aMetaValue < 0) || (aValue < 0)) { - return this; - } - if (aValue == 0) { - this.mBurnValues.remove((short) aMetaValue); - } else { - this.mBurnValues.put((short) aMetaValue, aValue > Short.MAX_VALUE ? Short.MAX_VALUE : (short) aValue); - } - return this; - } - /** * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765] * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior) @@ -543,7 +496,7 @@ public final IIcon getIconFromDamage(final int aMetaData) { return mIconMap.get(0); } else { int newMeta = aMetaData - this.mOffset; - newMeta = (Math.max(0, Math.min(3, newMeta))); + newMeta = (Math.max(0, Math.min(4, newMeta))); return mIconMap.get(newMeta); } } @@ -570,21 +523,11 @@ public final Long[] getElectricStats(final ItemStack aStack) { return this.mElectricStats.get((short) aStack.getItemDamage()); } - @Override - public int getItemEnchantability() { - return 0; - } - @Override public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) { return false; } - @Override - public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) { - return false; - } - /** * Adds a special Item Behaviour to the Item. *

@@ -608,11 +551,10 @@ public final ItemGregtechPump addItemBehavior(final int aMetaValue, /** * This adds a Custom Item to the ending Range. * - * @param aID The Id of the assigned Item [0 - mItemAmount] (The MetaData gets auto-shifted by +mOffset) - * @param aEnglish The Default Localized Name of the created Item - * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip - * @param aFoodBehavior The Food Value of this Item. Can be null aswell. Just a convenience thing. - * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things. + * @param aID The Id of the assigned Item [0 - mItemAmount] (The MetaData gets auto-shifted by +mOffset) + * @param aEnglish The Default Localized Name of the created Item + * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip + * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things. * @return An ItemStack containing the newly created Item. */ @SuppressWarnings("unchecked") @@ -686,9 +628,7 @@ public final ItemStack addItem(final int aID, final String aEnglish, String aToo @Override public String getItemStackDisplayName(final ItemStack aStack) { int keyValue = (getCorrectMetaForItemstack(aStack)); - if (keyValue < 0 || keyValue > 3) { - keyValue = 0; - } + keyValue = GTUtility.clamp(keyValue, 0, 4); return GTLanguageManager .getTranslation("gtplusplus." + this.getUnlocalizedName(aStack) + "." + keyValue + ".name"); } @@ -717,9 +657,7 @@ public void emptyStoredFluid(ItemStack aStack) { } public void storeFluid(ItemStack aStack, FluidStack aFluid) { - if (aFluid == null) { - return; - } else { + if (aFluid != null) { String fluidname = aFluid.getFluid() .getName(); int amount = aFluid.amount; @@ -767,7 +705,8 @@ public int getCapacity(ItemStack container) { .getInteger("mCapacity"); } int aMeta = this.getCorrectMetaForItemstack(container); - return aMeta == 0 ? 2000 : aMeta == 1 ? 8000 : aMeta == 2 ? 32000 : 128000; + + return 2000 * (int) Math.pow(4, aMeta); } public int fill(ItemStack container, FluidStack resource) { @@ -861,36 +800,24 @@ public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { && container.getTagCompound() .getBoolean("mInit")) { - String aStored; - int aStoredAmount = 0; FluidStack aStoredFluid = getFluid(container); - - if (aStoredFluid != null) { - aStored = aStoredFluid.getFluid() - .getName(); - aStoredAmount = aStoredFluid.amount; - } - // We cannot drain this if it's empty. - else if (aStoredFluid == null) { + if (aStoredFluid == null) { + // We cannot drain this if it's empty. return null; } + int aStoredAmount = aStoredFluid.amount; + if (maxDrain >= aStoredAmount) { emptyStoredFluid(container); return aStoredFluid; } else { // Handle Partial removal int amountRemaining = (aStoredAmount - maxDrain); - if (amountRemaining == 0) { - emptyStoredFluid(container); - } else { - FluidStack newAmount = FluidUtils.getFluidStack(aStoredFluid, amountRemaining); - FluidStack drained = FluidUtils.getFluidStack(aStoredFluid, maxDrain); - if (newAmount != null && drained != null) { - storeFluid(container, newAmount); - return drained; - } - } + FluidStack newAmount = FluidUtils.getFluidStack(aStoredFluid, amountRemaining); + FluidStack drained = FluidUtils.getFluidStack(aStoredFluid, maxDrain); + storeFluid(container, newAmount); + return drained; } } return null; @@ -914,8 +841,11 @@ public void initNBT(ItemStack aStack) { aNewNBT.setBoolean("mInit", true); aNewNBT.setString("mFluid", "@@@@@"); aNewNBT.setInteger("mFluidAmount", 0); - int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000))); - aNewNBT.setInteger("mCapacity", aCapacity); + if (!aNewNBT.hasKey("capacityInit")) { + int aCapacity = 2000 * (int) Math.pow(4, aMeta); + aNewNBT.setInteger("mCapacity", aCapacity); + aNewNBT.setBoolean("capacityInit", true); + } aStack.setTagCompound(aNewNBT); } } @@ -934,19 +864,11 @@ public boolean tryDrainTile(ItemStack aStack, World aWorld, EntityPlayer aPlayer return false; } else { int aTier = (aStack.getItemDamage() - 1000); - int removal; - if (aTier == 0) { - removal = 0; - } else if (aTier == 1) { - removal = 32; - } else if (aTier == 2) { - removal = 128; - } else if (aTier == 3) { - removal = 512; - } else { - removal = 8; + int removal = 0; + if (aTier != 0) { + removal = 8 * (int) Math.pow(4, aTier); } - if (!canUse(aStack, removal) && aTier > 0) { + if (!canUse(aStack, removal) && aTier > 0 && aTier < 4) { PlayerUtils.messagePlayer(aPlayer, "Not enough power."); Logger.INFO("No Power"); return false; @@ -967,17 +889,12 @@ public boolean tryDrainTile(ItemStack aStack, World aWorld, EntityPlayer aPlayer didDrain = true; } } else { - didDrain = aTier == 0; + didDrain = aTier == 0 || aTier == 4; } if (didDrain) { if ((tTileEntity instanceof IGregTechTileEntity)) { - return this.drainTankGT(tTileEntity, aStack, aWorld, aPlayer, aX, aY, aZ); - } - // Try support Standard Fluid Tanks too (May disable if dupes appear again) - else if ((tTileEntity instanceof IFluidTank || tTileEntity instanceof IFluidHandler)) { - // return this.drainIFluidTank(tTileEntity, aStack, aWorld, aPlayer, aX, aY, aZ); - return false; + return this.drainTankGT(tTileEntity, aStack, aWorld, aPlayer); } } } @@ -986,58 +903,11 @@ else if ((tTileEntity instanceof IFluidTank || tTileEntity instanceof IFluidHand return false; } - /* - * Vanilla IFluidTank - */ - - public boolean drainIFluidTank(TileEntity tTileEntity, ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, - int aY, int aZ) { - if (tTileEntity == null) { - Logger.INFO("Invalid Tile, somehow."); - return false; - } - if ((tTileEntity instanceof IFluidTank || tTileEntity instanceof IFluidHandler)) { - if (this.getFluid(aStack) == null - || (this.getFluid(aStack) != null && this.getFluid(aStack).amount < this.getCapacity(aStack))) { - Logger.INFO("Trying to find Stored Fluid - Behaviour Class."); - FluidStack aStored = getStoredFluidOfVanillaTank(tTileEntity); - if (aStored != null) { - int mAmountInserted = fill(aStack, aStored); - FluidStack newStackRemainingInTank; - if (mAmountInserted > 0) { - if (mAmountInserted == aStored.amount) { - newStackRemainingInTank = null; - } else { - newStackRemainingInTank = FluidUtils - .getFluidStack(aStored, (aStored.amount - mAmountInserted)); - } - boolean b = setStoredFluidOfVanillaTank(tTileEntity, newStackRemainingInTank); - Logger.INFO("Cleared Tank? " + b + " | mAmountInserted: " + mAmountInserted); - Logger.INFO("Returning " + b + " - drainTankVanilla."); - if (b) { - PlayerUtils.messagePlayer( - aPlayer, - "Drained " + mAmountInserted + "L of " + aStored.getLocalizedName() + "."); - } - return b; - } - } else { - Logger.INFO("Found no valid Fluidstack - drainTankVanilla."); - } - } else { - Logger.INFO("Pump is full."); - } - } - Logger.INFO("Could not drain vanilla tank."); - return false; - } - /* * GT Tanks */ - public boolean drainTankGT(TileEntity tTileEntity, ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, - int aY, int aZ) { + public boolean drainTankGT(TileEntity tTileEntity, ItemStack aStack, World aWorld, EntityPlayer aPlayer) { if (tTileEntity == null) { return false; } @@ -1090,127 +960,6 @@ public boolean drainTankGT(TileEntity tTileEntity, ItemStack aStack, World aWorl return false; } - /* - * Vanilla Tanks - */ - - public FluidStack getStoredFluidOfVanillaTank(TileEntity aTileEntity) { - if (aTileEntity == null) { - return null; - } else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) { - if (aTileEntity instanceof IFluidTank) { - return getStoredFluidOfVanillaTank((IFluidTank) aTileEntity); - } else { - return getStoredFluidOfVanillaTank((IFluidHandler) aTileEntity); - } - } else { - return null; - } - } - - public FluidStack getStoredFluidOfVanillaTank(IFluidTank aTileEntity) { - FluidStack f = aTileEntity.getFluid(); - Logger.INFO( - "Returning Fluid stack from tile. Found: " - + (f != null ? f.getLocalizedName() + " - " + f.amount + "L" : "Nothing")); - return f; - } - - public FluidStack getStoredFluidOfVanillaTank(IFluidHandler aTileEntity) { - if (aTileEntity instanceof IFluidTank) { - return getStoredFluidOfVanillaTank((IFluidTank) aTileEntity); - } - FluidStack f; - ArrayList m = new ArrayList<>(); - for (int i = 0; i < 6; i++) { - m.add(aTileEntity.getTankInfo(ForgeDirection.getOrientation(i))); - } - if (m.get(0) != null && m.get(0)[0] != null && m.get(0)[0].fluid != null) { - return m.get(0)[0].fluid; - } else { - return null; - } - } - - public boolean setStoredFluidOfVanillaTank(TileEntity aTileEntity, FluidStack aSetFluid) { - Logger.INFO("Trying to clear Tile's tank. - Behaviour Class. [1]"); - - if (aTileEntity == null) { - return false; - } else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) { - if (aTileEntity instanceof IFluidTank) { - Logger.INFO("Tile Was instanceof IFluidTank."); - FluidStack f = ((IFluidTank) aTileEntity).getFluid(); - if (aSetFluid == null) { - aSetFluid = f; - aSetFluid.amount = f.amount; - } - int toDrain = (f.amount - aSetFluid.amount); - FluidStack newStack; - if (toDrain <= 0) { - newStack = f; - } else { - newStack = ((IFluidTank) aTileEntity).drain(toDrain, true); - } - - if (newStack.isFluidEqual(aSetFluid) && newStack.amount == aSetFluid.amount) { - Logger.INFO("Removed fluid from vanilla IFluidTank successfully."); - return true; - } else { - Logger.INFO("Failed trying to remove fluid from vanilla IFluidTank."); - return false; - } - } else { - - // Rewrite Fluid handling for Vanilla type tanks - if (!(aTileEntity instanceof IFluidHandler)) { - Logger.INFO("Tile Was not an instance of IFluidHandler."); - return false; - } - - IFluidHandler aTank = (IFluidHandler) aTileEntity; - FluidStack aTankContents = null; - FluidTankInfo[] a1 = aTank.getTankInfo(ForgeDirection.UNKNOWN); - if (a1 != null) { - if (a1[0] != null) { - aTankContents = a1[0].fluid; - Logger.INFO( - "Found Fluid in Tank. " + aTankContents.getLocalizedName() + " - " + aTankContents.amount); - } - } - if (aSetFluid == null) { - Logger.INFO("Setting fluid to tank contents, as we're going to empty it totally."); - aSetFluid = aTankContents.copy(); - } else { - Logger.INFO("Setting fluid to tank contents, as we're going to empty it totally."); - } - Logger.INFO( - "Tile Was instance of IFluidHandler. Trying to Drain " + aSetFluid.getLocalizedName() - + " - " - + aSetFluid.amount); - - if (a1 == null || aTankContents == null) { - Logger.INFO("Tank is empty."); - return false; - } - // Found some Fluid in the tank - else { - FluidStack aDrainedStack = aTank.drain(ForgeDirection.UNKNOWN, aSetFluid, true); - if (aDrainedStack.isFluidStackIdentical(aSetFluid)) { - Logger.INFO("Drained!"); - return true; - } else { - Logger.INFO("Partially Drained! This is probably an error."); - return true; - } - } - } - } else { - Logger.INFO("Bad Tank Tile to drain."); - return false; - } - } - /* * GT Tanks */ @@ -1235,18 +984,6 @@ public FluidStack getStoredFluidOfGTMachine(IGregTechTileEntity aTileEntity) { public FluidStack getStoredFluidOfGTMachine(MTEBasicTank aTileEntity) { FluidStack f = aTileEntity.mFluid; - // Let's see if this machine has output fluid too - /* - * if (f == null) { Logger.INFO("Could not find any input fluid, checking output if possible."); if (aTileEntity - * instanceof GT_MetaTileEntity_BasicMachine) { GT_MetaTileEntity_BasicMachine g = - * (GT_MetaTileEntity_BasicMachine) aTileEntity; - * Logger.INFO("Tile is a Basic Machine of some sort - "+g.mNEIName); if (g != null) { f = g.mOutputFluid; if (f - * != null) { Logger.INFO("Found output fluid! "+f.getLocalizedName()); } else { - * Logger.INFO("Did not find anything!"); f = g.getFluid(); if (f != null) { - * Logger.INFO("Found fluid! "+f.getLocalizedName()); } else { Logger.INFO("Did not find anything!"); f = - * g.getFluid(); } } } } } - */ - Logger.INFO( "Returning Fluid stack from tile. Found: " + (f != null ? f.getLocalizedName() + " - " + f.amount + "L" : "Nothing")); @@ -1272,12 +1009,6 @@ public boolean setStoredFluidOfGTMachine(IGregTechTileEntity aTileEntity, FluidS public boolean setStoredFluidOfGTMachine(MTEBasicTank aTileEntity, FluidStack aSetFluid) { try { - - // Try Handle Outputs First - /* - * if (aTileEntity.setDrainableStack(aSetFluid) != null) { return true; } - */ - aTileEntity.mFluid = aSetFluid; boolean b = aTileEntity.mFluid == aSetFluid; Logger.INFO("Trying to set Tile's tank. - Behaviour Class. [3] " + b); @@ -1296,7 +1027,7 @@ public int getCorrectMetaForItemstack(ItemStack aStack) { return 0; } else { int newMeta = aStack.getItemDamage() - this.mOffset; - newMeta = (Math.max(0, Math.min(3, newMeta))); + newMeta = (Math.max(0, Math.min(4, newMeta))); return newMeta; } } diff --git a/src/main/java/gtPlusPlus/core/network/packet/PacketTurbineHatchUpdate.java b/src/main/java/gtPlusPlus/core/network/packet/PacketTurbineHatchUpdate.java new file mode 100644 index 00000000000..ec9509f29a9 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/network/packet/PacketTurbineHatchUpdate.java @@ -0,0 +1,122 @@ +package gtPlusPlus.core.network.packet; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.network.handler.AbstractClientMessageHandler; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchTurbine; +import io.netty.buffer.ByteBuf; + +public class PacketTurbineHatchUpdate extends AbstractClientMessageHandler + implements AbstractPacket { + + private int x; + private int y; + private int z; + private boolean hasTurbine; + private boolean formed; + private BlockPos controller; + + public PacketTurbineHatchUpdate() {} + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(x); + buf.writeInt(y); + buf.writeInt(z); + buf.writeBoolean(hasTurbine); + buf.writeBoolean(formed); + if (controller != null) { + buf.writeBoolean(true); + buf.writeInt(controller.xPos); + buf.writeInt(controller.yPos); + buf.writeInt(controller.zPos); + } else { + buf.writeBoolean(false); + } + } + + @Override + public void fromBytes(ByteBuf buf) { + x = buf.readInt(); + y = buf.readInt(); + z = buf.readInt(); + hasTurbine = buf.readBoolean(); + formed = buf.readBoolean(); + if (buf.readBoolean()) { + controller = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt(), 0); + } else { + controller = null; + } + } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public int getZ() { + return z; + } + + public void setZ(int z) { + this.z = z; + } + + public boolean isHasTurbine() { + return hasTurbine; + } + + public void setHasTurbine(boolean hasTurbine) { + this.hasTurbine = hasTurbine; + } + + public boolean isFormed() { + return formed; + } + + public void setFormed(boolean formed) { + this.formed = formed; + } + + public BlockPos getController() { + return controller; + } + + public void setController(BlockPos controller) { + this.controller = controller; + } + + @Override + public String getPacketName() { + return "Packet_VoluemtricFlaskSetter_ToClient"; + } + + @Override + public IMessage handleClientMessage(EntityPlayer player, PacketTurbineHatchUpdate message, MessageContext ctx) { + TileEntity te = player.getEntityWorld() + .getTileEntity(message.x, message.y, message.z); + if (!(te instanceof BaseMetaTileEntity mteHost)) return null; + IMetaTileEntity mte = mteHost.getMetaTileEntity(); + if (!(mte instanceof MTEHatchTurbine hatch)) return null; + hatch.receiveUpdate(message); + + return null; + } +} diff --git a/src/main/java/gtPlusPlus/core/recipe/RecipesGregTech.java b/src/main/java/gtPlusPlus/core/recipe/RecipesGregTech.java index 8703bcb3e18..d00e8c7e8c0 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RecipesGregTech.java +++ b/src/main/java/gtPlusPlus/core/recipe/RecipesGregTech.java @@ -44,9 +44,13 @@ import static gtPlusPlus.api.recipe.GTPPRecipeMaps.thermalBoilerRecipes; import static gtPlusPlus.core.material.MaterialsAlloy.TITANSTEEL; +import java.util.Arrays; +import java.util.List; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -116,6 +120,7 @@ private static void execute() { chemplantRecipes(); alloySmelterRecipes(); thermalBoilerRecipes(); + craftingTableRecipes(); /* * Special Recipe handlers @@ -562,6 +567,26 @@ private static void assemblyLineRecipes() { .eut(TierEU.RECIPE_UHV / 2) .duration(1 * MINUTES) .addTo(AssemblyLine); + + // Expandable Hand Pump + RA.stdBuilder() + .metadata(RESEARCH_ITEM, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 4, 1)) + .metadata(RESEARCH_TIME, 30 * MINUTES) + .itemInputs( + ItemList.Electric_Pump_LuV.get(4), + ItemList.Electric_Motor_LuV.get(4), + GregtechItemList.VOLUMETRIC_FLASK_32k.get(4), + MaterialsAlloy.LAFIUM.getScrew(16), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.ring, 8), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.stick, 16), + Materials.Osmiridium.getPlates(32)) + .fluidInputs( + MaterialsAlloy.HELICOPTER.getFluidStack(144 * 32), + MaterialsAlloy.INDALLOY_140.getFluidStack(144 * 64)) + .itemOutputs(ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1004, 1)) + .eut(TierEU.RECIPE_LuV) + .duration(30 * SECONDS) + .addTo(AssemblyLine); } private static void laserEngraverRecipes() { @@ -696,6 +721,49 @@ private static void extruderRecipes() { private static void blastSmelterRecipes() { + // Enderium + GTValues.RA.stdBuilder() + .itemInputs( + GTUtility.getIntegratedCircuit(5), + Materials.Tin.getDust(2), + Materials.Platinum.getDust(1), + Materials.Silver.getDust(1), + Materials.Thaumium.getDust(2), + Materials.EnderPearl.getDust(2)) + .fluidOutputs(Materials.Enderium.getMolten(8 * 144)) + .eut(TierEU.RECIPE_EV) + .duration(20 * SECONDS + 1 * MINUTES) + .addTo(alloyBlastSmelterRecipes); + + // Signalium + GTValues.RA.stdBuilder() + .itemInputs( + GTUtility.getIntegratedCircuit(3), + Materials.AnnealedCopper.getDust(30), + Materials.Ardite.getDust(10), + Materials.Redstone.getDust(50)) + .fluidOutputs(GGMaterial.signalium.getMolten(5 * 144)) + .eut(TierEU.RECIPE_LuV) + .noOptimize() + .duration(5 * MINUTES) + .addTo(alloyBlastSmelterRecipes); + + // Lumiium + GTValues.RA.stdBuilder() + .itemInputs( + GTUtility.getIntegratedCircuit(6), + Materials.Tin.getDust(10), + Materials.Iron.getDust(10), + Materials.Copper.getDust(2), + Materials.Silver.getDust(8), + GGMaterial.lumiinessence.get(OrePrefixes.dust, 10), + Materials.Glowstone.getDust(10)) + .fluidOutputs(GGMaterial.lumiium.getMolten(5 * 144)) + .eut(TierEU.RECIPE_LuV) + .noOptimize() + .duration(5 * MINUTES) + .addTo(alloyBlastSmelterRecipes); + // Eglin Steel GTValues.RA.stdBuilder() .itemInputs( @@ -718,6 +786,7 @@ private static void blastSmelterRecipes() { MaterialsElements.getInstance().BARIUM.getDust(2), MaterialsElements.getInstance().CALCIUM.getDust(2), MaterialsElements.getInstance().COPPER.getDust(3)) + .fluidInputs(Materials.Oxygen.getGas(8000), Materials.Mercury.getFluid(1000)) .fluidOutputs(MaterialsAlloy.HG1223.getFluidStack(16 * 144)) .eut(TierEU.RECIPE_LuV) .duration(2 * MINUTES) @@ -1879,4 +1948,36 @@ private static void cyclotronRecipes() { .addTo(cyclotronRecipes); } + + private static void craftingTableRecipes() { + + List tankList = Arrays.asList( + ItemList.Super_Tank_LV, + ItemList.Super_Tank_MV, + ItemList.Super_Tank_HV, + ItemList.Super_Tank_EV, + ItemList.Super_Tank_IV, + ItemList.Quantum_Tank_LV, + ItemList.Quantum_Tank_MV, + ItemList.Quantum_Tank_HV, + ItemList.Quantum_Tank_EV, + ItemList.Quantum_Tank_IV); + + for (int i = 0; i < 10; i++) { + ItemStack tank = tankList.get(i) + .get(1); + ItemStack handPump = ItemUtils.simpleMetaStack(ModItems.toolGregtechPump, 1004, 1); + ItemStack pumpWithNBT = handPump.copy(); + NBTTagCompound nbt = new NBTTagCompound(); + int capacity = i == 9 ? Integer.MAX_VALUE : 4_000_000 * (int) Math.pow(2, i); + nbt.setInteger("mMeta", 4); + nbt.setBoolean("mInit", true); + nbt.setString("mFluid", "@@@@@"); + nbt.setInteger("mFluidAmount", 0); + nbt.setInteger("mCapacity", capacity); + nbt.setBoolean("capacityInit", true); + pumpWithNBT.setTagCompound(nbt); + GTModHandler.addShapelessCraftingRecipe(pumpWithNBT, new Object[] { handPump, tank }); + } + } } diff --git a/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java b/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java index 62fc892d094..2124f9979d1 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java @@ -273,9 +273,9 @@ private static void gt4FarmManager() { CI.getRobotArm(aTier, 1), CI.getSensor(aTier, 1), CI.getRobotArm(aTier, 1), - ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1), + ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), CI.getTieredMachineHull(aTier, 1), - ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1), + ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), CI.getTieredCircuitOreDictName(aTier), aInputHatches[i].get(1), CI.getTieredCircuitOreDictName(aTier), @@ -2869,19 +2869,20 @@ private static void runModRecipes() { .eut(TierEU.RECIPE_LuV) .addTo(assemblerRecipes); - int aCostMultiplier = 1; - // Reservoir Hatch - GTValues.RA.stdBuilder() - .itemInputs( - ItemList.Hatch_Input_EV.get(1), - GTModHandler.getModItem(RemoteIO.ID, "tile.machine", 1), - ItemList.Electric_Pump_EV.get(1)) - .itemOutputs(GregtechItemList.Hatch_Reservoir.get(1)) - .duration(5 * SECONDS) - .eut(TierEU.RECIPE_EV) - .addTo(assemblerRecipes); + if (RemoteIO.isModLoaded()) { + GTValues.RA.stdBuilder() + .itemInputs( + ItemList.Hatch_Input_EV.get(1), + GTModHandler.getModItem(RemoteIO.ID, "tile.machine", 1), + ItemList.Electric_Pump_EV.get(1)) + .itemOutputs(GregtechItemList.Hatch_Reservoir.get(1)) + .duration(5 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(assemblerRecipes); + } // Mystic Frame + int aCostMultiplier = 1; GTValues.RA.stdBuilder() .itemInputs( GregtechItemList.Casing_Multi_Use.get(1), diff --git a/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java b/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java index f0df1cb2b93..a5365011a6a 100644 --- a/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java +++ b/src/main/java/gtPlusPlus/core/util/data/ArrayUtils.java @@ -5,6 +5,8 @@ import java.util.Collections; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.item.ItemStack; public class ArrayUtils { @@ -21,13 +23,13 @@ public static V[] insertElementAtIndex(V[] aArray, int aIndex, V aObjectToIn return newArray; } - public static Object[] removeNulls(final Object[] v) { + public static Object[] removeNulls(@Nonnull final Object[] v) { List list = new ArrayList<>(Arrays.asList(v)); list.removeAll(Collections.singleton(null)); return list.toArray(new Object[0]); } - public static ItemStack[] removeNulls(final ItemStack[] v) { + public static ItemStack[] removeNulls(@Nonnull final ItemStack[] v) { List list = new ArrayList<>(Arrays.asList(v)); list.removeAll(Collections.singleton((ItemStack) null)); return list.toArray(new ItemStack[0]); diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java index d0728304c43..2ef2d9764ba 100644 --- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java +++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java @@ -46,6 +46,7 @@ protected SaplingBase(String blockNameLocalized, String blockNameUnlocalized, St this.setBlockName(blockName); ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeSapling", true); this.setCreativeTab(AddToCreativeTab.tabBOP); + this.setStepSound(Block.soundTypeGrass); } /** diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java index 6786fabc313..83c18070309 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java @@ -4,6 +4,9 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; +import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget; + +import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -124,4 +127,9 @@ public void generateParticles(World aWorld, String name) { -ySpd, zSpd); } + + @Override + protected FluidSlotWidget createFluidSlot() { + return super.createFluidSlot().setFilter(f -> f == Materials.Air.mGas); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchReservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchReservoir.java index 23231cc6e97..4351133d535 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchReservoir.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchReservoir.java @@ -4,6 +4,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; +import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -71,4 +73,9 @@ public ITexture[] getTexturesActive(final ITexture aBaseTexture) { public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { return new ITexture[] { aBaseTexture, new GTRenderedTexture(TexturesGtBlock.Overlay_Water) }; } + + @Override + protected FluidSlotWidget createFluidSlot() { + return super.createFluidSlot().setFilter(f -> f == FluidRegistry.WATER); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSteamBusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSteamBusInput.java new file mode 100644 index 00000000000..54cf4083cf7 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSteamBusInput.java @@ -0,0 +1,51 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.MTEHatchInputBus; +import gregtech.api.recipe.RecipeMap; +import gtPlusPlus.core.lib.GTPPCore; + +public class MTEHatchSteamBusInput extends MTEHatchInputBus { + + public RecipeMap mRecipeMap = null; + + public MTEHatchSteamBusInput(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, getSlots() + 1); + } + + public MTEHatchSteamBusInput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, getSlots() + 1, aDescription, aTextures); + } + + public static int getSlots() { + return 4; + } + + @Override + public String[] getDescription() { + return new String[] { "Item Input for Steam Multiblocks", + "Shift + right click with screwdriver to toggle automatic item shuffling", "Capacity: 4 stacks", + "Does not work with non-steam multiblocks", GTPPCore.GT_Tooltip.get() }; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new MTEHatchSteamBusInput(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public int getCircuitSlot() { + return getSlots(); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java index ee40ffdbe8f..0a42f008763 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java @@ -1,15 +1,18 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5; -import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.*; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; import org.apache.commons.lang3.ArrayUtils; +import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotWidget; @@ -18,18 +21,22 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.SoundResource; import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.MetaGeneratedTool; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.MTEHatch; import gregtech.api.objects.GTItemStack; -import gregtech.api.objects.GTRenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; +import gregtech.api.util.GTUtilityClient; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.handler.PacketHandler; import gtPlusPlus.core.lib.GTPPCore; +import gtPlusPlus.core.network.packet.PacketTurbineHatchUpdate; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.MTELargerTurbineBase; @@ -39,9 +46,12 @@ public class MTEHatchTurbine extends MTEHatch { public boolean mHasController = false; public boolean mUsingAnimation = true; - private String mControllerLocation; + private BlockPos mControllerLocation; public int mEUt = 0; + private boolean mFormed; + private boolean mHasTurbine; + public MTEHatchTurbine(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 16, "Turbine Rotor holder for XL Turbines"); } @@ -68,12 +78,13 @@ public String[] getDescription() { @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, getFrontFacingTurbineTexture() }; + return new ITexture[] { aBaseTexture, TextureFactory.of(LARGETURBINE_NEW_ACTIVE5) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, getFrontFacingTurbineTexture() }; + if (hasTurbine()) return new ITexture[] { aBaseTexture, TextureFactory.of(LARGETURBINE_NEW_EMPTY5) }; + return new ITexture[] { aBaseTexture, TextureFactory.of(LARGETURBINE_NEW5) }; } public int getEU() { @@ -105,8 +116,11 @@ public boolean isValidSlot(int aIndex) { } public boolean hasTurbine() { - ItemStack aStack = this.mInventory[0]; - return MTELargerTurbineBase.isValidTurbine(aStack); + if (getBaseMetaTileEntity().isServerSide()) { + ItemStack aStack = this.mInventory[0]; + return MTELargerTurbineBase.isValidTurbine(aStack); + } + return mHasTurbine; } public ItemStack getTurbine() { @@ -123,6 +137,7 @@ public boolean canWork() { public boolean insertTurbine(ItemStack aTurbine) { if (MTELargerTurbineBase.isValidTurbine(aTurbine)) { this.mInventory[0] = aTurbine; + sendUpdate(); return true; } return false; @@ -193,12 +208,16 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (this.mHasController) { if (aTick % 20 == 0) { - this.getBaseMetaTileEntity() - .setActive(isControllerActive()); + boolean oActive = getBaseMetaTileEntity().isActive(); + boolean active = isControllerActive(); + getBaseMetaTileEntity().setActive(active); + if (active != oActive) { + getBaseMetaTileEntity().issueClientUpdate(); + } } } else if (this.mControllerLocation != null) { // Weird Invalid State - if (setController(BlockPos.generateBlockPos(mControllerLocation))) { + if (setController(mControllerLocation)) { // Valid } } else { @@ -218,20 +237,17 @@ public boolean isControllerActive() { } public MTELargerTurbineBase getController() { - if (this.mHasController && this.mControllerLocation != null && !this.mControllerLocation.isEmpty()) { - BlockPos p = BlockPos.generateBlockPos(mControllerLocation); - if (p != null) { - // Logger.INFO(p.getLocationString()); - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity() - .getIGregTechTileEntity(p.xPos, p.yPos, p.zPos); - if (tTileEntity != null && tTileEntity.getMetaTileEntity() instanceof MTELargerTurbineBase) { - return (MTELargerTurbineBase) tTileEntity.getMetaTileEntity(); + if (this.mHasController && this.mControllerLocation != null) { + BlockPos p = mControllerLocation; + // Logger.INFO(p.getLocationString()); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntity(p.xPos, p.yPos, p.zPos); + if (tTileEntity != null && tTileEntity.getMetaTileEntity() instanceof MTELargerTurbineBase) { + return (MTELargerTurbineBase) tTileEntity.getMetaTileEntity(); + } else { + if (tTileEntity == null) { + Logger.INFO("Controller MTE is null, somehow?"); } else { - if (tTileEntity == null) { - Logger.INFO("Controller MTE is null, somehow?"); - } else { - Logger.INFO("Controller is a different MTE to expected"); - } + Logger.INFO("Controller is a different MTE to expected"); } } } @@ -240,13 +256,13 @@ public MTELargerTurbineBase getController() { } public boolean canSetNewController() { - return (mControllerLocation == null || mControllerLocation.isEmpty()) && !this.mHasController; + return (mControllerLocation == null) && !this.mHasController; } public boolean setController(BlockPos aPos) { clearController(); if (canSetNewController()) { - mControllerLocation = aPos.getUniqueIdentifier(); + mControllerLocation = aPos; mHasController = true; Logger.INFO("Successfully injected controller into this Turbine Assembly Hatch."); } @@ -258,22 +274,40 @@ public void clearController() { this.mHasController = false; } - public boolean usingAnimations() { - return mUsingAnimation; + public IIconContainer[] getTurbineTextureActive() { + return TURBINE_NEW_ACTIVE; } - private ITexture getFrontFacingTurbineTexture() { - if (!mHasController) { - return this.getBaseMetaTileEntity() - .isActive() ? new GTRenderedTexture(LARGETURBINE_ST_ACTIVE5) : new GTRenderedTexture(LARGETURBINE_ST5); - } else { - if (usingAnimations()) { - if (isControllerActive()) { - return getController().frontFaceActive; - } - } - return getController().frontFace; - } + public IIconContainer[] getTurbineTextureFull() { + return TURBINE_NEW; + } + + public IIconContainer[] getTurbineTextureEmpty() { + return TURBINE_NEW_EMPTY; + } + + @Override + public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + if (!mFormed) return false; + + IIconContainer[] tTextures; + if (getBaseMetaTileEntity().isActive()) tTextures = getTurbineTextureActive(); + else if (hasTurbine()) tTextures = getTurbineTextureFull(); + else tTextures = getTurbineTextureEmpty(); + GTUtilityClient.renderTurbineOverlay( + aWorld, + aX, + aY, + aZ, + aRenderer, + ExtendedFacing.of(getBaseMetaTileEntity().getFrontFacing()), + null, + tTextures); + return false; + } + + public boolean usingAnimations() { + return mUsingAnimation; } @Override @@ -301,6 +335,12 @@ public void setActive(boolean b) { .setActive(b); } + @Override + public void setInventorySlotContents(int aIndex, ItemStack aStack) { + super.setInventorySlotContents(aIndex, aStack); + sendUpdate(); + } + @Override public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aStack) { return false; @@ -312,10 +352,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f PlayerUtils.messagePlayer(aPlayer, "Using Animations? " + usingAnimations()); PlayerUtils.messagePlayer(aPlayer, "Has Controller? " + this.mHasController); if (mHasController) { - PlayerUtils.messagePlayer( - aPlayer, - "Controller Location: " + BlockPos.generateBlockPos(mControllerLocation) - .getLocationString()); + PlayerUtils.messagePlayer(aPlayer, "Controller Location: " + mControllerLocation.getLocationString()); PlayerUtils.messagePlayer(aPlayer, "Controller Active? " + this.isControllerActive()); } PlayerUtils.messagePlayer( @@ -378,6 +415,7 @@ public boolean onToolClick(ItemStack tCurrentItem, EntityPlayer aPlayer, ForgeDi aPlayer.inventory.addItemStackToInventory((this.getTurbine())); this.mInventory[0] = null; GTUtility.sendChatToPlayer(aPlayer, "Removed turbine with wrench."); + sendUpdate(); return true; } } else { @@ -386,8 +424,8 @@ public boolean onToolClick(ItemStack tCurrentItem, EntityPlayer aPlayer, ForgeDi aHasTurbine ? "Cannot remove turbine, no free inventory space." : "No turbine to remove."); } } else if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) { - if (mControllerLocation != null && !mControllerLocation.isEmpty()) { - if (setController(BlockPos.generateBlockPos(mControllerLocation))) { + if (mControllerLocation != null) { + if (setController(mControllerLocation)) { if (PlayerUtils.isCreative(aPlayer) || GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { String tChat = "Trying to Reset linked Controller"; @@ -411,9 +449,35 @@ public boolean onToolClick(ItemStack tCurrentItem, EntityPlayer aPlayer, ForgeDi @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + SlotWidget slot = new SlotWidget(inventoryHandler, 0).setFilter(MTELargerTurbineBase::isValidTurbine); + if (getBaseMetaTileEntity().isServerSide()) slot.setChangeListener(this::sendUpdate); builder.widget( - new SlotWidget(inventoryHandler, 0).setFilter(MTELargerTurbineBase::isValidTurbine) - .setAccess(false, true) + slot.setAccess(false, true) .setPos(79, 34)); } + + public void receiveUpdate(PacketTurbineHatchUpdate message) { + mHasTurbine = message.isHasTurbine(); + mFormed = message.isFormed(); + if (message.getController() != null) clearController(); + else setController(message.getController()); + getBaseMetaTileEntity().issueTextureUpdate(); + } + + public void sendUpdate() { + PacketTurbineHatchUpdate message = new PacketTurbineHatchUpdate(); + message.setX(getBaseMetaTileEntity().getXCoord()); + message.setY(getBaseMetaTileEntity().getYCoord()); + message.setZ(getBaseMetaTileEntity().getZCoord()); + message.setFormed(mHasController && getController().mMachine); + message.setHasTurbine(hasTurbine()); + message.setController(mControllerLocation); + PacketHandler.sendToAllAround( + message, + getBaseMetaTileEntity().getWorld().provider.dimensionId, + getBaseMetaTileEntity().getXCoord(), + getBaseMetaTileEntity().getYCoord(), + getBaseMetaTileEntity().getZCoord(), + 64.0D); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java deleted file mode 100644 index 5de87c4a500..00000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java +++ /dev/null @@ -1,272 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; - -import static gregtech.api.enums.Textures.BlockIcons.ITEM_IN_SIGN; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; - -import gregtech.GTMod; -import gregtech.api.enums.Textures; -import gregtech.api.gui.modularui.GTUIInfos; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.MTEHatch; -import gregtech.api.objects.GTRenderedTexture; -import gregtech.api.recipe.RecipeMap; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GTUtility; -import gtPlusPlus.core.lib.GTPPCore; - -public class MteHatchSteamBusInput extends MTEHatch { - - public RecipeMap mRecipeMap = null; - public boolean disableSort; - - public MteHatchSteamBusInput(int aID, String aName, String aNameRegional, int aTier) { - super( - aID, - aName, - aNameRegional, - aTier, - getSlots(aTier), - new String[] { "Item Input for Steam Multiblocks", - "Shift + right click with screwdriver to toggle automatic item shuffling", "Capacity: 4 stacks", - "Does not work with non-steam multiblocks", GTPPCore.GT_Tooltip.get() }); - } - - public MteHatchSteamBusInput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 4, aDescription, aTextures); - } - - public MteHatchSteamBusInput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 4, aDescription, aTextures); - } - - @Override - public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return GTMod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; - } - - @Override - public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return GTMod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - @Override - public boolean isFacingValid(ForgeDirection facing) { - return true; - } - - @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - @Override - public boolean isValidSlot(int aIndex) { - return true; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new MteHatchSteamBusInput(mName, mTier, mDescriptionArray, mTextures); - } - - @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - return true; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) { - fillStacksIntoFirstSlots(); - } - } - - public void updateSlots() { - for (int i = 0; i < mInventory.length; i++) - if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; - fillStacksIntoFirstSlots(); - } - - protected void fillStacksIntoFirstSlots() { - if (disableSort) { - for (int i = 0; i < mInventory.length; i++) - if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; - } else { - for (int i = 0; i < mInventory.length; i++) - for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null - && (mInventory[i] == null || GTUtility.areStacksEqual(mInventory[i], mInventory[j]))) - GTUtility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - j, - i, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setBoolean("disableSort", disableSort); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - disableSort = aNBT.getBoolean("disableSort"); - } - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - disableSort = !disableSort; - GTUtility.sendChatToPlayer( - aPlayer, - GTUtility.trans("200.1", "Automatic Item Shuffling: ") - + (disableSort ? GTUtility.trans("087", "Disabled") : GTUtility.trans("088", "Enabled"))); - } - } - - @Override - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return side == getBaseMetaTileEntity().getFrontFacing() - && (mRecipeMap == null || mRecipeMap.containsInput(aStack)); - } - - @Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - ITexture[][][] rTextures = new ITexture[14][17][]; - for (byte c = -1; c < 16; c++) { - if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c); - if (rTextures[1][c + 1] == null) rTextures[1][c + 1] = getSideFacingInactive(c); - if (rTextures[2][c + 1] == null) rTextures[2][c + 1] = getFrontFacingActive(c); - if (rTextures[3][c + 1] == null) rTextures[3][c + 1] = getFrontFacingInactive(c); - if (rTextures[4][c + 1] == null) rTextures[4][c + 1] = getTopFacingActive(c); - if (rTextures[5][c + 1] == null) rTextures[5][c + 1] = getTopFacingInactive(c); - if (rTextures[6][c + 1] == null) rTextures[6][c + 1] = getBottomFacingActive(c); - if (rTextures[7][c + 1] == null) rTextures[7][c + 1] = getBottomFacingInactive(c); - if (rTextures[8][c + 1] == null) rTextures[8][c + 1] = getBottomFacingPipeActive(c); - if (rTextures[9][c + 1] == null) rTextures[9][c + 1] = getBottomFacingPipeInactive(c); - if (rTextures[10][c + 1] == null) rTextures[10][c + 1] = getTopFacingPipeActive(c); - if (rTextures[11][c + 1] == null) rTextures[11][c + 1] = getTopFacingPipeInactive(c); - if (rTextures[12][c + 1] == null) rTextures[12][c + 1] = getSideFacingPipeActive(c); - if (rTextures[13][c + 1] == null) rTextures[13][c + 1] = getSideFacingPipeInactive(c); - } - return rTextures; - } - - public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; - } - - public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; - } - - public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; - } - - public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; - } - - public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) }; - } - - public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) }; - } - - public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) }; - } - - public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) }; - } - - public ITexture[] getBottomFacingPipeActive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), - new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; - } - - public ITexture[] getBottomFacingPipeInactive(byte aColor) { - return new ITexture[] { new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), - new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; - } - - public ITexture[] getTopFacingPipeActive(byte aColor) { - return new ITexture[] { - new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), - new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; - } - - public ITexture[] getTopFacingPipeInactive(byte aColor) { - return new ITexture[] { - new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), - new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; - } - - public ITexture[] getSideFacingPipeActive(byte aColor) { - return new ITexture[] { - new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), - new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; - } - - public ITexture[] getSideFacingPipeInactive(byte aColor) { - return new ITexture[] { - new GTRenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), - new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - getBaseMetaTileEntity().add2by2Slots(builder); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java index 9b5448ac491..d0184f5c75b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java @@ -35,6 +35,7 @@ import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureUtility; import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; @@ -83,7 +84,6 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.METHatchAirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchInputBattery; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchOutputBattery; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MteHatchSteamBusInput; import tectech.thing.metaTileEntity.hatch.MTEHatchDynamoMulti; import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyMulti; @@ -742,8 +742,7 @@ public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, RecipeMap if (aMetaTileEntity == null) { return false; } - if (aMetaTileEntity instanceof MTEHatchInput || aMetaTileEntity instanceof MTEHatchInputBus - || aMetaTileEntity instanceof MteHatchSteamBusInput) { + if (aMetaTileEntity instanceof MTEHatchInput || aMetaTileEntity instanceof MTEHatchInputBus) { return resetRecipeMapForHatch((MTEHatch) aMetaTileEntity, aMap); } else { return false; @@ -758,8 +757,7 @@ public boolean resetRecipeMapForHatch(MTEHatch aTileEntity, RecipeMap aMap) { if (aTileEntity == null) { return false; } - if (aTileEntity instanceof MTEHatchInput || aTileEntity instanceof MTEHatchInputBus - || aTileEntity instanceof MteHatchSteamBusInput) { + if (aTileEntity instanceof MTEHatchInput || aTileEntity instanceof MTEHatchInputBus) { if (aTileEntity instanceof MTEHatchInput) { ((MTEHatchInput) aTileEntity).mRecipeMap = null; ((MTEHatchInput) aTileEntity).mRecipeMap = aMap; @@ -776,14 +774,6 @@ public boolean resetRecipeMapForHatch(MTEHatch aTileEntity, RecipeMap aMap) { } else { log("Cleared Input Bus."); } - } else { - ((MteHatchSteamBusInput) aTileEntity).mRecipeMap = null; - ((MteHatchSteamBusInput) aTileEntity).mRecipeMap = aMap; - if (aMap != null) { - log("Remapped Input Bus to " + aMap.unlocalizedName + "."); - } else { - log("Cleared Input Bus."); - } } return true; } else { @@ -1250,7 +1240,8 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements screenElements .widget( - new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mMachine)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)) .widget( @@ -1261,6 +1252,7 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements + ": " + EnumChatFormatting.GREEN + GTValues.VOLTAGE_NAMES[(int) getInputTier()]) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine && getInputTier() > 0)) .widget( @@ -1271,6 +1263,7 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements + ": " + EnumChatFormatting.GREEN + GTValues.VOLTAGE_NAMES[(int) getOutputTier()]) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine && getOutputTier() > 0)) .widget( @@ -1285,10 +1278,12 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements + getBaseMetaTileEntity().getMaxProgress() / 20 + EnumChatFormatting.RESET + " s") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1303,20 +1298,24 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements + getMaxEnergyStorageOfAllEnergyHatches() + EnumChatFormatting.RESET + " EU")) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.usage") + ":") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine && getLastRecipeEU() > 0 && getLastRecipeDuration() > 0)) .widget( TextWidget.dynamicString( () -> StatCollector.translateToLocal( "" + EnumChatFormatting.RED + -getLastRecipeEU() + EnumChatFormatting.RESET + " EU/t/parallel")) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine && getLastRecipeEU() > 0 && getLastRecipeDuration() > 0)) .widget( TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.multiblock.generation") + ":") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine && getLastRecipeEU() < 0 && getLastRecipeDuration() > 0)) .widget( @@ -1327,6 +1326,7 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements + getLastRecipeEU() + EnumChatFormatting.RESET + " EU/t/parallel")) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine && getLastRecipeEU() < 0 && getLastRecipeDuration() > 0)) .widget( @@ -1337,6 +1337,7 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements + getLastRecipeDuration() + EnumChatFormatting.RESET + " ticks") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine && getLastRecipeEU() != 0 && getLastRecipeDuration() > 0)) .widget( @@ -1346,6 +1347,7 @@ protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements + EnumChatFormatting.RED + getLastRecipeEU() + EnumChatFormatting.RESET) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> mMachine && getLastRecipeEU() != 0 @@ -1353,6 +1355,7 @@ && getLastRecipeDuration() > 0 && (mLastRecipe != null ? mLastRecipe.mSpecialValue : 0) > 0)) .widget( new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1368,6 +1371,7 @@ && getLastRecipeDuration() > 0 + EnumChatFormatting.YELLOW + GTValues.VN[GTUtility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET)) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1378,6 +1382,7 @@ && getLastRecipeDuration() > 0 + (mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1388,6 +1393,7 @@ && getLastRecipeDuration() > 0 + (getPollutionPerTick(null) * 20) + EnumChatFormatting.RESET + "/sec") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1398,10 +1404,12 @@ && getLastRecipeDuration() > 0 + getAveragePollutionPercentage() + EnumChatFormatting.RESET + " %") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( - new TextWidget("Total Time Since Built: ").setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget("Total Time Since Built: ").setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( TextWidget @@ -1410,6 +1418,7 @@ && getLastRecipeDuration() > 0 + getRuntimeWeeksDisplay() + EnumChatFormatting.RESET + " Weeks,") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1419,6 +1428,7 @@ && getLastRecipeDuration() > 0 + getRuntimeDaysDisplay() + EnumChatFormatting.RESET + " Days,") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1428,6 +1438,7 @@ && getLastRecipeDuration() > 0 + getRuntimeHoursDisplay() + EnumChatFormatting.RESET + " Hours,") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1437,6 +1448,7 @@ && getLastRecipeDuration() > 0 + getRuntimeMinutesDisplay() + EnumChatFormatting.RESET + " Minutes,") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)) .widget( @@ -1446,6 +1458,7 @@ && getLastRecipeDuration() > 0 + getRuntimeSecondsDisplay() + EnumChatFormatting.RESET + " Seconds") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> mMachine)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTESteamMultiBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTESteamMultiBase.java index 17c88caa20b..a9076840858 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTESteamMultiBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTESteamMultiBase.java @@ -37,14 +37,14 @@ import gregtech.api.util.IGTHatchAdder; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSteamBusInput; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSteamBusOutput; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MteHatchSteamBusInput; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; public abstract class MTESteamMultiBase> extends GTPPMultiBlockBase { - public ArrayList mSteamInputs = new ArrayList<>(); + public ArrayList mSteamInputs = new ArrayList<>(); public ArrayList mSteamOutputs = new ArrayList<>(); public ArrayList mSteamInputFluids = new ArrayList<>(); @@ -173,7 +173,7 @@ public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int if (aMetaTileEntity instanceof MTEHatchCustomFluidBase) { log("Adding Steam Input Hatch"); aDidAdd = addToMachineListInternal(mSteamInputFluids, aMetaTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof MteHatchSteamBusInput) { + } else if (aMetaTileEntity instanceof MTEHatchSteamBusInput) { log( "Trying to set recipe map. Type: " + (getRecipeMap() != null ? getRecipeMap().unlocalizedName : "Null")); @@ -228,7 +228,7 @@ public boolean depleteInput(ItemStack aStack) { } } } - for (MteHatchSteamBusInput tHatch : validMTEList(mSteamInputs)) { + for (MTEHatchSteamBusInput tHatch : validMTEList(mSteamInputs)) { tHatch.mRecipeMap = getRecipeMap(); for (int i = tHatch.getBaseMetaTileEntity() .getSizeInventory() - 1; i >= 0; i--) { @@ -265,7 +265,7 @@ public ArrayList getStoredFluids() { @Override public ArrayList getStoredInputs() { ArrayList rList = new ArrayList<>(); - for (MteHatchSteamBusInput tHatch : validMTEList(mSteamInputs)) { + for (MTEHatchSteamBusInput tHatch : validMTEList(mSteamInputs)) { tHatch.mRecipeMap = getRecipeMap(); for (int i = tHatch.getBaseMetaTileEntity() .getSizeInventory() - 1; i >= 0; i--) { @@ -335,7 +335,7 @@ public List getItemOutputSlots(ItemStack[] toOutput) { @Override public void updateSlots() { for (MTEHatchCustomFluidBase tHatch : validMTEList(mSteamInputFluids)) tHatch.updateSlots(); - for (MteHatchSteamBusInput tHatch : validMTEList(mSteamInputs)) tHatch.updateSlots(); + for (MTEHatchSteamBusInput tHatch : validMTEList(mSteamInputs)) tHatch.updateSlots(); } @Override @@ -355,7 +355,7 @@ public void clearHatches() { @Override public boolean resetRecipeMapForAllInputHatches(RecipeMap aMap) { boolean ret = super.resetRecipeMapForAllInputHatches(aMap); - for (MteHatchSteamBusInput hatch : mSteamInputs) { + for (MTEHatchSteamBusInput hatch : mSteamInputs) { if (resetRecipeMapForHatch(hatch, aMap)) { ret = true; } @@ -428,7 +428,7 @@ protected enum SteamHatchElement implements IHatchElement> @Override public List> mteClasses() { - return Collections.singletonList(MteHatchSteamBusInput.class); + return Collections.singletonList(MTEHatchSteamBusInput.class); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java index e7480e0f129..792f02dc8b7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java @@ -233,7 +233,7 @@ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed) / 3), 1); this.mFluid.amount -= aSafeFloor; - Pollution.addPollution(getBaseMetaTileEntity(), 10 * getPollution()); + Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index c85bac71159..1694632b5d0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -9,8 +9,6 @@ public class CasingTextureHandler { - private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock(); - public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { return switch (aMeta) { @@ -52,6 +50,12 @@ public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { - return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, side, thisBlock); + final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + final int ordinalSide = side.ordinal(); + if (tMeta != 0) { + return getIcon(ordinalSide, tMeta); + } + + return TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java deleted file mode 100644 index 0defa80e6c0..00000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java +++ /dev/null @@ -1,105 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blocks.textures; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.MTEIndustrialCentrifuge; - -public class TexturesCentrifugeMultiblock { - - public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { - return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, side, thisBlock); - } - - private static int isCentrifugeControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, - ForgeDirection side) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (!(tTileEntity instanceof IGregTechTileEntity tTile)) return 0; - if (tTile.getMetaTileEntity() instanceof MTEIndustrialCentrifuge && tTile.getFrontFacing() == side) - return tTile.isActive() ? 1 : 2; - return 0; - } - - public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { - final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - final int ordinalSide = side.ordinal(); - if (tMeta != 0) { - return CasingTextureHandler.getIcon(ordinalSide, tMeta); - } - - int tInvertLeftRightMod = ordinalSide % 2 * 2 - 1; - switch (ordinalSide / 2) { - case 0 -> { - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) continue; - if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, side) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); - return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j); - } - } - } - } - case 1 -> { - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) continue; - if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, side) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); - return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod); - } - } - } - } - case 2 -> { - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if (i == 0 && j == 0) continue; - if (isCentrifugeControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, side) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); - return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod); - } - } - } - } - } - return TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); - } - - public boolean isCentrifugeRunning(IMetaTileEntity aTile) { - if (aTile == null) { - return false; - } else { - return aTile.getBaseMetaTileEntity() - .isActive(); - } - } - - public boolean isUsingAnimatedTexture(IMetaTileEntity aMetaTileEntity) { - if (aMetaTileEntity != null) { - if (aMetaTileEntity instanceof MTEIndustrialCentrifuge) { - return ((MTEIndustrialCentrifuge) aMetaTileEntity).usingAnimations(); - } - } - return false; - } - - public IIcon getIconByIndex(IMetaTileEntity aMetaTileEntity, int aIndex) { - if (isUsingAnimatedTexture(aMetaTileEntity)) { - if (isCentrifugeRunning(aMetaTileEntity)) { - return TexturesGtBlock.CENTRIFUGEACTIVE[aIndex].getIcon(); - } - } - return TexturesGtBlock.CENTRIFUGE[aIndex].getIcon(); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 2f87a3b6fb9..36d0addad8a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -558,25 +558,6 @@ public ResourceLocation getTextureFile() { public static final CustomIcon TEXTURE_TECH_B = new CustomIcon("metro/TEXTURE_TECH_B"); public static final CustomIcon TEXTURE_TECH_C = new CustomIcon("metro/TEXTURE_TECH_C"); - private static final CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1"); - private static final CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1"); - private static final CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2"); - private static final CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2"); - private static final CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3"); - private static final CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3"); - private static final CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4"); - private static final CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4"); - private static final CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5"); - private static final CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5"); - private static final CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6"); - private static final CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6"); - private static final CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7"); - private static final CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7"); - private static final CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8"); - private static final CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8"); - private static final CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9"); - private static final CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9"); - public static final CustomIcon TEXTURE_TECH_PANEL_D = new CustomIcon("metro/TEXTURE_TECH_PANEL_D"); public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H"); @@ -609,9 +590,4 @@ public ResourceLocation getTextureFile() { TEXTURE_CASING_TIERED_IV, TEXTURE_CASING_TIERED_LuV, TEXTURE_CASING_TIERED_ZPM, TEXTURE_CASING_TIERED_UV, TEXTURE_CASING_TIERED_MAX }; - public static IIconContainer[] CENTRIFUGE = new IIconContainer[] { GT8_1, GT8_2, GT8_3, GT8_4, GT8_5, GT8_6, GT8_7, - GT8_8, GT8_9 }; - - public static IIconContainer[] CENTRIFUGEACTIVE = new IIconContainer[] { GT8_1_Active, GT8_2_Active, GT8_3_Active, - GT8_4_Active, GT8_5_Active, GT8_6_Active, GT8_7_Active, GT8_8_Active, GT8_9_Active }; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java index e0acc6666d9..cf300f9f3d6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java @@ -72,33 +72,11 @@ import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE7; import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE8; import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE9; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE1; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE1_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE2; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE2_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE3; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE3_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE4; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE4_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE5; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE5_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE6; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE6_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE7; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE7_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE8; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE8_ACTIVE; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE9; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.OVERLAY_SC_TURBINE9_ACTIVE; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchTurbine; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaSpecialMultiCasings; public class LargeTurbineTextureHandler { @@ -151,256 +129,11 @@ public class LargeTurbineTextureHandler { LARGETURBINE_TU_ACTIVE5.getIcon(), LARGETURBINE_TU_ACTIVE6.getIcon(), LARGETURBINE_TU_ACTIVE7.getIcon(), LARGETURBINE_TU_ACTIVE8.getIcon(), LARGETURBINE_TU_ACTIVE9.getIcon(), }; - public static IIcon[] OVERLAY_SC_TURBINE = new IIcon[] { OVERLAY_SC_TURBINE1.getIcon(), - OVERLAY_SC_TURBINE2.getIcon(), OVERLAY_SC_TURBINE3.getIcon(), OVERLAY_SC_TURBINE4.getIcon(), - OVERLAY_SC_TURBINE5.getIcon(), OVERLAY_SC_TURBINE6.getIcon(), OVERLAY_SC_TURBINE7.getIcon(), - OVERLAY_SC_TURBINE8.getIcon(), OVERLAY_SC_TURBINE9.getIcon(), }; - - public static IIcon[] OVERLAY_SC_TURBINE_ACTIVE = new IIcon[] { OVERLAY_SC_TURBINE1_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE2_ACTIVE.getIcon(), OVERLAY_SC_TURBINE3_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE4_ACTIVE.getIcon(), OVERLAY_SC_TURBINE5_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE6_ACTIVE.getIcon(), OVERLAY_SC_TURBINE7_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE8_ACTIVE.getIcon(), OVERLAY_SC_TURBINE9_ACTIVE.getIcon(), }; - public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final ForgeDirection side, final GregtechMetaSpecialMultiCasings i) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - // 0 shaft - // 1 LP - // 2 HP - // 3 Gas - // 4 Plasma - - IIcon[] mGetCurrentTextureSet = null; - IIcon[] mGetCurrentTextureSet_ACTIVE = null; - - if ((tMeta <= 0 || tMeta >= 5) && tMeta != 15) { - return GregtechMetaSpecialMultiCasings.getStaticIcon(side.ordinal(), (byte) tMeta); - } else { - if (tMeta == 1) { - mGetCurrentTextureSet = OVERLAY_LP_TURBINE; - mGetCurrentTextureSet_ACTIVE = OVERLAY_LP_TURBINE_ACTIVE; - } else if (tMeta == 2) { - mGetCurrentTextureSet = OVERLAY_HP_TURBINE; - mGetCurrentTextureSet_ACTIVE = OVERLAY_HP_TURBINE_ACTIVE; - } else if (tMeta == 3) { - mGetCurrentTextureSet = OVERLAY_GAS_TURBINE; - mGetCurrentTextureSet_ACTIVE = OVERLAY_GAS_TURBINE_ACTIVE; - } else if (tMeta == 4) { - mGetCurrentTextureSet = OVERLAY_PLASMA_TURBINE; - mGetCurrentTextureSet_ACTIVE = OVERLAY_PLASMA_TURBINE_ACTIVE; - } else { - mGetCurrentTextureSet = OVERLAY_SC_TURBINE; - mGetCurrentTextureSet_ACTIVE = OVERLAY_SC_TURBINE_ACTIVE; - } - if (mGetCurrentTextureSet == null || mGetCurrentTextureSet_ACTIVE == null) { - return GregtechMetaSpecialMultiCasings.getStaticIcon(side.ordinal(), (byte) tMeta); - } - - if ((side == ForgeDirection.NORTH) || (side == ForgeDirection.SOUTH)) { - TileEntity tTileEntity; - IMetaTileEntity tMetaTileEntity; - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[0]; - } - return mGetCurrentTextureSet[0]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[3]; - } - return mGetCurrentTextureSet[3]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[6]; - } - return mGetCurrentTextureSet[6]; - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[1]; - } - return mGetCurrentTextureSet[1]; - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[7]; - } - return mGetCurrentTextureSet[7]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[8]; - } - return mGetCurrentTextureSet[8]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[5]; - } - return mGetCurrentTextureSet[5]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[2]; - } - return mGetCurrentTextureSet[2]; - } - } else if ((side == ForgeDirection.WEST) || (side == ForgeDirection.EAST)) { - TileEntity tTileEntity; - Object tMetaTileEntity; - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[0]; - } - return mGetCurrentTextureSet[0]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[3]; - } - return mGetCurrentTextureSet[3]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[6]; - } - return mGetCurrentTextureSet[6]; - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[1]; - } - return mGetCurrentTextureSet[1]; - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[7]; - } - return mGetCurrentTextureSet[7]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[8]; - } - return mGetCurrentTextureSet[8]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[5]; - } - return mGetCurrentTextureSet[5]; - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof MTEHatchTurbine))) { - if (isUsingAnimatedTexture(tTileEntity)) { - return mGetCurrentTextureSet_ACTIVE[2]; - } - return mGetCurrentTextureSet[2]; - } - } - } return GregtechMetaSpecialMultiCasings.getStaticIcon(side.ordinal(), (byte) tMeta); } - public static boolean isUsingAnimatedTexture(TileEntity tTileEntity) { - boolean aVal = true; - if (tTileEntity instanceof IGregTechTileEntity aTile) { - final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); - if (aMetaTileEntity instanceof MTEHatchTurbine) { - aVal = aMetaTileEntity.getBaseMetaTileEntity() - .isActive(); - // Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); - } - } - return aVal; - } - - public static MTEHatchTurbine isTurbineHatch(final IGregTechTileEntity aTileEntity) { - if (aTileEntity != null) { - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof MTEHatchTurbine) { - return (MTEHatchTurbine) aMetaTileEntity; - } - } - return null; - } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java index 97167ca7986..af4fcc4598b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java @@ -161,11 +161,6 @@ public int maxProgresstime() { return 1000 + (250 * tier); } - @Override - public boolean isElectric() { - return false; - } - @Override public int getCapacity() { return (16000 + (16000 * tier)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java index 1983049c37c..ef7e29f49f4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java @@ -80,7 +80,7 @@ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @Override public String getMachineType() { - return "(Plasma/Electric) Arc Furnace"; + return "Arc Furnace, Plasma Arc Furnace"; } @Override @@ -88,7 +88,7 @@ protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); tt.addMachineType(getMachineType()) .addInfo("250% faster than using single block machines of the same voltage") - .addInfo("Processes 8 * voltage tier * W items") + .addInfo("Processes voltage tier * W items in Electric mode or 8 * voltage tier * W items in Plasma mode") .addInfo("Right-click controller with a Screwdriver to change modes") .addInfo("Max Size required to process Plasma recipes") .addPollutionAmount(getPollutionPerSecond(null)) @@ -250,7 +250,7 @@ protected ProcessingLogic createProcessingLogic() { @Override public int getMaxParallelRecipes() { - return (this.mSize * 8 * GTUtility.getTier(this.getMaxInputVoltage())); + return (this.mSize * (mPlasmaMode ? 8 : 1) * GTUtility.getTier(this.getMaxInputVoltage())); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java index 186a69f2df7..af68340722a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java @@ -10,12 +10,15 @@ import static gregtech.api.enums.HatchElement.Muffler; import static gregtech.api.enums.HatchElement.OutputBus; import static gregtech.api.enums.HatchElement.OutputHatch; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -30,6 +33,7 @@ import gregtech.api.logic.ProcessingLogic; import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTUtility; +import gregtech.api.util.GTUtilityClient; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.objects.Logger; @@ -48,6 +52,10 @@ public class MTEIndustrialCentrifuge extends GTPPMultiBlockBase STRUCTURE_DEFINITION = null; // public static double recipesComplete = 0; + // client side stuff + // mMachine got overwritten by StructureLib extended facing query response + // so we use a separate field for this + protected boolean mFormed; public MTEIndustrialCentrifuge(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -123,6 +131,18 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, env, false, true); } + @Override + public boolean checkStructure(boolean aForceReset, IGregTechTileEntity aBaseMetaTileEntity) { + boolean f = super.checkStructure(aForceReset, aBaseMetaTileEntity); + if (f && getBaseMetaTileEntity().isServerSide()) { + // while is this a client side field, blockrenderer will reuse the server world for client side rendering + // so we must set it as well... + mFormed = true; + return true; + } + return f; + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; @@ -132,15 +152,27 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a @Override protected IIconContainer getActiveOverlay() { if (usingAnimations()) { - return frontFaceActive; + return LARGETURBINE_NEW_ACTIVE5; } else { - return frontFace; + return getInactiveOverlay(); } } @Override protected IIconContainer getInactiveOverlay() { - return frontFace; + return LARGETURBINE_NEW5; + } + + @Override + public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + if (!mFormed) return false; + + IIconContainer[] tTextures; + if (getBaseMetaTileEntity().isActive() && usingAnimations()) tTextures = TURBINE_NEW_ACTIVE; + else tTextures = TURBINE_NEW; + GTUtilityClient + .renderTurbineOverlay(aWorld, aX, aY, aZ, aRenderer, getExtendedFacing(), getCasingBlock(), tTextures); + return false; } @Override @@ -223,4 +255,15 @@ public boolean usingAnimations() { // Logger.INFO("Is animated? "+this.mIsAnimated); return this.mIsAnimated; } + + @Override + public void onValueUpdate(byte aValue) { + mFormed = (aValue & 0x1) != 0; + + } + + @Override + public byte getUpdateData() { + return (byte) ((mMachine ? 1 : 0)); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java index 34384cbf8ad..0f1547e35e4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java @@ -58,7 +58,7 @@ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @Override public String getMachineType() { - return "Coke Oven"; + return "Coke Oven, ICO"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java index 11bfaaca7e2..0534de4b67d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java @@ -78,7 +78,7 @@ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @Override public String getMachineType() { - return "Cutting Machine / Slicing Machine"; + return "Cutting Machine, Slicing Machine"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java index d96530535bd..04e9b130cda 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java @@ -194,7 +194,7 @@ public int getPollutionPerSecond(ItemStack aStack) { @Override public String getMachineType() { - return "Vacuum Furnace / Dehydrator"; + return "Vacuum Furnace, Dehydrator"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java index d8d5dfacb7a..5b216dda70d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java @@ -16,6 +16,7 @@ import static gregtech.api.enums.Mods.ThaumicBases; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -156,6 +157,7 @@ public IStructureDefinition getStructureDefinition() { private static List> getAllAnvilTiers(Map anvilTiers) { return anvilTiers.entrySet() .stream() + .sorted(Comparator.comparingInt(Map.Entry::getValue)) .map(e -> Pair.of(e.getKey(), e.getValue())) .collect(Collectors.toList()); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java index 7b3301d6c87..ddb7a4ef8c2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java @@ -90,7 +90,7 @@ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @Override public String getMachineType() { - return "Macerator/Pulverizer"; + return "Macerator, Pulverizer"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java index 58e86b705b8..a2d19200ced 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java @@ -14,7 +14,9 @@ import net.minecraft.item.ItemStack; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.enums.SoundResource; @@ -30,7 +32,8 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class MTEAdvImplosionCompressor extends GTPPMultiBlockBase { +public class MTEAdvImplosionCompressor extends GTPPMultiBlockBase + implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition STRUCTURE_DEFINITION = null; @@ -86,7 +89,7 @@ public IStructureDefinition getStructureDefinition() ofChain( buildHatchAdder(MTEAdvImplosionCompressor.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(48) + .casingIndex(getCasingTextureId()) .dot(1) .build(), onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings4, 0)))) @@ -100,6 +103,12 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { buildPiece(mName, stackSize, hintsOnly, 1, 1, 0); } + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { + if (mMachine) return -1; + return survivialBuildPiece(mName, stackSize, 1, 1, 0, elementBudget, env, false, true); + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java index 8765866b681..8b592a1cc1e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java @@ -1,15 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlocksTiered; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.HatchElement.OutputHatch; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; -import static gregtech.api.util.GTStructureUtility.ofFrame; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -22,8 +23,10 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; +import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -76,8 +79,7 @@ public String getMachineType() { private static final int HORIZONTAL_OFF_SET = 1; private static final int VERTICAL_OFF_SET = 2; private static final int DEPTH_OFF_SET = 0; - private static final String tier1 = "tier1"; - private static final String tier2 = "tier2"; + private static final String STRUCTURE_PIECE_MAIN = "main"; // Base amount of water produced per second, before applying humidity and tier modifiers. private static final int BASE_WATER_PER_SECOND = 1_500; @@ -85,7 +87,7 @@ public String getMachineType() { private static final int BASE_STEAM_PER_SECOND = 1_500; - private int mSetTier = 1; + private int mSetTier = -1; private float currentHumidity; @@ -99,8 +101,7 @@ private FluidStack[] getWater() { private float getHumidity() { return this.getBaseMetaTileEntity() - .getWorld() - .getBiomeGenForCoords(getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()).rainfall; + .getBiome().rainfall; } private int calculateFinalWaterOutput() { @@ -113,23 +114,15 @@ public IStructureDefinition getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape( - tier1, + STRUCTURE_PIECE_MAIN, transpose( new String[][] { { " A ", " A ", "AAA", " A " }, { " A ", " ", "A A", " A " }, { "C~C", "CCC", "CCC", "CCC" } })) - .addShape( - tier2, - transpose( - new String[][] { - { " D ", " D ", "DDD", " D " }, - { " D ", " ", "D D", " D " }, - { "C~C", "CCC", "CCC", "CCC" } })) - .addElement('A', ofFrame(Materials.Bronze)) - .addElement('D', ofFrame(Materials.Steel)) + .addElement('A', ofBlocksTiered(MTESteamWaterPump::getFrameTier, ImmutableList.of(Pair.of(GregTechAPI.sBlockFrames, Materials.Bronze.mMetaItemSubID), + Pair.of(GregTechAPI.sBlockFrames, Materials.Steel.mMetaItemSubID)), -1, (pump, tier) -> pump.mSetTier = tier , pump -> pump.mSetTier)) .addElement( 'C', ofChain( @@ -151,59 +144,52 @@ public IStructureDefinition getStructureDefinition() { } // spotless:on + public static int getFrameTier(Block block, int meta) { + if (block == GregTechAPI.sBlockFrames) { + if (meta == Materials.Bronze.mMetaItemSubID) return 1; + if (meta == Materials.Steel.mMetaItemSubID) return 2; + } + return 0; + } + @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - if (stackSize.stackSize == 1) { - this.buildPiece(tier1, stackSize, hintsOnly, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET); - } else { - this.buildPiece(tier2, stackSize, hintsOnly, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET); - } + this.buildPiece( + STRUCTURE_PIECE_MAIN, + stackSize, + hintsOnly, + HORIZONTAL_OFF_SET, + VERTICAL_OFF_SET, + DEPTH_OFF_SET); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; - int built = 0; - if (stackSize.stackSize == 1) { - mSetTier = 1; - built += this.survivialBuildPiece( - tier1, - stackSize, - HORIZONTAL_OFF_SET, - VERTICAL_OFF_SET, - DEPTH_OFF_SET, - elementBudget, - env, - false, - true); - } else { - mSetTier = 2; - built += this.survivialBuildPiece( - tier2, - stackSize, - HORIZONTAL_OFF_SET, - VERTICAL_OFF_SET, - DEPTH_OFF_SET, - elementBudget, - env, - false, - true); - } - return built; + return this.survivialBuildPiece( + STRUCTURE_PIECE_MAIN, + stackSize, + HORIZONTAL_OFF_SET, + VERTICAL_OFF_SET, + DEPTH_OFF_SET, + elementBudget, + env, + false, + true); } public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCountCasing = 0; - mSetTier = 1; - if (!checkPiece(tier1, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET)) { - if (!checkPiece(tier2, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET)) return false; - mSetTier = 2; + mSetTier = -1; + + if (!checkPiece(STRUCTURE_PIECE_MAIN, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET)) { + return false; } if (this.mOutputHatches.size() != 1 || this.mSteamInputFluids.size() != 1) return false; currentHumidity = getHumidity(); - return mCountCasing >= 9; + return mCountCasing >= 9 && mSetTier > 0; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java index 3e9d0d55bcd..2dc288ccefd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java @@ -63,7 +63,7 @@ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @Override public String getMachineType() { - return "Fluid Alloy Cooker"; + return "Fluid Alloy Cooker, ABS"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java index 59a0d0e1fc2..e38764a46d3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java @@ -49,7 +49,7 @@ public MTEAutoCrafter(String mName) { @Override public String getMachineType() { - return "Assembler"; + return "Assembler, LSAA"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java index 3e6d1f397d9..d98e53e2da4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java @@ -222,6 +222,10 @@ protected boolean filtersFluid() { setModeFromInputStacks(tItemInputs); ItemStack[] mFishOutput = generateLoot(); + if (mFishOutput == null) { + return CheckRecipeResultRegistry.NO_RECIPE; + } + mFishOutput = removeNulls(mFishOutput); GTRecipe g = new GTRecipe( true, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java index d2aeee46834..e1d9b303c17 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java @@ -97,7 +97,7 @@ public MTEMassFabricator(final String aName) { @Override public String getMachineType() { - return "Mass Fabricator / Recycler"; + return "Mass Fabricator, Recycler"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java index fdb4b52c3b9..eb985938290 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java @@ -243,7 +243,7 @@ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Quantum Force Transformer") + tt.addMachineType("Quantum Force Transformer, QFT") .addInfo("Allows Complex chemical lines to be performed instantly in one step") .addInfo("Every recipe requires a catalyst, each catalyst adds 1 parallel and lasts forever") .addInfo("All inputs go on the bottom, all outputs go on the top") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java index c93caaffe9c..a9bf25f338e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java @@ -111,7 +111,7 @@ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @Override public String getMachineType() { - return "Tree Farm"; + return "Tree Farm, TGS"; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java index 63941f21399..eef957cd8ae 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java @@ -130,11 +130,17 @@ public String getMachineType() { @Override protected MultiblockTooltipBuilder createTooltip() { - MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType(getMachineType()) + return new MultiblockTooltipBuilder().addMachineType(getMachineType()) .addInfo("Heavy Industry, now right at your doorstep!") - .addInfo("Please read the user manual for more information on construction and usage") + .addInfo("Plant tier is determined by casing tier") + .addInfo("Hatch tiers can't be higher than machine casing tier, UHV casing unlocks all tiers") + .addInfo("Higher tier coils increases processing speed : T1 = 50%, T2 = 100%, T3 = 150%...") + .addInfo("Higher tier pipe casing boosts parallel and reduces catalyst consumption :") + .addInfo("+2 parallel per tier, +20% chance of not damaging catalyst per tier") + .addInfo("Any catalyst must be placed in the catalyst housing") + .addInfo("Awakened Draconium coils combined with Tungstensteel pipe casing makes catalyst unbreakable") .addController("Bottom Center") + .addOtherStructurePart("Catalyst Housing", "Bottom Casing") .addStructureHint("Catalyst Housing", 1) .addInputBus("Bottom Casing", 1) .addOutputBus("Bottom Casing", 1) @@ -147,7 +153,6 @@ protected MultiblockTooltipBuilder createTooltip() { .addSubChannelUsage("coil", "heating coil blocks") .addSubChannelUsage("pipe", "pipe casing blocks") .toolTipFinisher(); - return tt; } public void setMachineMeta(int meta) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java index 1f98e164b8d..9ad6c3d3f48 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java @@ -273,7 +273,7 @@ public IStructureDefinition getStructureDefinition() { @Override protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Fluid Alloy Cooker") + tt.addMachineType("Fluid Alloy Cooker, MABS") .addInfo( "Runs the same recipes as the normal ABS, except with up to " + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java index 1e44eb95c37..37e224df446 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineGas.java @@ -181,7 +181,7 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public String getMachineType() { - return "Large Gas Turbine"; + return "Large Gas Turbine, XLGT"; } @Override @@ -193,4 +193,9 @@ protected String getTurbineType() { protected String getCasingName() { return "Reinforced Gas Turbine Casing"; } + + @Override + protected boolean isDenseSteam() { + return false; + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSCSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSCSteam.java index fddacc56627..27384fdc30f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSCSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSCSteam.java @@ -9,7 +9,6 @@ import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; import gregtech.api.util.TurbineStatCalculator; import gtPlusPlus.core.lib.GTPPCore; @@ -118,7 +117,8 @@ long fluidIntoPower(ArrayList aFluids, TurbineStatCalculator turbine if (isUsingDenseSteam) { addOutput(Materials.DenseSuperheatedSteam.getGas((long) steamFlowForNextSteam)); } else { - addOutput(GTModHandler.getSteam(totalFlow * 100)); + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", totalFlow)); + } if (totalFlow != realOptFlow) { float efficiency = 1.0f - Math.abs((totalFlow - (float) realOptFlow) / (float) realOptFlow); @@ -132,10 +132,7 @@ long fluidIntoPower(ArrayList aFluids, TurbineStatCalculator turbine tEU = MathUtils .safeInt((long) (tEU * (looseFit ? turbine.getLooseSteamEfficiency() : turbine.getSteamEfficiency()))); } - if (isUsingDenseSteam) { - return tEU; - } - return tEU * 100L; + return tEU; } @Override @@ -145,7 +142,7 @@ public int getDamageToComponent(ItemStack aStack) { @Override public String getMachineType() { - return "Large Supercritical Steam Turbine"; + return "Large Supercritical Steam Turbine, XLSCT"; } @Override @@ -157,4 +154,9 @@ protected String getTurbineType() { protected String getCasingName() { return "Reinforced SC Turbine Casing"; } + + @Override + protected boolean isDenseSteam() { + return isUsingDenseSteam; + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java index 5fbcb237fd6..8f9a4fcee2a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSHSteam.java @@ -160,7 +160,7 @@ public int getDamageToComponent(ItemStack aStack) { @Override public String getMachineType() { - return "Large Super-heated Steam Turbine"; + return "Large Super-heated Steam Turbine, XLHPT"; } @Override @@ -172,4 +172,9 @@ protected String getTurbineType() { protected String getCasingName() { return "Reinforced HP Steam Turbine Casing"; } + + @Override + protected boolean isDenseSteam() { + return isUsingDenseSteam; + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java index 6445e2ad238..1bb3c4bcef2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargeTurbineSteam.java @@ -171,7 +171,7 @@ public int getDamageToComponent(ItemStack aStack) { @Override public String getMachineType() { - return "Large Steam Turbine"; + return "Large Steam Turbine, XLST"; } @Override @@ -183,4 +183,9 @@ protected String getTurbineType() { protected String getCasingName() { return "Reinforced Steam Turbine Casing"; } + + @Override + protected boolean isDenseSteam() { + return isUsingDenseSteam; + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java index e96493351eb..826bac7aa93 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java @@ -139,6 +139,8 @@ public MTELargerTurbineBase(String aName) { protected abstract String getCasingName(); + protected abstract boolean isDenseSteam(); + protected abstract boolean requiresOutputHatch(); @Override @@ -152,6 +154,8 @@ protected final MultiblockTooltipBuilder createTooltip() { if (getTurbineType().equals("Plasma")) { tt.addInfo("Plasma fuel efficiency is lower for high tier turbines when using low-grade plasmas") .addInfo("Efficiency = ((FuelValue / 200,000)^2) / (EU per Turbine)"); + } else if (getTurbineType().contains("Steam")) { + tt.addInfo("Dense types of steam are so energy packed, they only require 1/1000th of the original flow"); } tt.addTecTechHatchInfo(); tt.addPollutionAmount(getPollutionPerSecond(null)) @@ -192,6 +196,17 @@ public void clearHatches() { mTurbineRotorHatches.clear(); } + @Override + public boolean checkStructure(boolean aForceReset, IGregTechTileEntity aBaseMetaTileEntity) { + boolean f = super.checkStructure(aForceReset, aBaseMetaTileEntity); + if (f) { + for (MTEHatchTurbine tHatch : mTurbineRotorHatches) { + tHatch.sendUpdate(); + } + } + return f; + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { // we do not check for casing count here. the bare minimal is 372 but we only require 360 @@ -609,11 +624,12 @@ public String[] getExtraInfoData() { + GTUtility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GTUtility.formatNumbers(MathUtils.safeInt((long) realOptFlow)) + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW + // Divides optimal flow by 1000 if it's a dense steam + + GTUtility.formatNumbers(MathUtils.safeInt((long) realOptFlow) / (isDenseSteam() ? 1000 : 1)) + EnumChatFormatting.RESET - + " L/s" + + " L/" + + (getTurbineType().equals("Plasma") ? 's' : 't') // based on turbine type changes flow timing + EnumChatFormatting.YELLOW + " (" + (isLooseMode() ? StatCollector.translateToLocal("GT5U.turbine.loose") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java index 4f3626e7cdf..ec4accb7ad1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbinePlasma.java @@ -273,7 +273,7 @@ public int getDamageToComponent(ItemStack aStack) { @Override public String getMachineType() { - return "Large Plasma Turbine"; + return "Large Plasma Turbine, XLPT"; } @Override @@ -285,4 +285,9 @@ protected String getTurbineType() { protected String getCasingName() { return "Reinforced Plasma Turbine Casing"; } + + @Override + protected boolean isDenseSteam() { + return false; + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 0cbf255fa56..492cb11081e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -40,6 +40,7 @@ import com.gtnewhorizons.modularui.api.NumberFormatMUI; import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.forge.PlayerMainInvWrapper; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; @@ -113,7 +114,7 @@ public GregtechMetaTileEntity_PowerSubStationController(final String aName) { @Override public String getMachineType() { - return "Energy Buffer"; + return "Energy Buffer, PSS"; } @Override @@ -857,6 +858,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont ? getBaseMetaTileEntity().isActive() ? "Running perfectly" : "Turn on with Mallet" : "") .setSynced(false) + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setPos(10, 8)) .widget( @@ -876,17 +878,20 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .widget(new FakeSyncWidget.LongSyncer(this::getAverageEuAdded, val -> clientEUIn = val)) .widget( new TextWidget().setStringSupplier(() -> "Avg In: " + numberFormat.format(clientEUIn) + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setPos(10, 20)) .widget(new FakeSyncWidget.LongSyncer(this::getAverageEuConsumed, val -> clientEUOut = val)) .widget( new TextWidget().setStringSupplier(() -> "Avg Out: " + numberFormat.format(clientEUOut) + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setPos(10, 30)) .widget(new FakeSyncWidget.LongSyncer(this::computeEnergyTax, val -> clientEULoss = val)) .widget( new TextWidget() .setStringSupplier(() -> "Powerloss: " + numberFormat.format(clientEULoss) + " EU per tick") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setPos(10, 40)) .widget( @@ -902,6 +907,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .setSize(147, 5)) .widget( new TextWidget("Stored:").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setTextAlignment(Alignment.CenterLeft) .setPos(10, 132)) .widget( new FakeSyncWidget.LongSyncer(() -> getBaseMetaTileEntity().getStoredEU(), val -> clientEUStored = val)) @@ -910,6 +916,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont return new Text(numberFormat.format(clientEUStored) + " EU") .color(Utils.rgbtoHexValue((255 - colorScale), colorScale, 0)); }) + .setTextAlignment(Alignment.CenterLeft) .setPos(10, 142)) .widget( new TextWidget().setStringSupplier(() -> numberFormat.format(clientProgress * 100) + "%") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java index 465ca37b387..a9a29b3c37c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java @@ -11,8 +11,8 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSteamBusInput; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSteamBusOutput; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MteHatchSteamBusInput; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam.MTESteamCentrifuge; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam.MTESteamCompressor; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam.MTESteamForgeHammer; @@ -54,7 +54,7 @@ public static void run() { .getStackForm(1)); GregtechItemList.Hatch_Input_Bus_Steam.set( - new MteHatchSteamBusInput(Hatch_Input_Bus_Steam.ID, "hatch.input_bus.tier.steam", "Input Bus (Steam)", 0) + new MTEHatchSteamBusInput(Hatch_Input_Bus_Steam.ID, "hatch.input_bus.tier.steam", "Input Bus (Steam)", 0) .getStackForm(1L)); GregtechItemList.Hatch_Output_Bus_Steam.set( new MTEHatchSteamBusOutput( diff --git a/src/main/java/gtneioreplugin/GTNEIOrePlugin.java b/src/main/java/gtneioreplugin/GTNEIOrePlugin.java index 5c970fd032a..a5db5901692 100644 --- a/src/main/java/gtneioreplugin/GTNEIOrePlugin.java +++ b/src/main/java/gtneioreplugin/GTNEIOrePlugin.java @@ -2,8 +2,6 @@ import java.io.File; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; @@ -17,7 +15,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import gregtech.GT_Version; import gtneioreplugin.plugin.NEIPluginConfig; @@ -47,14 +44,6 @@ public class GTNEIOrePlugin { public static final String VERSION = GT_Version.VERSION; public static final Logger LOG = LogManager.getLogger(NAME); public static File instanceDir; - public static final CreativeTabs creativeTab = new CreativeTabs(MODID) { - - @Override - public Item getTabIconItem() { - return GameRegistry.makeItemStack("gregtech:gt.blockores", 386, 1, null) - .getItem(); - } - }; @Mod.Instance(MODID) public static GTNEIOrePlugin instance; diff --git a/src/main/java/gtneioreplugin/plugin/item/ItemDimensionDisplay.java b/src/main/java/gtneioreplugin/plugin/item/ItemDimensionDisplay.java index 39fdacda99d..9c7c7b06fe6 100644 --- a/src/main/java/gtneioreplugin/plugin/item/ItemDimensionDisplay.java +++ b/src/main/java/gtneioreplugin/plugin/item/ItemDimensionDisplay.java @@ -17,7 +17,6 @@ public class ItemDimensionDisplay extends ItemBlock { public ItemDimensionDisplay(Block block) { super(block); - setCreativeTab(GTNEIOrePlugin.creativeTab); if (FMLCommonHandler.instance() .getEffectiveSide() == Side.CLIENT) { diff --git a/src/main/java/gtnhlanth/common/beamline/BeamLinePacket.java b/src/main/java/gtnhlanth/common/beamline/BeamLinePacket.java index 7137c6ab7de..fb7bab1f1db 100644 --- a/src/main/java/gtnhlanth/common/beamline/BeamLinePacket.java +++ b/src/main/java/gtnhlanth/common/beamline/BeamLinePacket.java @@ -16,9 +16,7 @@ public BeamLinePacket(NBTTagCompound compound) { @Override protected BeamInformation contentFromNBT(NBTTagCompound nbt) { - /* - * NBTTagCompound compound = nbt.getCompoundTag("beamline"); - */ + return new BeamInformation( nbt.getFloat("energy"), nbt.getInteger("rate"), diff --git a/src/main/java/gtnhlanth/common/item/ItemPhotolithographicMask.java b/src/main/java/gtnhlanth/common/item/ItemPhotolithographicMask.java index 30cbac875ba..c96212c8e61 100644 --- a/src/main/java/gtnhlanth/common/item/ItemPhotolithographicMask.java +++ b/src/main/java/gtnhlanth/common/item/ItemPhotolithographicMask.java @@ -23,9 +23,6 @@ public ItemPhotolithographicMask(String name, int maxDamage, String descSpectrum this.setTextureName(Tags.MODID + ":photomask/" + name); } - /* - * @Override public String getUnlocalizedName() { return "item.photomask." + this.name; } - */ @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { @@ -33,6 +30,10 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool if (!this.descSpectrum.isEmpty()) list.add("Suitable for the " + this.descSpectrum + " segment of the electromagnetic spectrum and lower"); + if (this.getMaxDamage() > 0) // Not a precursor. + list.add("Max Uses: " + (this.getMaxDamage() + 1)); // maximum uses = max damage + 1 in general, as + // 0-durability masks still function + } public String getDescSpectrum() { diff --git a/src/main/java/gtnhlanth/common/item/MaskList.java b/src/main/java/gtnhlanth/common/item/MaskList.java index 594180da223..ea132ca3ee6 100644 --- a/src/main/java/gtnhlanth/common/item/MaskList.java +++ b/src/main/java/gtnhlanth/common/item/MaskList.java @@ -13,60 +13,94 @@ public enum MaskList { // Use Dyes._NULL to indicate a wafer's lack of a dedicated lens instead of null, if the wafer's mask is to be // generated // Ignore last argument if using all wafers - ERROR("error", "ERROR", 0, "", null, null, 0, 0, 0, 0, 0, null), - BLANK1("blank1", "T1 Blank", 0, "VISIBLE", null, null, 0, 0, 0, 0, 0, null), - BLANK2("blank2", "T2 Blank", 0, "UV", null, null, 0, 0, 0, 0, 0, null), - BLANK3("blank3", "T3 Blank", 0, "X-RAY", null, null, 0, 0, 0, 0, 0, null), + // tcTargetItem specifies the target item used for non-wafer mask+TC recipes, e.g. crystal chips, set to null for + // wafer masks + ERROR("error", "ERROR", 0, "", null, null, 0, 0, 0, 0, 0, null, null), + BLANK1("blank1", "T1 Blank", 0, "VISIBLE", null, null, 0, 0, 0, 0, 0, null, null), + BLANK2("blank2", "T2 Blank", 0, "UV", null, null, 0, 0, 0, 0, 0, null, null), + BLANK3("blank3", "T3 Blank", 0, "X-RAY", null, null, 0, 0, 0, 0, 0, null, null), + + CBLANK("cblank", "Crystal", 0, "X-RAY", null, null, 0, 0, 0, 0, 0, null, null), // Better at resolving smaller + // features, in theory + ILC("ilc", "Integrated Logic Circuit", 100, "", BLANK1, Dyes.dyeRed, TierEU.RECIPE_MV, 0.5e-3f, 4e-3f, 35, 1, - ItemList.Circuit_Wafer_ILC.get(1)), + ItemList.Circuit_Wafer_ILC.get(1), null), RAM("ram", "Random Access Memory", 200, "", BLANK1, Dyes.dyeCyan, TierEU.RECIPE_MV, 2e-3f, 4e-3f, 40, 2, - ItemList.Circuit_Wafer_Ram.get(1), ItemList.Circuit_Silicon_Wafer), + ItemList.Circuit_Wafer_Ram.get(1), null, ItemList.Circuit_Silicon_Wafer), NAND("nand", "NAND", 200, "", BLANK2, Dyes._NULL, TierEU.RECIPE_HV, 7e-3f, 12e-3f, 40, 1, - ItemList.Circuit_Wafer_NAND.get(1), ItemList.Circuit_Silicon_Wafer), // NAND uses only Ender Pearl lens, don't - // ask me why - NOR("nor", "NOR", 100, "", BLANK2, Dyes._NULL, TierEU.RECIPE_LuV, 8e-3f, 10e-3f, 40, 1, - ItemList.Circuit_Wafer_NOR.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), // Same as - // above, - // but with - // ender - // eye + ItemList.Circuit_Wafer_NAND.get(1), null, ItemList.Circuit_Silicon_Wafer), // NAND uses only Ender Pearl lens, + // don't + // ask me why + NOR("nor", "NOR", 100, "", BLANK2, Dyes._NULL, TierEU.RECIPE_HV, 8e-3f, 10e-3f, 40, 1, + ItemList.Circuit_Wafer_NOR.get(1), null, ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), // Same + // as + // above, + // but with + // ender + // eye CPU("cpu", "Central Processing Unit", 10, "", BLANK2, Dyes.dyeWhite, TierEU.RECIPE_MV, 6e-3f, 12e-3f, 45, 2, - ItemList.Circuit_Wafer_CPU.get(1)), + ItemList.Circuit_Wafer_CPU.get(1), null), + PrCPU("prcpu", "Prepared Central Processing Unit", 0, "", CPU, null, TierEU.RECIPE_EV, 0, 0, 0, 0, null, null), + SOC("soc", "SoC", 150, "", BLANK2, Dyes.dyeYellow, TierEU.RECIPE_EV, 3e-3f, 10e-3f, 45, 2, - ItemList.Circuit_Wafer_SoC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), + ItemList.Circuit_Wafer_SoC.get(1), null, ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), ASOC("asoc", "Advanced SoC", 120, "", BLANK2, Dyes.dyeGreen, TierEU.RECIPE_EV, 100e-3f, 200e-3f, 50, 2, - ItemList.Circuit_Wafer_SoC2.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), + ItemList.Circuit_Wafer_SoC2.get(1), null, ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), + PIC("pic", "Power IC", 100, "", BLANK2, Dyes.dyeBlue, TierEU.RECIPE_HV, 5e-3f, 10e-3f, 50, 4, - ItemList.Circuit_Wafer_PIC.get(1), ItemList.Circuit_Silicon_Wafer), - HPIC("hpic", "High Power IC", 80, "", BLANK3, null, TierEU.RECIPE_IV, 100e-3f, 200e-3f, 50, 6, - ItemList.Circuit_Wafer_HPIC.get(1), ItemList.Circuit_Silicon_Wafer), // Different, made in chemical reactor. - // Figure out something for - // this later? - NCPU("ncpu", "NanoCPU", 60, "", BLANK2, null, TierEU.RECIPE_EV, 5e-3f, 10e-3f, 50, 4, - ItemList.Circuit_Wafer_NanoCPU.get(1), ItemList.Circuit_Silicon_Wafer), // Same as above - QBIT("qbit", "QBit", 50, "", BLANK2, null, TierEU.RECIPE_EV, 3e-3f, 10e-3f, 50, 4, - ItemList.Circuit_Wafer_QuantumCPU.get(1), ItemList.Circuit_Silicon_Wafer), // ^ - UHPIC("uhpic", "Ultra High Power IC", 60, "", BLANK3, null, TierEU.RECIPE_LuV, 200e-3f, 400e-3f, 50, 8, - ItemList.Circuit_Wafer_UHPIC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), // You - // get - // the - // gist + ItemList.Circuit_Wafer_PIC.get(1), null, ItemList.Circuit_Silicon_Wafer), + PrPIC("prpic", "Prepared Power IC", 0, "", PIC, null, TierEU.RECIPE_IV, 0, 0, 0, 0, null, null), // Made in CR from + // PIC + + HPIC("hpic", "High Power IC", 80, "", PrPIC, Dyes.dyeBlue, TierEU.RECIPE_IV, 100e-3f, 200e-3f, 50, 6, + ItemList.Circuit_Wafer_HPIC.get(1), null, ItemList.Circuit_Silicon_Wafer), + PrHPIC("prhpic", "Prepared High Power IC", 0, "", HPIC, null, TierEU.RECIPE_LuV, 0, 0, 0, 0, null, null), // Made in + // CR from + // HPIC + + NCPU("ncpu", "NanoCPU", 60, "", PrCPU, Dyes.dyeWhite, TierEU.RECIPE_EV, 5e-3f, 10e-3f, 50, 4, + ItemList.Circuit_Wafer_NanoCPU.get(1), null, ItemList.Circuit_Silicon_Wafer), + PrNCPU("prncpu", "Prepared NanoCPU", 0, "", NCPU, null, TierEU.RECIPE_EV, 0, 0, 0, 0, null, null), + + QBIT("qbit", "QBit", 50, "", PrNCPU, Dyes.dyeWhite, TierEU.RECIPE_EV, 3e-3f, 10e-3f, 50, 4, + ItemList.Circuit_Wafer_QuantumCPU.get(1), null, ItemList.Circuit_Silicon_Wafer), // ^ + UHPIC("uhpic", "Ultra High Power IC", 60, "", PrHPIC, Dyes.dyeBlue, TierEU.RECIPE_LuV, 190e-3f, 400e-3f, 50, 8, + ItemList.Circuit_Wafer_UHPIC.get(1), null, ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), SSOC("ssoc", "Simple SoC", 150, "", BLANK1, Dyes.dyeOrange, TierEU.RECIPE_MV, 2e-3f, 4e-3f, 25, 1, - ItemList.Circuit_Wafer_Simple_SoC.get(1)), + ItemList.Circuit_Wafer_Simple_SoC.get(1), null), ULPIC("ulpic", "Ultra Low Power IC", 200, "", BLANK1, Dyes.dyeGreen, TierEU.RECIPE_LV, 2e-3f, 4e-3f, 30, 1, - ItemList.Circuit_Wafer_ULPIC.get(1)), // Can use green for this as well as asoc, given + ItemList.Circuit_Wafer_ULPIC.get(1), null), // Can use green for this as well as asoc, given // the latter uses a different base mask LPIC("lpic", "Low Power IC", 150, "", BLANK1, Dyes.dyeYellow, TierEU.RECIPE_MV, 2e-3f, 4e-3f, 30, 2, - ItemList.Circuit_Wafer_LPIC.get(1)), // Same as above, except for yellow - NPIC("npic", "Nano Power IC", 70, "", BLANK3, Dyes.dyeRed, TierEU.RECIPE_LuV, 1, 3000, 50, 4, - ItemList.Circuit_Wafer_NPIC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, + ItemList.Circuit_Wafer_LPIC.get(1), null), // Same as above, except for yellow + + NPIC("npic", "Nano Power IC", 70, "", BLANK2, Dyes.dyeRed, TierEU.RECIPE_LuV, 1, 4, 50, 4, + ItemList.Circuit_Wafer_NPIC.get(1), null, ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3), // Same - PPIC("ppic", "PPIC", 50, "", BLANK3, null, TierEU.RECIPE_ZPM, 1.5f, 10, 50, 6, ItemList.Circuit_Wafer_PPIC.get(1), - ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3), // CR - // recipe - QPIC("qpic", "QPIC", 50, "", BLANK3, Dyes.dyeBlue, TierEU.RECIPE_UV, 5, 9, 50, 6, - ItemList.Circuit_Wafer_QPIC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, - ItemList.Circuit_Silicon_Wafer3, ItemList.Circuit_Silicon_Wafer4); // Different base mask to PIC + PrNPIC("prnpic", "Prepared Nano Power IC", 0, "", NPIC, null, TierEU.RECIPE_ZPM, 0, 0, 0, 0, null, null), // Made in + // CR from + // NPIC + + PPIC("ppic", "PPIC", 50, "", PrNPIC, Dyes.dyeRed, TierEU.RECIPE_ZPM, 1.5f, 10, 50, 6, + ItemList.Circuit_Wafer_PPIC.get(1), null, ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, + ItemList.Circuit_Silicon_Wafer3), + + QPIC("qpic", "QPIC", 50, "", BLANK3, Dyes.dyeBlue, TierEU.RECIPE_UV, 3.2f, 9, 50, 6, + ItemList.Circuit_Wafer_QPIC.get(1), null, ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, + ItemList.Circuit_Silicon_Wafer3, ItemList.Circuit_Silicon_Wafer4), // Different base mask to PIC + + CCPU("ccpu", "Crystal Central Processing Unit", 100, "", CBLANK, Dyes.dyeGreen, 10_000, 1, 3, 50, 6, + ItemList.Circuit_Chip_CrystalCPU.get(1), ItemList.Circuit_Parts_Crystal_Chip_Elite.get(1)), // For producing + // Crystal CPUs from + // Engraved CCs + CSOC("csoc", "Crystal SoC", 100, "", CBLANK, Dyes.dyeBlue, 40_000, 2, 7, 50, 8, + ItemList.Circuit_Chip_CrystalSoC.get(1), ItemList.Circuit_Chip_CrystalCPU.get(1)), + ACC("acc", "Advanced Crystal Chip", 100, "", CBLANK, Dyes.dyeLime, 80_000, 3, 9, 55, 12, + ItemList.Circuit_Chip_CrystalSoC2.get(1), ItemList.Circuit_Chip_CrystalSoC.get(1)), + LCC("lcc", "Living Crystal Chip", 75, "", CBLANK, Dyes.dyeWhite, 160_000, 5, 12, 60, 16, + ItemList.Circuit_Parts_Crystal_Chip_Wetware.get(1), ItemList.Circuit_Chip_CrystalSoC2.get(1)) + + ; String name; String englishName; @@ -85,17 +119,19 @@ public enum MaskList { float minFocus; int baselineAmount; + ItemStack tcTargetItem; ItemStack producedItem; ItemList[] forbiddenWafers; - MaskList(String name, String englishName, int maxDamage, String spectrum, MaskList precursor, Dyes lensColour, + MaskList(String name, String englishName, int maxUses, String spectrum, MaskList precursor, Dyes lensColour, long engraverEUt, float minEnergy, float maxEnergy, float minFocus, int baselineAmount, ItemStack producedItem, - ItemList... forbiddenWafers) { + ItemStack tcTargetItem, ItemList... forbiddenWafers) { this.name = name; this.englishName = englishName; this.spectrum = spectrum; - this.maxDamage = maxDamage; + this.maxDamage = maxUses - 1; // 0-durability masks still function, so e.g. maxUses = 100 corresponds to + // durability levels 0-99 this.precursor = precursor; this.lensColour = lensColour; this.engraverEUt = engraverEUt; @@ -103,6 +139,7 @@ public enum MaskList { this.minEnergy = minEnergy; this.maxEnergy = maxEnergy; this.baselineAmount = baselineAmount; + this.tcTargetItem = tcTargetItem; this.producedItem = producedItem; this.forbiddenWafers = forbiddenWafers; } @@ -151,6 +188,10 @@ public int getBaselineAmount() { return this.baselineAmount; } + public ItemStack getTCTargetItem() { + return this.tcTargetItem; + } + public ItemStack getProducedItem() { return this.producedItem; } diff --git a/src/main/java/gtnhlanth/common/register/LanthItemList.java b/src/main/java/gtnhlanth/common/register/LanthItemList.java index 50069131d65..9c3cedc3426 100644 --- a/src/main/java/gtnhlanth/common/register/LanthItemList.java +++ b/src/main/java/gtnhlanth/common/register/LanthItemList.java @@ -7,7 +7,9 @@ import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTOreDictUnificator; import gtnhlanth.common.beamline.MTEBeamlinePipe; import gtnhlanth.common.block.BlockAntennaCasing; import gtnhlanth.common.block.BlockCasing; @@ -70,7 +72,6 @@ public final class LanthItemList { public static final Block COOLANT_DELIVERY_CASING = new BlockCasing("coolant_delivery"); - // public static final Block ANTENNA_CASING_T1 = new Casing("antenna_t1"); public static final Block ANTENNA_CASING_T1 = new BlockAntennaCasing(1); public static final Block ANTENNA_CASING_T2 = new BlockAntennaCasing(2); @@ -164,6 +165,14 @@ public static void registerTypical() { descSpectrum); GameRegistry.registerItem(maskItem, maskItem.getUnlocalizedName()); + if (!mask.getName() + .contains("blank")) { + GTOreDictUnificator.registerOre( + OrePrefixes.mask + mask.getName() + .toUpperCase(), + new ItemStack(maskItem)); + } + GTLanguageManager.addStringLocalization(maskItem.getUnlocalizedName() + ".name", "Mask (" + english + ")"); maskMap.put(mask, maskItem); diff --git a/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java b/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java index 125f0f283fe..7000bf86ec4 100644 --- a/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java +++ b/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java @@ -1034,7 +1034,8 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.GenerationFeatures().disable() .onlyDust() .addMolten() - .addMetalItems(), + .addMetalItems() + .addMetalCraftingSolidifierRecipes(), offsetID3 + 12, TextureSet.SET_DULL); @@ -1945,7 +1946,7 @@ public class WerkstoffMaterialPool implements Runnable { new short[] { 0, 0, 0 }, "Reactive-Ion Etching Mixture", subscriptNumbers("CHF3/O2"), - new Werkstoff.Stats().setCentrifuge(true), + new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable() .addCells(), @@ -2015,14 +2016,22 @@ public class WerkstoffMaterialPool implements Runnable { offsetID3b + 10, TextureSet.SET_FLUID); + public static final Werkstoff HotSuperCoolant = new Werkstoff( + new short[] { 155, 17, 30 }, + "Hot Super Coolant", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + offsetID3b + 11, + TextureSet.SET_FLUID); + public static void runInit() { addSubTags(); } private static void addSubTags() { - // WerkstoffMaterialPool.PTMEGElastomer.add(SubTag.BOUNCY, SubTag.STRETCHY); - } @Override diff --git a/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java b/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java index 7ae15db3aa3..8fb3a54e921 100644 --- a/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java +++ b/src/main/java/gtnhlanth/common/tileentity/MTELINAC.java @@ -195,7 +195,8 @@ protected MultiblockTooltipBuilder createTooltip() { } - tt.addInfo("Requires (length + 1)kL/s of coolant") + tt.addInfo("Requires (length)kL/s of coolant") + .addSeparator() .beginVariableStructureBlock(7, 7, 7, 7, 19, 83, false) .addController("Front bottom") .addCasingInfoRange(LanthItemList.SHIELDED_ACCELERATOR_CASING.getLocalizedName(), 325, 1285, false) @@ -283,7 +284,8 @@ public boolean checkRecipe(ItemStack itemStack) { FluidStack primFluid = tFluidInputs.get(0); // 1b (1000L)/m/operation - final int fluidConsumed = 1000 * length; + final int fluidConsumed = 1000 * (length + 1); // length variable is technically physical length - 1, adding + // here so as to not affect existing math this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -307,8 +309,11 @@ public boolean checkRecipe(ItemStack itemStack) { } mMaxProgresstime = 1 * TickTime.SECOND; + // Consume the input tier's corresponding practical voltage instead of the maximum suggested by the logic - mEUt = (int) -GTValues.VP[(int) this.getInputVoltageTier()]; + // 1A if one energy hatch, 4A if two + mEUt = (int) ((this.mEnergyHatches.size() == 1) ? -GTValues.VP[(int) this.getInputVoltageTier()] + : (int) (-this.getMaxInputAmps() * GTValues.VP[(int) this.getInputVoltageTier()])); // Particle stays the same with this multiblock outputParticle = particleId; @@ -336,10 +341,8 @@ public boolean checkRecipe(ItemStack itemStack) { : inputFocus * (machineFocus / 100); // If input focus > machine focus, take the average of both, else // weigh the former by the latter - long voltage = this.getMaxInputVoltage(); - // voltageFactor = calculateVoltageFactor(voltage); - - // machineEnergy = Math.max(-((60) / this.length) * voltageFactor + 60_000, 2000); // Minimum of 2000keV + // 1A of full power if one energy hatch, 4A if two + long voltage = (this.mEnergyHatches.size() == 1) ? this.getMaxInputVoltage() : this.getMaxInputPower(); machineEnergy = (float) Math.max(length / 4 * Math.pow(voltage, 1.0 / 3.0), 50); // Minimum of 50keV @@ -347,13 +350,6 @@ public boolean checkRecipe(ItemStack itemStack) { .getEnergy(); inputEnergy = Math.min(inputEnergy, 7500); // Does not scale past 7500 keV, prevents double LINAC issue - /* - * outputEnergy = Math.min( - * (1 + inputEnergy / Particle.getParticleFromId(outputParticle) - * .maxSourceEnergy()) * machineEnergy, - * 120_000); // TODO more complex calculation than just - * // addition - */ outputEnergy = (float) Math.pow( 10, @@ -408,7 +404,6 @@ private void outputAfterRecipe() { @Override public void stopMachine() { - // GTLog.out.print("Machine stopped"); outputFocus = 0; outputEnergy = 0; outputParticle = 0; @@ -445,6 +440,10 @@ public String[] getInfoData() { BeamInformation information = this.getInputInformation(); + if (information == null) { + information = new BeamInformation(0, 0, 0, 0); + } + return new String[] { /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN @@ -473,7 +472,9 @@ public String[] getInfoData() { + EnumChatFormatting.YELLOW + GTUtility.formatNumbers(getMaxInputVoltage()) + EnumChatFormatting.RESET - + " EU/t(*2A) " + + " EU/t(*" + + getMaxInputAmps() + + "A)" + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW @@ -503,7 +504,7 @@ public String[] getInfoData() { StatCollector.translateToLocal("beamline.coolusage") + ": " // Coolant usage: + EnumChatFormatting.AQUA - + length + + (length + 1) + EnumChatFormatting.RESET + " kL/s", // e.g. "24 kL/s @@ -558,7 +559,6 @@ private BeamInformation getInputInformation() { // Will it matter? No :boubs_glasses: if (in.q == null) return new BeamInformation(0, 0, 0, 0); - // if (in.q == null) return new BeamInformation(10000, 10, 0, 90); // temporary for testing purposes return in.q.getContent(); } @@ -569,13 +569,6 @@ private static float calculateTemperatureFactor(int fluidTemp) { return (float) Math.pow(1.1, 0.2 * fluidTemp); } - /* - * private static float calculateVoltageFactor(long voltage) { - * float factor = (float) Math.pow(1.00009, -(0.1 * voltage - 114000)); - * return factor; - * } - */ - @Override public String[] getStructureDescription(ItemStack arg0) { return DescTextLocalization.addText("LINAC.hint", 11); @@ -612,8 +605,6 @@ public boolean checkMachine(IGregTechTileEntity mte, ItemStack stack) { length += 2; } - // if (!checkPiece(STRUCTURE_PIECE_END, 3, 6, -length)) return false; - // Likely off by one or two, not visible to player however so doesn't particularly matter length += 8; @@ -635,9 +626,6 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { } for (int i = -8; i > -lLength - 1; i -= 2) { - - // GTLog.out.print("Building inner piece! i = " + i); - buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 3, 6, i); } diff --git a/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java b/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java index 8fb94d505c9..5c69bae5a8f 100644 --- a/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java +++ b/src/main/java/gtnhlanth/common/tileentity/MTESourceChamber.java @@ -154,15 +154,10 @@ private boolean addBeamLineOutputHatch(IGregTechTileEntity te, int casingIndex) return false; } - /* - * protected OverclockDescriber createOverclockDescriber() { return new EUNoTotalOverclockDescriber((byte) 4, 1); } - */ @Override public boolean checkRecipe(ItemStack itemStack) { - // GTLog.out.print("In checkRecipe"); - // No input particle, so no input quantities outputFocus = 0; @@ -172,7 +167,7 @@ public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tItems = this.getStoredInputs() .toArray(new ItemStack[0]); - // GTLog.out.print(Arrays.toString(tItems)); + long tVoltageMaxTier = this.getMaxInputVoltage(); // Used to keep old math the same long tVoltageActual = GTValues.VP[(int) this.getInputVoltageTier()]; diff --git a/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java b/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java index dfecdcd71e4..2d8f0c2f08f 100644 --- a/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java +++ b/src/main/java/gtnhlanth/common/tileentity/MTESynchrotron.java @@ -4,6 +4,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; import static gregtech.api.enums.GTValues.VN; import static gregtech.api.enums.HatchElement.Energy; +import static gregtech.api.enums.HatchElement.ExoticEnergy; import static gregtech.api.enums.HatchElement.InputHatch; import static gregtech.api.enums.HatchElement.Maintenance; import static gregtech.api.enums.HatchElement.OutputHatch; @@ -40,9 +41,11 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.MTEEnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.MTEExtendedPowerMultiBlockBase; +import gregtech.api.metatileentity.implementations.MTEHatch; import gregtech.api.metatileentity.implementations.MTEHatchEnergy; import gregtech.api.render.TextureFactory; +import gregtech.api.util.ExoticEnergyInputHelper; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.shutdown.ShutDownReason; @@ -58,7 +61,7 @@ import gtnhlanth.util.DescTextLocalization; import gtnhlanth.util.Util; -public class MTESynchrotron extends MTEEnhancedMultiBlockBase implements ISurvivalConstructable { +public class MTESynchrotron extends MTEExtendedPowerMultiBlockBase implements ISurvivalConstructable { private static final IStructureDefinition STRUCTURE_DEFINITION; @@ -79,6 +82,8 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase im private int energyHatchTier; + private boolean usingExotic = false; + private int antennaeTier; private Byte glassTier; @@ -440,7 +445,9 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase im ).addElement('c', ofBlock(LanthItemList.SHIELDED_ACCELERATOR_CASING, 0)) .addElement('k', ofBlock(GregTechAPI.sBlockCasings1, 15)) // Superconducting coils .addElement('d', ofBlock(LanthItemList.COOLANT_DELIVERY_CASING, 0)) - .addElement('e', buildHatchAdder(MTESynchrotron.class).atLeast(ImmutableMap.of(Energy, 4)).dot(6).casingIndex(CASING_INDEX).build()) + + // Adder overriden due to ExoticEnergy originally calling its own adder, giving false positives + .addElement('e', buildHatchAdder(MTESynchrotron.class).atLeast(ImmutableMap.of(Energy.or(ExoticEnergy), 4)).adder(MTESynchrotron::addEnergyInputToMachineList).dot(6).casingIndex(CASING_INDEX).build()) .addElement('n', ofBlock(LanthItemList.NIOBIUM_CAVITY_CASING, 0)) .addElement('a', ofBlockAdder(MTESynchrotron::addAntenna, LanthItemList.ANTENNA_CASING_T1, 0)) //Antenna Casings .addElement('i', buildHatchAdder(MTESynchrotron.class).atLeast(ImmutableMap.of(InputHatch, 2)).dot(4).casingIndex(CASING_INDEX).build()) @@ -475,6 +482,8 @@ public class MTESynchrotron extends MTEEnhancedMultiBlockBase im private int machineTemp; + private long energyHatchAmperage; + public MTESynchrotron(String aName) { super(aName); } @@ -620,19 +629,64 @@ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof MTEHatchEnergy hatch) { - // First energy hatch added - if (this.mEnergyHatches.isEmpty()) this.energyHatchTier = hatch.mTier; + boolean firstHatch = false; + if (this.mEnergyHatches.isEmpty() && this.mExoticEnergyHatches.isEmpty()) firstHatch = true; + + if (aMetaTileEntity instanceof MTEHatch hatch) { + + if (firstHatch) { + + this.energyHatchTier = hatch.mTier; + this.energyHatchAmperage = hatch.maxWorkingAmperesIn(); + + } // Disallow any hatches that don't match the tier of the first hatch added if (hatch.mTier != this.energyHatchTier) return false; - hatch.updateTexture(aBaseCasingIndex); - hatch.updateCraftingIcon(this.getMachineCraftingIcon()); - return mEnergyHatches.add(hatch); + if (hatch.maxWorkingAmperesIn() != this.energyHatchAmperage) // Prevent mixing amperages within a tier + return false; + + if (aMetaTileEntity instanceof MTEHatchEnergy hatchNormal) { + + if (usingExotic) // usingExotic defaults to false, only set when known to be using exotics + return false; // If exotics are already being used, disallow non-exotics + + hatchNormal.updateTexture(aBaseCasingIndex); + hatchNormal.updateCraftingIcon(this.getMachineCraftingIcon()); + return mEnergyHatches.add(hatchNormal); + + } else if (aMetaTileEntity instanceof MTEHatch hatchExotic + && ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) { + + if (firstHatch) usingExotic = true; + + if (!usingExotic) return false; // If normal hatches are already being used, disallow exotics + + hatchExotic.updateTexture(aBaseCasingIndex); + hatchExotic.updateCraftingIcon(this.getMachineCraftingIcon()); + return mExoticEnergyHatches.add(hatchExotic); + + } else { + return false; // Not an energy hatch + } + } else { + return false; // Not a hatch of any kind } - return false; + + /* + * if (aMetaTileEntity instanceof MTEHatchEnergy hatch) { + * // First energy hatch added + * if (this.mEnergyHatches.isEmpty()) this.energyHatchTier = hatch.mTier; + * // Disallow any hatches that don't match the tier of the first hatch added + * if (hatch.mTier != this.energyHatchTier) return false; + * hatch.updateTexture(aBaseCasingIndex); + * hatch.updateCraftingIcon(this.getMachineCraftingIcon()); + * return mEnergyHatches.add(hatch); + * } + * return false; + */ } private boolean addAntenna(Block block, int meta) { @@ -715,9 +769,11 @@ public boolean checkRecipe(ItemStack aStack) { mMaxProgresstime = TickTime.SECOND; - long voltage = this.getMaxInputVoltage(); - mEUt = (int) (-voltage / GTValues.V[(int) this.getInputVoltageTier()] - * GTValues.VP[(int) this.getInputVoltageTier()]); // Multiply VP by amps + long voltage = 0; + + voltage = this.getMaxInputEu(); + + lEUt = -GTValues.VP[GTUtility.getTier(this.getAverageInputVoltage())] * this.getMaxInputAmps(); outputParticle = 1; // Photon @@ -766,7 +822,7 @@ public boolean checkRecipe(ItemStack aStack) { outputRate = (int) (inputRate * getOutputRatetio(voltageFactor, this.antennaeTier)); if (outputRate == 0) { - stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.low_input_rate")); + stopMachine(SimpleShutDownReason.ofCritical("gtnhlanth.low_input_eut")); return false; } @@ -841,7 +897,6 @@ private BeamInformation getInputInformation() { for (MTEHatchInputBeamline in : this.mInputBeamline) { if (in.q == null) return new BeamInformation(0, 0, 0, 0); - // if (in.q == null) return new BeamInformation(10000, 10, 0, 90); // TODO temporary for testing purposes return in.q.getContent(); } @@ -857,10 +912,6 @@ private static float getVoltageFactor(long mEU, int antennaTier) { return (float) (Math.sqrt(mEU) / 1500); } - /* - * private static float getTemperatureFactor(int temperature) { float factor = (float) Math.pow(1.11, 0.18 * - * temperature); return factor; } - */ private static double calculateOutputParticleEnergy(long voltage, double inputParticleEnergy, int antennaTier) { /* @@ -905,17 +956,19 @@ public String[] getInfoData() { long storedEnergy = 0; long maxEnergy = 0; - for (MTEHatchEnergy tHatch : mEnergyHatches) { - if (tHatch.isValid()) { - storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); - } + for (MTEHatch tHatch : getExoticAndNormalEnergyHatchList()) { + storedEnergy += tHatch.getBaseMetaTileEntity() + .getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity() + .getEUCapacity(); } BeamInformation information = this.getInputInformation(); + if (information == null) { + information = new BeamInformation(0, 0, 0, 0); + } + return new String[] { /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN @@ -942,13 +995,15 @@ public String[] getInfoData() { + " EU/t", /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW - + GTUtility.formatNumbers(getMaxInputVoltage()) + + GTUtility.formatNumbers(getAverageInputVoltage()) + EnumChatFormatting.RESET - + " EU/t(*2A) " + + " EU/t(*" + + getMaxInputAmps() + + "A)" + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW - + VN[GTUtility.getTier(getMaxInputVoltage())] + + VN[GTUtility.getTier(getAverageInputVoltage())] + EnumChatFormatting.RESET, /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED @@ -1035,7 +1090,11 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a this.mAntennaCasings.clear(); this.mEnergyHatches.clear(); + this.mExoticEnergyHatches.clear(); this.energyHatchTier = 0; + this.energyHatchAmperage = 0; + this.usingExotic = false; + this.antennaeTier = 0; this.glassTier = 0; @@ -1050,7 +1109,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a return this.mInputBeamline.size() == 1 && this.mOutputBeamline.size() == 1 && this.mMaintenanceHatches.size() == 1 - && this.mEnergyHatches.size() == 4 + && (this.mEnergyHatches.size() == 4 || this.mExoticEnergyHatches.size() == 4) && this.glassTier >= MIN_GLASS_TIER; } diff --git a/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java b/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java index ffc16fddf04..988bf1fd5c6 100644 --- a/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java +++ b/src/main/java/gtnhlanth/common/tileentity/MTETargetChamber.java @@ -272,15 +272,7 @@ public boolean checkRecipe(ItemStack itemStack) { }) .find(); - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, new FluidStack[] {}, tItemsWithFocusItemArray)) - return false; - - if (tRecipe.focusItem != null) { - if (tRecipe.focusItem.getItem() != tFocusItem.getItem()) return false; - } - - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; + if (tRecipe == null) return false; BeamInformation inputInfo = this.getInputInformation(); @@ -297,23 +289,72 @@ public boolean checkRecipe(ItemStack itemStack) { if (inputParticle != tRecipe.particleId) return false; - this.mMaxProgresstime = Math.max(Math.round((tRecipe.amount / inputRate * 5 * TickTime.SECOND)), 1); // 5 - // seconds - // per + if (tRecipe.focusItem != null) { + if (tRecipe.focusItem.getItem() != tFocusItem.getItem()) return false; + } + + int focusDurabilityDepletion = 1; + + float progressTime = tRecipe.amount / inputRate * 5 * TickTime.SECOND; + + int batchAmount = 1; + + if (progressTime < 1) { // Subticking + + batchAmount = (int) Math.round(1.0 / progressTime); + + if (tRecipe.focusItem != null) { + int maskLimit = tFocusItem.getMaxDamage() - tFocusItem.getItemDamage() + 1; + + if (batchAmount > maskLimit) batchAmount = maskLimit; // Limited by mask durability first, if it's + // present in recipe. Assume mask is present in + // machine from above condition + } + + progressTime = 1; + } + + this.mMaxProgresstime = (int) progressTime; // 5 + // seconds + // per // integer multiple // over the rate. E.g., 100a, 10r // would equal 50 seconds + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; + double maxParallel = tRecipe + .maxParallelCalculatedByInputs(batchAmount, new FluidStack[] {}, tItemsWithFocusItemArray); + + if (maxParallel < 1) // Insufficient items + return false; + + if (batchAmount > maxParallel) batchAmount = (int) maxParallel; + + tRecipe.consumeInput(batchAmount, new FluidStack[] {}, tItemsWithFocusItemArray); + + focusDurabilityDepletion = batchAmount; + + ItemStack[] itemOutputArray = GTUtility.copyItemArray(tRecipe.mOutputs); + + for (ItemStack stack : itemOutputArray) { + + stack.stackSize *= batchAmount; + + } + + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + mEUt = (int) -tVoltage; if (this.mEUt > 0) this.mEUt = (-this.mEUt); - this.mOutputItems = tRecipe.mOutputs; + this.mOutputItems = itemOutputArray; if (tRecipe.focusItem != null) // Recipe actually uses the mask, can also assume machine mask item is nonnull // due to above conditions mInputFocus.get(0) - .depleteFocusDurability(1); + .depleteFocusDurability(focusDurabilityDepletion); this.updateSlots(); @@ -325,9 +366,6 @@ private BeamInformation getInputInformation() { for (MTEHatchInputBeamline in : this.mInputBeamline) { if (in.q == null) return new BeamInformation(0, 0, 0, 0); - // if (in.q == null) return new BeamInformation(10, 10, Particle.PHOTON.ordinal(), 90); // temporary - // for - // testing purposes return in.q.getContent(); } @@ -337,6 +375,10 @@ private BeamInformation getInputInformation() { private ItemStack getFocusItemStack() { for (MTEBusInputFocus hatch : this.mInputFocus) { + + if (hatch.getContentUsageSlots() + .isEmpty()) return null; + return hatch.getContentUsageSlots() .get(0); } @@ -400,6 +442,10 @@ public String[] getInfoData() { BeamInformation information = this.getInputInformation(); + if (information == null) { + information = new BeamInformation(0, 0, 0, 0); + } + return new String[] { /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN diff --git a/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java b/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java index d71b9a571ee..7f9ac3e2284 100644 --- a/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java +++ b/src/main/java/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java @@ -3,7 +3,6 @@ import java.util.Arrays; import java.util.HashMap; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -11,6 +10,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; import gtPlusPlus.core.material.MaterialsElements; @@ -50,7 +50,7 @@ public static void load() { Materials.SuperCoolant.getFluid(1L) .getFluid() .getName(), - Materials.Water.getFluid(1L) + WerkstoffMaterialPool.HotSuperCoolant.getFluidOrGas(1000) .getFluid()); /* @@ -111,83 +111,73 @@ public static void load() { if (mask.getProducedItem() == null) // Blank or error continue; - int index = 0; - for (ItemList wafer : VIABLE_WAFERS) { - - index++; - - if (!Arrays.asList(mask.getForbiddenWafers()) - .contains(wafer)) { - - BeamlineRecipeAdder2.instance.addTargetChamberRecipe( - wafer.get(1), - GTUtility.copyAmountUnsafe((int) Math.pow(2, index + 2), mask.getProducedItem()), - new ItemStack(LanthItemList.maskMap.get(mask), 0), - 1, - mask.getBaselineAmount() * (int) Math.pow(Math.sqrt(3), index - 1), // 3x recipe amount increase - // per 2 increases in wafer - // tier. This greatly - // incentivises the use of - // higher tier boule wafer - // recipes - mask.getMinEnergy(), - mask.getMaxEnergy(), - mask.getMinFocus(), - 1, - 1920); + if (mask.getTCTargetItem() == null) { // Wafer TC recipe + + int index = 0; + for (ItemList wafer : VIABLE_WAFERS) { + + index++; + + if (!Arrays.asList(mask.getForbiddenWafers()) + .contains(wafer)) { + + BeamlineRecipeAdder2.instance.addTargetChamberRecipe( + wafer.get(1), + GTUtility.copyAmountUnsafe((int) Math.pow(2, index + 2), mask.getProducedItem()), + new ItemStack(LanthItemList.maskMap.get(mask), 0), + 1, + (int) Math.round(mask.getBaselineAmount() * Math.pow(Math.sqrt(2), index - 1)), // 2x recipe + // amount + // increase + // per 2 increases in wafer + // tier. This greatly + // incentivises the use of + // higher tier boule wafer + // recipes + mask.getMinEnergy(), + mask.getMaxEnergy(), + mask.getMinFocus(), + 1, + 1920); + + } } + continue; + } - /* - * if (!Arrays.asList(MaskList.CPU.getForbiddenWafers()).contains(wafer)) { - * BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1), GT_Utility.copyAmountUnsafe((int) - * Math.pow(2, index + 2), ItemList.Circuit_Wafer_CPU.get(1)), //Varies new - * ItemStack(LanthItemList.maskMap.get(MaskList.CPU), 0), // Varies 0, 10 * (int) Math.pow(2, index - 1), // - * Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); } /* PPIC - */ - - /* - * if (!Arrays.asList(MaskList.PPIC.getForbiddenWafers()).contains(wafer)) { - * GTLog.out.print("Adding recipe for PPIC with " + wafer.get(1).getUnlocalizedName() + " amount: " + 40 * - * (int) Math.pow(2, index - 1)); BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1), - * ItemList.Circuit_Wafer_PPIC.get((int) Math.pow(2, index + 2)), //Varies new - * ItemStack(LanthItemList.maskMap.get(MaskList.PPIC), 0), // Varies 0, 40 * (int) Math.pow(2, index - 1), - * // Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); } - */ + // Non-wafer recipes + + BeamlineRecipeAdder2.instance.addTargetChamberRecipe( + GTUtility.copyAmountUnsafe(1, mask.getTCTargetItem()), + GTUtility.copyAmountUnsafe(4, mask.getProducedItem()), + new ItemStack(LanthItemList.maskMap.get(mask), 0), + 1, + mask.getBaselineAmount(), + mask.getMinEnergy(), + mask.getMaxEnergy(), + mask.getMinFocus(), + 1, + (int) TierEU.RECIPE_LuV); } - /* - * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new - * ItemStack(Items.diamond, 1), null, 1, 20, 100, 1000, 60, 1, 1920); - * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new - * ItemStack(Items.cooked_chicken, 1), null, 1, 20, 1, 10, 60, 1, 1920); - */ - BeamlineRecipeAdder2.instance.addTargetChamberRecipe( - new ItemStack(Items.chicken, 1), - new ItemStack(Items.cooked_chicken), - null, - Particle.PHOTON.ordinal(), - 400, - 5, - 20, - 80, - 1, - 7864320); + /* LuAG */ + + // Raw Advanced Crystal Chip BeamlineRecipeAdder2.instance.addTargetChamberRecipe( - new ItemStack(Items.chicken, 1), - new ItemStack(Items.egg), - null, - Particle.PHOTON.ordinal(), - 400, - 21, - 600, - 80, + WerkstoffMaterialPool.CeriumDopedLutetiumAluminiumGarnet.get(OrePrefixes.gemExquisite, 1), + GTUtility.copyAmountUnsafe(64, ItemList.Circuit_Chip_CrystalSoC.get(1)), + new ItemStack(LanthItemList.maskMap.get(MaskList.CSOC), 0), 1, - 7864320); - + 24, + 5, + 12, + 60, + 1, + (int) TierEU.RECIPE_LuV); } } diff --git a/src/main/java/gtnhlanth/loader/RecipeLoader.java b/src/main/java/gtnhlanth/loader/RecipeLoader.java index 91800b6a68a..e26a318bc20 100644 --- a/src/main/java/gtnhlanth/loader/RecipeLoader.java +++ b/src/main/java/gtnhlanth/loader/RecipeLoader.java @@ -147,6 +147,7 @@ import gregtech.api.util.GTRecipeConstants; import gregtech.api.util.GTUtility; import gregtech.mixin.interfaces.accessors.IRecipeMutableAccess; +import gtPlusPlus.core.item.ModItems; import gtnhlanth.Tags; import gtnhlanth.common.item.MaskList; import gtnhlanth.common.register.BotWerkstoffMaterialPool; @@ -170,7 +171,7 @@ public static void loadAccelerator() { ItemList.Conveyor_Module_LuV.get(4), GTUtility.copyAmount(2, LanthItemList.BEAMLINE_PIPE), GTOreDictUnificator.get(OrePrefixes.cableGt04, Materials.VanadiumGallium, 2), - GTUtility.getIntegratedCircuit(16) + GTUtility.getIntegratedCircuit(15) ) .itemOutputs(LanthItemList.SOURCE_CHAMBER) @@ -189,7 +190,7 @@ public static void loadAccelerator() { ItemList.Electric_Pump_LuV.get(2), GTUtility.copyAmount(2, LanthItemList.BEAMLINE_PIPE), GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.VanadiumGallium, 2), - GTUtility.getIntegratedCircuit(16) + GTUtility.getIntegratedCircuit(15) ) .itemOutputs(LanthItemList.LINAC) @@ -208,7 +209,7 @@ public static void loadAccelerator() { GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UV, 2), GTUtility.copyAmount(2, LanthItemList.BEAMLINE_PIPE), GTOreDictUnificator.get(OrePrefixes.cableGt02, Materials.VanadiumGallium, 1), - GTUtility.getIntegratedCircuit(16) + GTUtility.getIntegratedCircuit(15) ) .itemOutputs(LanthItemList.TARGET_CHAMBER) @@ -227,7 +228,7 @@ public static void loadAccelerator() { GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UV, 8), GTUtility.copyAmount(8, LanthItemList.BEAMLINE_PIPE), GTOreDictUnificator.get(OrePrefixes.cableGt08, Materials.NiobiumTitanium, 8), - GTUtility.getIntegratedCircuit(16)) + GTUtility.getIntegratedCircuit(15)) .itemOutputs(LanthItemList.SYNCHROTRON) .duration(60 * GTRecipeBuilder.SECONDS) .eut(TierEU.RECIPE_ZPM) @@ -566,6 +567,15 @@ public static void loadAccelerator() { .eut(TierEU.RECIPE_EV) .addTo(mixerRecipes); + GTValues.RA.stdBuilder() + .fluidInputs(WerkstoffMaterialPool.FluoroformOxygenMix.getFluidOrGas(5000)) + .itemInputs(Materials.Empty.getCells(4)) + .fluidOutputs(WerkstoffMaterialPool.Fluoroform.getFluidOrGas(3000)) + .itemOutputs(Materials.Oxygen.getCells(4)) + .duration(5 * GTRecipeBuilder.SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(centrifugeRecipes); + GTValues.RA.stdBuilder() .itemInputs(Materials.Iron.getDust(2), Materials.NetherQuartz.getPlates(1)) .itemOutputs(new ItemStack(LanthItemList.IRON_COATED_QUARTZ)) @@ -673,6 +683,19 @@ public static void loadAccelerator() { .specialValue(3600) .addTo(blastFurnaceRecipes); + GTValues.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.ETCHED_MASK_1, 4), + Materials.Glass.getPlates(2), + new ItemStack(ModItems.dustLithiumHydroxide, 2), + Materials.Epoxid.getDust(4)) + .fluidInputs(Materials.Hydrogen.getGas(2000)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.CBLANK))) + .duration(4 * GTRecipeBuilder.MINUTES) + .eut(TierEU.RECIPE_ZPM) + .specialValue(4200) + .addTo(blastFurnaceRecipes); + for (MaskList mask : MaskList.values()) { MaskList maskIngredient = mask.getPrecursor(); @@ -682,66 +705,65 @@ public static void loadAccelerator() { if (mask.getLensColour() == null) { // CR Recipe - if (mask == MaskList.PPIC) { + if (mask == MaskList.PrPIC) { GTValues.RA.stdBuilder() .itemInputs( - new ItemStack(LanthItemList.maskMap.get(MaskList.NPIC)), - Materials.IndiumGalliumPhosphide.getDust(64)) - .fluidInputs(Materials.Sunnarium.getMolten(1440L)) - .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PPIC))) + new ItemStack(LanthItemList.maskMap.get(MaskList.PIC)), + Materials.IndiumGalliumPhosphide.getDust(2)) + .fluidInputs(Materials.VanadiumGallium.getMolten(288L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PrPIC))) .duration(60 * GTRecipeBuilder.SECONDS) .eut(mask.getEngraverEUt()) .requiresCleanRoom() - .addTo(UniversalChemical); // This is incredibly boring and doesn't make much sense, fix at some - // point. Maybe engrave again from precursor? + .addTo(UniversalChemical); - } else if (mask == MaskList.HPIC) { + } else if (mask == MaskList.PrHPIC) { GTValues.RA.stdBuilder() .itemInputs( - new ItemStack(LanthItemList.maskMap.get(MaskList.PIC)), - Materials.IndiumGalliumPhosphide.getDust(2)) - .fluidInputs(Materials.VanadiumGallium.getMolten(288L)) - .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.HPIC))) + new ItemStack(LanthItemList.maskMap.get(MaskList.HPIC)), + Materials.IndiumGalliumPhosphide.getDust(8)) + .fluidInputs(Materials.Naquadah.getMolten(576)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PrHPIC))) .duration(60 * GTRecipeBuilder.SECONDS) .eut(mask.getEngraverEUt()) .requiresCleanRoom() .addTo(UniversalChemical); - } else if (mask == MaskList.UHPIC) { + } else if (mask == MaskList.PrNPIC) { GTValues.RA.stdBuilder() .itemInputs( - new ItemStack(LanthItemList.maskMap.get(MaskList.HPIC)), - Materials.IndiumGalliumPhosphide.getDust(8)) - .fluidInputs(Materials.Naquadah.getMolten(576L)) - .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.UHPIC))) + new ItemStack(LanthItemList.maskMap.get(MaskList.NPIC)), + Materials.IndiumGalliumPhosphide.getDust(64)) + .fluidInputs(Materials.Sunnarium.getMolten(1440L)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PrNPIC))) .duration(60 * GTRecipeBuilder.SECONDS) .eut(mask.getEngraverEUt()) .requiresCleanRoom() .addTo(UniversalChemical); - } else if (mask == MaskList.NCPU) { + } else if (mask == MaskList.PrCPU) { GTValues.RA.stdBuilder() .itemInputs( new ItemStack(LanthItemList.maskMap.get(MaskList.CPU)), GTUtility.copyAmount(16, Ic2Items.carbonFiber)) .fluidInputs(Materials.Glowstone.getMolten(576L)) - .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.NCPU))) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PrCPU))) .duration(60 * GTRecipeBuilder.SECONDS) .eut(mask.getEngraverEUt()) .requiresCleanRoom() .addTo(UniversalChemical); - } else if (mask == MaskList.QBIT) { + } else if (mask == MaskList.PrNCPU) { GTValues.RA.stdBuilder() .itemInputs( new ItemStack(LanthItemList.maskMap.get(MaskList.NCPU)), Materials.IndiumGalliumPhosphide.getDust(1)) .fluidInputs(Materials.Radon.getGas(50L)) - .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.QBIT))) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PrNCPU))) .duration(60 * GTRecipeBuilder.SECONDS) .eut(mask.getEngraverEUt()) .requiresCleanRoom() @@ -750,7 +772,7 @@ public static void loadAccelerator() { GTValues.RA.stdBuilder() .itemInputs(new ItemStack(LanthItemList.maskMap.get(MaskList.NCPU)), ItemList.QuantumEye.get(2)) .fluidInputs(Materials.GalliumArsenide.getMolten(288L)) - .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.QBIT))) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(MaskList.PrNCPU))) .duration(45 * GTRecipeBuilder.SECONDS) .eut(mask.getEngraverEUt()) .requiresCleanRoom() @@ -795,16 +817,33 @@ public static void loadAccelerator() { for (ItemStack lens : OreDictionary.getOres("craftingLens" + lensColour.mName.replace(" ", ""))) { if (lens == null) continue; - - GTValues.RA.stdBuilder() - .itemInputs( - new ItemStack(LanthItemList.maskMap.get(maskIngredient)), - GTUtility.copyAmount(0, lens)) - .itemOutputs(new ItemStack(LanthItemList.maskMap.get(mask))) - .requiresCleanRoom() - .duration(120 * SECONDS) - .eut(mask.getEngraverEUt()) - .addTo(WaferEngravingRecipes); + if (mask == MaskList.LCC) { + + GTValues.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(maskIngredient)), + GTUtility.copyAmount(0, lens)) + .fluidInputs( + // damage * 4 (chips per recipe) * 50 (L per chip normally) * 3 / 4 (75% of the cost) + Materials.BioMediumSterilized.getFluid((mask.getDamage() + 1) * 4L * 50 * 3 / 4)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(mask))) + .requiresCleanRoom() + .duration(120 * SECONDS) + .eut(mask.getEngraverEUt()) + .addTo(WaferEngravingRecipes); + + } else { + + GTValues.RA.stdBuilder() + .itemInputs( + new ItemStack(LanthItemList.maskMap.get(maskIngredient)), + GTUtility.copyAmount(0, lens)) + .itemOutputs(new ItemStack(LanthItemList.maskMap.get(mask))) + .requiresCleanRoom() + .duration(120 * SECONDS) + .eut(mask.getEngraverEUt()) + .addTo(WaferEngravingRecipes); + } } } @@ -1068,7 +1107,7 @@ public static void loadGeneral() { GTValues.RA.stdBuilder() .fluidInputs(Materials.Water.getFluid(3000)) .fluidOutputs(Materials.HydrochloricAcid.getFluid(6000)) - .itemInputs(WerkstoffMaterialPool.LanthaniumChloride.get(OrePrefixes.dust, 4)) + .itemInputs(WerkstoffMaterialPool.LanthaniumChloride.get(OrePrefixes.dust, 8)) .itemOutputs(WerkstoffMaterialPool.LanthanumOxide.get(OrePrefixes.dust, 1)) .duration(10 * GTRecipeBuilder.SECONDS) .eut(TierEU.RECIPE_HV) @@ -3387,15 +3426,12 @@ public static void addRandomChemCrafting() { .eut(TierEU.RECIPE_MV) .addTo(fluidHeaterRecipes); - // PTMEG Manipulation - GTValues.RA.stdBuilder() - .itemInputs(ItemList.Shape_Mold_Plate.get(0L)) - .itemOutputs(WerkstoffMaterialPool.PTMEGElastomer.get(OrePrefixes.plate, 1)) - .fluidInputs(WerkstoffMaterialPool.PTMEGElastomer.getMolten(144)) - .duration(2 * SECONDS) - .eut(64) - .addTo(fluidSolidifierRecipes); + .fluidInputs(WerkstoffMaterialPool.HotSuperCoolant.getFluidOrGas(1000)) + .fluidOutputs(Materials.SuperCoolant.getFluid(1000)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(vacuumFreezerRecipes); // TODO Cerium-doped Lutetium Aluminium Garnet (Ce:LuAG) /** @@ -3776,8 +3812,8 @@ public static void removeCeriumCentrifuge() { int[] oreDict = OreDictionary.getOreIDs(input); for (int oreDictID : oreDict) { final String oreName = OreDictionary.getOreName(oreDictID); - if (!(oreName.startsWith("dust") && (!oreName.contains("Dephosphated")))) { - continue; + if (!oreName.startsWith("dust") || oreName.contains("Dephosphated") || oreName.startsWith("dustMAR")) { + break; } GTRecipe tRecipe = recipe.copy(); boolean modified = false; diff --git a/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java b/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java index 45e6ed1e529..83bba48cbc7 100644 --- a/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java +++ b/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java @@ -23,10 +23,8 @@ import java.util.Arrays; import java.util.Comparator; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Locale; -import java.util.Queue; import java.util.Set; import java.util.UUID; import java.util.function.Consumer; @@ -50,6 +48,7 @@ import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureUtility; import com.gtnewhorizon.structurelib.util.ItemStackPredicate.NBTMode; import com.gtnewhorizons.modularui.api.drawable.IDrawable; @@ -80,6 +79,8 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GTUtility; import gregtech.api.util.IGTHatchAdder; +import gregtech.api.util.LongData; +import gregtech.api.util.LongRunningAverage; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.gui.modularui.widget.ShutDownReasonSyncer; import gregtech.common.misc.WirelessNetworkManager; @@ -106,14 +107,14 @@ private enum TopState { private int counter = 1; private boolean balanced = false; - private final Queue energyInputValues = new LinkedList<>(); - private final Queue energyOutputValues = new LinkedList<>(); + private final LongRunningAverage energyInputValues1h = new LongRunningAverage(3600 * 20); + private final LongRunningAverage energyOutputValues1h = new LongRunningAverage(3600 * 20); - private final Queue energyInputValues5m = new LinkedList<>(); - private final Queue energyOutputValues5m = new LinkedList<>(); + private final LongData energyInputValues = energyInputValues1h.view(DURATION_AVERAGE_TICKS); + private final LongData energyOutputValues = energyOutputValues1h.view(DURATION_AVERAGE_TICKS); - private final Queue energyInputValues1h = new LinkedList<>(); - private final Queue energyOutputValues1h = new LinkedList<>(); + private final LongData energyInputValues5m = energyInputValues1h.view(5 * 60 * 20); + private final LongData energyOutputValues5m = energyOutputValues1h.view(5 * 60 * 20); private final long max_passive_drain_eu_per_tick_per_uhv_cap = 1_000_000; private final long max_passive_drain_eu_per_tick_per_uev_cap = 100_000_000; @@ -240,7 +241,7 @@ public boolean check(MTELapotronicSuperCapacitor t, World world, int x, int y, i } private int getHint(ItemStack stack) { - return Capacitor.VALUES_BY_TIER[Math.min( + return Capacitor.VALUES_BY_TIER[min( Capacitor.VALUES_BY_TIER.length, ChannelDataAccessor.getChannelData(stack, "capacitor")) - 1].getMinimalGlassTier() + 1; @@ -266,13 +267,12 @@ public PlaceResult survivalPlaceBlock(MTELapotronicSuperCapacitor t, World world Consumer chatter) { if (check(t, world, x, y, z)) return PlaceResult.SKIP; int glassTier = ChannelDataAccessor.getChannelData(trigger, "glass") + 2; - ItemStack targetStack = source - .takeOne( - s -> s != null && s.stackSize >= 0 - && s.getItem() == LSC_PART_ITEM - && Capacitor.VALUES[Math.min(s.getItemDamage(), Capacitor.VALUES.length) - - 1].getMinimalGlassTier() > glassTier, - true); + ItemStack targetStack = source.takeOne( + s -> s != null && s.stackSize >= 0 + && s.getItem() == LSC_PART_ITEM + && Capacitor.VALUES[min(s.getItemDamage(), Capacitor.VALUES.length) - 1] + .getMinimalGlassTier() > glassTier, + true); if (targetStack == null) return PlaceResult.REJECT; return StructureUtility.survivalPlaceBlock( targetStack, @@ -408,7 +408,7 @@ private int wirelessCapableCapacitors() { @Override protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType("Energy Storage") + tt.addMachineType("Energy Storage, LSC") .addInfo("Loses energy equal to 1% of the total capacity every 24 hours.") .addInfo( "Capped at " + EnumChatFormatting.RED @@ -629,45 +629,16 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; - int layer = Math.min(ChannelDataAccessor.getChannelData(stackSize, "height") + 3, 50); + int layer = min(ChannelDataAccessor.getChannelData(stackSize, "height") + 3, 50); int built; - built = survivialBuildPiece( - STRUCTURE_PIECE_BASE, - stackSize, - 2, - 1, - 0, - elementBudget, - source, - actor, - false, - true); + built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 2, 1, 0, elementBudget, env, false, true); if (built >= 0) return built; - for (int i = 2; i < layer - 1; i++) built = survivialBuildPiece( - STRUCTURE_PIECE_MID, - stackSize, - 2, - i, - 0, - elementBudget, - source, - actor, - false, - true); + for (int i = 2; i < layer - 1; i++) + built = survivialBuildPiece(STRUCTURE_PIECE_MID, stackSize, 2, i, 0, elementBudget, env, false, true); if (built >= 0) return built; - return survivialBuildPiece( - STRUCTURE_PIECE_TOP, - stackSize, - 2, - layer - 1, - 0, - elementBudget, - source, - actor, - false, - true); + return survivialBuildPiece(STRUCTURE_PIECE_TOP, stackSize, 2, layer - 1, 0, elementBudget, env, false, true); } @Override @@ -788,42 +759,9 @@ public boolean onRunningTick(ItemStack stack) { tBMTE.injectEnergyUnits(ForgeDirection.UNKNOWN, inputLastTick, 1L); tBMTE.drainEnergyUnits(ForgeDirection.UNKNOWN, outputLastTick, 1L); - // Add I/O values to Queues - if (energyInputValues.size() > DURATION_AVERAGE_TICKS) { - energyInputValues.remove(); - } - energyInputValues.offer(inputLastTick); - - if (energyOutputValues.size() > DURATION_AVERAGE_TICKS) { - energyOutputValues.remove(); - } - - energyOutputValues.offer(outputLastTick); - - // Add I/O values to Queues 5 min - if (energyInputValues5m.size() > 6000) { - energyInputValues5m.remove(); - } - energyInputValues5m.offer(inputLastTick); - - if (energyOutputValues5m.size() > 6000) { - energyOutputValues5m.remove(); - } - - energyOutputValues5m.offer(outputLastTick); - - // Add I/O values to Queues 1 hour - if (energyInputValues1h.size() > 72000) { - energyInputValues1h.remove(); - } - energyInputValues1h.offer(inputLastTick); - - if (energyOutputValues1h.size() > 72000) { - energyOutputValues1h.remove(); - } - - energyOutputValues1h.offer(outputLastTick); - + // collect stats + energyInputValues1h.update(inputLastTick); + energyOutputValues1h.update(outputLastTick); return true; } @@ -844,8 +782,8 @@ private int rebalance() { ItemBlockLapotronicEnergyUnit.UMV_wireless_eu_cap .multiply(BigInteger.valueOf(getUMVCapacitorCount())))); - if (transferred_eu.signum() == 1) { - inputLastTick += transferred_eu.longValue(); + if (transferred_eu.signum() == -1) { + inputLastTick += Math.abs(transferred_eu.longValue()); } else { outputLastTick += transferred_eu.longValue(); } @@ -907,6 +845,7 @@ private long recalculateLossWithMaintenance(int repairStatus) { * @return EU amount */ private long getPowerToDraw(long hatchWatts) { + if (stored.compareTo(capacity) >= 0) return 0; final BigInteger remcapActual = capacity.subtract(stored); final BigInteger recampLimited = (MAX_LONG.compareTo(remcapActual) > 0) ? remcapActual : MAX_LONG; return min(hatchWatts, recampLimited.longValue()); @@ -923,57 +862,9 @@ private long getPowerToPush(long hatchWatts) { return min(hatchWatts, remStoredLimited.longValue()); } - private long getAvgIn() { - long sum = 0L; - for (long l : energyInputValues) { - sum += l; - } - return sum / Math.max(energyInputValues.size(), 1); - } - - private long getAvgOut() { - long sum = 0L; - for (long l : energyOutputValues) { - sum += l; - } - return sum / Math.max(energyOutputValues.size(), 1); - } - - private long getAvgIn5m() { - double sum = 0; - for (long l : energyInputValues5m) { - sum += l; - } - return (long) sum / Math.max(energyInputValues5m.size(), 1); - } - - private long getAvgOut5m() { - double sum = 0; - for (long l : energyOutputValues5m) { - sum += l; - } - return (long) sum / Math.max(energyOutputValues5m.size(), 1); - } - - private long getAvgIn1h() { - double sum = 0; - for (long l : energyInputValues1h) { - sum += l; - } - return (long) sum / Math.max(energyInputValues1h.size(), 1); - } - - private long getAvgOut1h() { - double sum = 0; - for (long l : energyOutputValues1h) { - sum += l; - } - return (long) sum / Math.max(energyOutputValues1h.size(), 1); - } - private String getTimeTo() { - double avgIn = getAvgIn(); - double avgOut = getAvgOut(); + double avgIn = energyInputValues.avgLong(); + double avgOut = energyOutputValues.avgLong(); double passLoss = passiveDischargeAmount; double cap = capacity.doubleValue(); double sto = stored.doubleValue(); @@ -1033,12 +924,12 @@ public String[] getInfoData() { ll.add("Passive Loss: " + nf.format(passiveDischargeAmount) + " EU/t"); ll.add("EU IN: " + GTUtility.formatNumbers(inputLastTick) + " EU/t"); ll.add("EU OUT: " + GTUtility.formatNumbers(outputLastTick) + " EU/t"); - ll.add("Avg EU IN: " + nf.format(getAvgIn()) + " (last " + secInterval + " seconds)"); - ll.add("Avg EU OUT: " + nf.format(getAvgOut()) + " (last " + secInterval + " seconds)"); - ll.add("Avg EU IN: " + nf.format(getAvgIn5m()) + " (last " + 5 + " minutes)"); - ll.add("Avg EU OUT: " + nf.format(getAvgOut5m()) + " (last " + 5 + " minutes)"); - ll.add("Avg EU IN: " + nf.format(getAvgIn1h()) + " (last " + 1 + " hour)"); - ll.add("Avg EU OUT: " + nf.format(getAvgOut1h()) + " (last " + 1 + " hour)"); + ll.add("Avg EU IN: " + nf.format(energyInputValues.avgLong()) + " (last " + secInterval + " seconds)"); + ll.add("Avg EU OUT: " + nf.format(energyOutputValues.avgLong()) + " (last " + secInterval + " seconds)"); + ll.add("Avg EU IN: " + nf.format(energyInputValues5m.avgLong()) + " (last 5 minutes)"); + ll.add("Avg EU OUT: " + nf.format(energyOutputValues5m.avgLong()) + " (last 5 minutes)"); + ll.add("Avg EU IN: " + nf.format(energyInputValues1h.avgLong()) + " (last 1 hour)"); + ll.add("Avg EU OUT: " + nf.format(energyOutputValues1h.avgLong()) + " (last 1 hour)"); ll.add(getTimeTo()); @@ -1102,45 +993,58 @@ public String[] getInfoData() { protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { screenElements.setSynced(false) - .setSpace(0) - .setPos(10, 7); + .setSpace(0); screenElements .widget( - new TextWidget(GTUtility.trans("132", "Pipe is loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("132", "Pipe is loose. (Wrench)")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mWrench)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); screenElements .widget( - new TextWidget(GTUtility.trans("133", "Screws are loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("133", "Screws are loose. (Screwdriver)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mScrewdriver)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); screenElements .widget( - new TextWidget(GTUtility.trans("134", "Something is stuck.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("134", "Something is stuck. (Soft Mallet)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mSoftHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); screenElements .widget( - new TextWidget(GTUtility.trans("135", "Platings are dented.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("135", "Platings are dented. (Hammer)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mHardHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); screenElements .widget( - new TextWidget(GTUtility.trans("136", "Circuitry burned out.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("136", "Circuitry burned out. (Soldering)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mSolderingTool)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); - screenElements.widget( - new TextWidget(GTUtility.trans("137", "That doesn't belong there.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mCrowbar)) + screenElements + .widget( + new TextWidget(GTUtility.trans("137", "That doesn't belong there. (Crowbar)")) + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mCrowbar)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); screenElements .widget( - new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mMachine)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); screenElements.widget( - new TextWidget(GTUtility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("139", "Hit with Soft Mallet")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())) .widget( @@ -1152,11 +1056,13 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve () -> getBaseMetaTileEntity().isActive(), val -> getBaseMetaTileEntity().setActive(val))); screenElements.widget( - new TextWidget(GTUtility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("140", "to (re-)start the Machine")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())); screenElements.widget( - new TextWidget(GTUtility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("141", "if it doesn't start.")).setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())); @@ -1168,6 +1074,8 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve time.toMinutes() % 60, time.getSeconds() % 60); }) + .setSynced(false) + .setTextAlignment(Alignment.CenterLeft) .setEnabled( widget -> shouldDisplayShutDownReason() && !getBaseMetaTileEntity().isActive() && getBaseMetaTileEntity().wasShutdown())) @@ -1196,6 +1104,7 @@ && getBaseMetaTileEntity().wasShutdown())) screenElements.widget( new TextWidget().setStringSupplier( () -> "Total Capacity: " + EnumChatFormatting.BLUE + capacityCache + EnumChatFormatting.WHITE + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> isActiveCache)) .widget(new FakeSyncWidget.StringSyncer(this::getCapacityCache, val -> capacityCache = val)) @@ -1203,6 +1112,7 @@ && getBaseMetaTileEntity().wasShutdown())) new TextWidget() .setStringSupplier( () -> "Stored: " + EnumChatFormatting.RED + storedEUCache + EnumChatFormatting.WHITE + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> isActiveCache)) .widget(new FakeSyncWidget.StringSyncer(this::getStoredCache, val -> storedEUCache = val)) @@ -1218,6 +1128,7 @@ && getBaseMetaTileEntity().wasShutdown())) + passiveDischargeAmountCache + EnumChatFormatting.WHITE + " EU/t") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> isActiveCache)) .widget( @@ -1232,9 +1143,10 @@ && getBaseMetaTileEntity().wasShutdown())) : numberFormat.format(avgInCache)) + EnumChatFormatting.WHITE + " last 5s") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> isActiveCache)) - .widget(new FakeSyncWidget.LongSyncer(this::getAvgIn, val -> avgInCache = val)) + .widget(new FakeSyncWidget.LongSyncer(() -> energyInputValues.avgLong(), val -> avgInCache = val)) .widget( new TextWidget() .setStringSupplier( @@ -1243,11 +1155,13 @@ && getBaseMetaTileEntity().wasShutdown())) : numberFormat.format(avgOutCache)) + EnumChatFormatting.WHITE + " last 5s") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> isActiveCache)) - .widget(new FakeSyncWidget.LongSyncer(this::getAvgOut, val -> avgOutCache = val)) + .widget(new FakeSyncWidget.LongSyncer(() -> energyOutputValues.avgLong(), val -> avgOutCache = val)) .widget( new TextWidget().setStringSupplier(() -> EnumChatFormatting.WHITE + timeToCache) + .setTextAlignment(Alignment.CenterLeft) .setEnabled(widget -> isActiveCache)) .widget(new FakeSyncWidget.StringSyncer(this::getTimeTo, val -> timeToCache = val)) .widget( @@ -1257,6 +1171,7 @@ && getBaseMetaTileEntity().wasShutdown())) + wirelessStoreCache + EnumChatFormatting.WHITE + " EU") + .setTextAlignment(Alignment.CenterLeft) .setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> isActiveCache)) .widget(new FakeSyncWidget.StringSyncer(this::getWirelessStoredCache, val -> wirelessStoreCache = val)) diff --git a/src/main/java/kekztech/common/tileentities/MTESOFuelCellMK2.java b/src/main/java/kekztech/common/tileentities/MTESOFuelCellMK2.java index b7dd5b56525..8c4afee48e0 100644 --- a/src/main/java/kekztech/common/tileentities/MTESOFuelCellMK2.java +++ b/src/main/java/kekztech/common/tileentities/MTESOFuelCellMK2.java @@ -97,7 +97,7 @@ protected MultiblockTooltipBuilder createTooltip() { + "EU worth of fuel with up to 100% efficiency each second") .addInfo("Nitrobenzene and other gas fuels above 1M EU/bucket are more efficient") .addInfo("Steam production requires the SOFC to heat up completely first") - .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Steam") + .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Superheated Steam") .addInfo("Additionally, requires " + OXYGEN_PER_SEC + "L/s Oxygen gas") .beginStructureBlock(3, 3, 5, false) .addController("Front center") @@ -158,7 +158,8 @@ public CheckRecipeResult checkProcessing() { if ((liquid = GTUtility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null && hatchFluid.isFluidEqual(liquid)) { - liquid.amount = (EU_PER_TICK * 20) / aFuel.mSpecialValue / Math.max(1, aFuel.mSpecialValue / 1000); + liquid.amount = (int) ((EU_PER_TICK * 20) + / (aFuel.mSpecialValue * Math.max(1, (float) aFuel.mSpecialValue / 1000))); if (super.depleteInput(liquid)) { @@ -170,7 +171,7 @@ public CheckRecipeResult checkProcessing() { super.mEUt = EU_PER_TICK; super.mMaxProgresstime = 20; - super.mEfficiencyIncrease = 80; + super.mEfficiencyIncrease = 200; if (super.mEfficiency == getMaxEfficiency(null)) { super.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", STEAM_PER_SEC)); } diff --git a/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java b/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java index a1afd3561a3..8dce7a18938 100644 --- a/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java +++ b/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java @@ -314,9 +314,9 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont drawTexts(screenElements, !slotWidgets.isEmpty() ? slotWidgets.get(0) : null); builder.widget( new Scrollable().setVerticalScroll() - .widget(screenElements.setPos(10, 0)) - .setPos(0, 7) - .setSize(190, 79)); + .widget(screenElements) + .setPos(10, 7) + .setSize(182, 79)); builder.widget(createPowerSwitchButton(builder)) .widget(createVoidExcessButton(builder)) diff --git a/src/main/java/kubatech/loaders/MobHandlerLoader.java b/src/main/java/kubatech/loaders/MobHandlerLoader.java index 11f99651394..346448273c3 100644 --- a/src/main/java/kubatech/loaders/MobHandlerLoader.java +++ b/src/main/java/kubatech/loaders/MobHandlerLoader.java @@ -74,7 +74,7 @@ public static class MobEECRecipe { public final MobRecipe recipe; - public final int mEUt = 2000; + public final int mEUt = 1920; public final int mDuration; public final EntityLiving entityCopy; diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java index ad4ad7ab443..4d1a31929c4 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java @@ -262,7 +262,7 @@ protected MultiblockTooltipBuilder createTooltip() { tt.addMachineType("Powered Spawner, EEC") .addInfo("Spawns and kills monsters for you.") .addInfo("You have to insert the powered spawner in the controller.") - .addInfo("Base energy usage: 2,000 EU/t") + .addInfo("Base energy usage: 1,920 EU/t") .addInfo("Supports perfect OC, minimum time: 20 ticks, after that multiplies the outputs.") .addInfo("Recipe time is based on mob health.") .addInfo("You can additionally put a weapon inside the GUI.") diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java index 7cc087b3a26..7655b083a4f 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java @@ -291,7 +291,7 @@ protected IAlignmentLimits getInitialAlignmentLimits() { protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); String fertilizerBoostMax = String.format("%.0f", EIG_BALANCE_MAX_FERTILIZER_BOOST * 100); - tt.addMachineType("Crop Farm") + tt.addMachineType("Crop Farm, EIG") .addInfo("Grow your crops like a chad!") .addInfo("Use screwdriver to enable/change/disable setup mode") .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") @@ -1019,9 +1019,9 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont drawTexts(screenElements, null); builder.widget( new Scrollable().setVerticalScroll() - .widget(screenElements.setPos(10, 0)) - .setPos(0, 7) - .setSize(190, 79) + .widget(screenElements) + .setPos(10, 7) + .setSize(182, 79) .setEnabled(w -> !isInInventory)); builder.widget(createPowerSwitchButton(builder)) diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java index 7ae4adf1dac..ae8ab881199 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java @@ -148,8 +148,8 @@ public class MTEMegaIndustrialApiary extends KubaTechGTMultiBlockBase !isInInventory)); builder.widget(createPowerSwitchButton(builder)) diff --git a/src/main/java/tectech/loader/recipe/Assembler.java b/src/main/java/tectech/loader/recipe/Assembler.java index cbb6691a6ab..3af64082174 100644 --- a/src/main/java/tectech/loader/recipe/Assembler.java +++ b/src/main/java/tectech/loader/recipe/Assembler.java @@ -3034,7 +3034,7 @@ public void cleanroomRecipes() { .duration(40 * SECONDS) .eut(TierEU.RECIPE_ZPM) .addTo(assemblerRecipes); - // Uncertainty + // Uncertainty X GTValues.RA.stdBuilder() .itemInputs( CustomItemList.eM_Computer_Casing.get(1), @@ -3043,21 +3043,6 @@ public void cleanroomRecipes() { ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), GTUtility.getIntegratedCircuit(4)) - .itemOutputs(CustomItemList.Uncertainty_Hatch.get(1)) - .fluidInputs(Materials.Iridium.getMolten(2592)) - .requiresCleanRoom() - .duration(60 * SECONDS) - .eut(TierEU.RECIPE_ZPM) - .addTo(assemblerRecipes); - // Uncertainty X - GTValues.RA.stdBuilder() - .itemInputs( - CustomItemList.eM_Computer_Casing.get(1), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UEV, 1), - CustomItemList.DATApipe.get(32), - ItemList.Cover_Screen.get(1), - new ItemStack(Blocks.stone_button, 16), - GTUtility.getIntegratedCircuit(5)) .itemOutputs(CustomItemList.UncertaintyX_Hatch.get(1)) .fluidInputs(Materials.Iridium.getMolten(2592)) .requiresCleanRoom() diff --git a/src/main/java/tectech/loader/recipe/BaseRecipeLoader.java b/src/main/java/tectech/loader/recipe/BaseRecipeLoader.java index 180e8514f4a..445dd9c0690 100644 --- a/src/main/java/tectech/loader/recipe/BaseRecipeLoader.java +++ b/src/main/java/tectech/loader/recipe/BaseRecipeLoader.java @@ -46,5 +46,6 @@ public void run() { } else { Godforge.runDevEnvironmentRecipes(); } + Godforge.addFakeUpgradeCostRecipes(); } } diff --git a/src/main/java/tectech/loader/recipe/Godforge.java b/src/main/java/tectech/loader/recipe/Godforge.java index 981f6b139a7..51be5b9e7fc 100644 --- a/src/main/java/tectech/loader/recipe/Godforge.java +++ b/src/main/java/tectech/loader/recipe/Godforge.java @@ -11,9 +11,10 @@ import static gregtech.api.util.GTRecipeConstants.FOG_EXOTIC_TIER; import static gregtech.api.util.GTRecipeConstants.FOG_PLASMA_MULTISTEP; import static gregtech.api.util.GTRecipeConstants.FOG_PLASMA_TIER; +import static gregtech.api.util.GTRecipeConstants.FOG_UPGRADE_NAME_SHORT; import static tectech.recipe.TecTechRecipeMaps.godforgeExoticMatterRecipes; import static tectech.recipe.TecTechRecipeMaps.godforgePlasmaRecipes; -import static tectech.util.GodforgeMath.getRandomIntInRange; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.getRandomIntInRange; import java.util.ArrayList; import java.util.Arrays; @@ -26,6 +27,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.ArrayUtils; + import goodgenerator.items.GGMaterial; import goodgenerator.util.ItemRefer; import gregtech.api.enums.GTValues; @@ -47,6 +50,7 @@ import it.unimi.dsi.fastutil.ints.IntList; import tectech.recipe.TecTechRecipeMaps; import tectech.thing.CustomItemList; +import tectech.thing.metaTileEntity.multi.godforge.upgrade.ForgeOfGodsUpgrade; public class Godforge implements Runnable { @@ -55,7 +59,6 @@ public class Godforge implements Runnable { public static final HashMap exoticModulePlasmaItemMap = new HashMap<>(); public static final HashMap exoticModulePlasmaFluidMap = new HashMap<>(); public static final HashMap exoticModuleMagmatterItemMap = new HashMap<>(); - public static final HashMap godforgeUpgradeMats = new HashMap<>(); public static final List quarkGluonFluidItemsForNEI = new ArrayList<>(); public static final List quarkGluonItemsForNEI = new ArrayList<>(); public static final List magmatterTimeFluidItemsForNEI = new ArrayList<>(); @@ -688,83 +691,154 @@ public void run() { // Godforge upgrade materials if (EternalSingularity.isModLoaded() && GalaxySpace.isModLoaded()) { - godforgeUpgradeMats.put( - 0, - new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUIVBase, 64), - ItemList.SuperconductorComposite.get(32), - GGMaterial.metastableOganesson.get(OrePrefixes.gearGt, 16), - getModItem(EternalSingularity.ID, "eternal_singularity", 8L), ItemList.Robot_Arm_UIV.get(64L), - ItemList.Field_Generator_UEV.get(64L) }); - - godforgeUpgradeMats.put( - 5, - new ItemStack[] { GregtechItemList.Mega_AlloyBlastSmelter.get(16L), - ItemList.Casing_Coil_Hypogen.get(64L), - CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(32L), - getModItem(EternalSingularity.ID, "eternal_singularity", 16L), - ItemRefer.Field_Restriction_Coil_T3.get(48), ItemList.Robot_Arm_UIV.get(64L), - ItemList.Field_Generator_UEV.get(64L) }); - - godforgeUpgradeMats.put( - 7, - new ItemStack[] { CustomItemList.Godforge_StellarEnergySiphonCasing.get(8), - GregtechItemList.FusionComputer_UV3.get(8), GregtechItemList.Casing_Fusion_Internal2.get(64), - getModItem(GalaxySpace.ID, "item.DysonSwarmParts", 64, 3), MaterialsAlloy.QUANTUM.getPlateDense(48), - MaterialsElements.STANDALONE.RHUGNOR.getGear(32), - getModItem(EternalSingularity.ID, "eternal_singularity", 16L), ItemList.Robot_Arm_UIV.get(64L), - ItemList.Field_Generator_UEV.get(64L) }); - - godforgeUpgradeMats.put( - 11, - new ItemStack[] { CustomItemList.Godforge_StellarEnergySiphonCasing.get(16), - ItemRefer.Compact_Fusion_MK5.get(2), ItemRefer.Compact_Fusion_Coil_T4.get(64), - CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(16), - ItemList.Machine_Multi_TranscendentPlasmaMixer.get(4), - MaterialsElements.STANDALONE.RHUGNOR.getGear(64), - GTOreDictUnificator.get(OrePrefixes.gearGt, Materials.Ichorium, 64), - getModItem(EternalSingularity.ID, "eternal_singularity", 32L), ItemList.Robot_Arm_UIV.get(64L), - ItemList.Field_Generator_UEV.get(64L) }); - - godforgeUpgradeMats.put( - 26, - new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.SpaceTime, 64), - GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUMVBase, 64), - MaterialsElements.STANDALONE.HYPOGEN.getFrameBox(64), - MaterialsElements.STANDALONE.DRAGON_METAL.getFrameBox(64), - CustomItemList.EOH_Reinforced_Spatial_Casing.get(64), - CustomItemList.EOH_Infinite_Energy_Casing.get(8), ItemList.ZPM6.get(2), - ItemList.Field_Generator_UMV.get(32) }); - - godforgeUpgradeMats.put( - 29, - new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.WhiteDwarfMatter, 64), - GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.BlackDwarfMatter, 64), - GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Eternity, 16), - GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Universium, 2), - CustomItemList.EOH_Infinite_Energy_Casing.get(64), - CustomItemList.StabilisationFieldGeneratorTier5.get(16), ItemList.ZPM6.get(6), - ItemList.Field_Generator_UMV.get(64) }); - - godforgeUpgradeMats.put( - 30, - new ItemStack[] { CustomItemList.Machine_Multi_QuarkGluonPlasmaModule.get(32), - CustomItemList.Godforge_StellarEnergySiphonCasing.get(64), - CustomItemList.StabilisationFieldGeneratorTier6.get(48), - ItemList.Transdimensional_Alignment_Matrix.get(8), ItemList.ZPM6.get(16), - ItemList.Robot_Arm_UMV.get(64), ItemList.Conveyor_Module_UMV.get(64) }); + ForgeOfGodsUpgrade.START.addExtraCost( + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUIVBase, 64), + ItemList.SuperconductorComposite.get(32), + GGMaterial.metastableOganesson.get(OrePrefixes.gearGt, 16), + getModItem(EternalSingularity.ID, "eternal_singularity", 8L), + ItemList.Robot_Arm_UIV.get(64L), + ItemList.Field_Generator_UEV.get(64L)); + + ForgeOfGodsUpgrade.FDIM.addExtraCost( + GregtechItemList.Mega_AlloyBlastSmelter.get(16L), + ItemList.Casing_Coil_Hypogen.get(64L), + CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(32L), + getModItem(EternalSingularity.ID, "eternal_singularity", 16L), + ItemRefer.Field_Restriction_Coil_T3.get(48), + ItemList.Robot_Arm_UIV.get(64L), + ItemList.Field_Generator_UEV.get(64L)); + + ForgeOfGodsUpgrade.GPCI.addExtraCost( + CustomItemList.Godforge_StellarEnergySiphonCasing.get(8), + GregtechItemList.FusionComputer_UV3.get(8), + GregtechItemList.Casing_Fusion_Internal2.get(64), + getModItem(GalaxySpace.ID, "item.DysonSwarmParts", 64, 3), + MaterialsAlloy.QUANTUM.getPlateDense(48), + MaterialsElements.STANDALONE.RHUGNOR.getGear(32), + getModItem(EternalSingularity.ID, "eternal_singularity", 16L), + ItemList.Robot_Arm_UIV.get(64L), + ItemList.Field_Generator_UEV.get(64L)); + + ForgeOfGodsUpgrade.QGPIU.addExtraCost( + CustomItemList.Godforge_StellarEnergySiphonCasing.get(16), + ItemRefer.Compact_Fusion_MK5.get(2), + ItemRefer.Compact_Fusion_Coil_T4.get(64), + CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(16), + ItemList.Machine_Multi_TranscendentPlasmaMixer.get(4), + MaterialsElements.STANDALONE.RHUGNOR.getGear(64), + GTOreDictUnificator.get(OrePrefixes.gearGt, Materials.Ichorium, 64), + getModItem(EternalSingularity.ID, "eternal_singularity", 32L), + ItemList.Robot_Arm_UIV.get(64L), + ItemList.Field_Generator_UEV.get(64L)); + + ForgeOfGodsUpgrade.CD.addExtraCost( + GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.SpaceTime, 64), + GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.SuperconductorUMVBase, 64), + MaterialsElements.STANDALONE.HYPOGEN.getFrameBox(64), + MaterialsElements.STANDALONE.DRAGON_METAL.getFrameBox(64), + CustomItemList.EOH_Reinforced_Spatial_Casing.get(64), + CustomItemList.EOH_Infinite_Energy_Casing.get(8), + ItemList.ZPM6.get(2), + ItemList.Field_Generator_UMV.get(32)); + + ForgeOfGodsUpgrade.EE.addExtraCost( + GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.WhiteDwarfMatter, 64), + GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.BlackDwarfMatter, 64), + GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Eternity, 16), + GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.Universium, 2), + CustomItemList.EOH_Infinite_Energy_Casing.get(64), + CustomItemList.StabilisationFieldGeneratorTier5.get(16), + ItemList.ZPM6.get(6), + ItemList.Field_Generator_UMV.get(64)); + + ForgeOfGodsUpgrade.END.addExtraCost( + CustomItemList.Machine_Multi_QuarkGluonPlasmaModule.get(32), + CustomItemList.Godforge_StellarEnergySiphonCasing.get(64), + CustomItemList.StabilisationFieldGeneratorTier6.get(48), + ItemList.Transdimensional_Alignment_Matrix.get(8), + ItemList.ZPM6.get(16), + ItemList.Robot_Arm_UMV.get(64), + ItemList.Conveyor_Module_UMV.get(64)); } } public static void runDevEnvironmentRecipes() { // put something in here to not crash the game in dev environment when opening the manual insertion window - godforgeUpgradeMats.put(0, new ItemStack[] { new ItemStack(Blocks.cobblestone, 4) }); - godforgeUpgradeMats.put(5, new ItemStack[] { new ItemStack(Blocks.cobblestone, 8) }); - godforgeUpgradeMats.put(7, new ItemStack[] { new ItemStack(Blocks.cobblestone, 12) }); - godforgeUpgradeMats.put(11, new ItemStack[] { new ItemStack(Blocks.cobblestone, 16) }); - godforgeUpgradeMats.put(26, new ItemStack[] { new ItemStack(Blocks.cobblestone, 32) }); - godforgeUpgradeMats.put(29, new ItemStack[] { new ItemStack(Blocks.cobblestone, 48) }); - godforgeUpgradeMats.put(30, new ItemStack[] { new ItemStack(Blocks.cobblestone, 64) }); + ForgeOfGodsUpgrade.START.addExtraCost( + new ItemStack(Blocks.cobblestone, 4), + new ItemStack(Blocks.dirt, 12), + new ItemStack(Blocks.diamond_block, 8), + new ItemStack(Blocks.gold_block, 32)); + ForgeOfGodsUpgrade.FDIM.addExtraCost(new ItemStack(Blocks.cobblestone, 8)); + ForgeOfGodsUpgrade.GPCI.addExtraCost(new ItemStack(Blocks.cobblestone, 12)); + ForgeOfGodsUpgrade.QGPIU.addExtraCost(new ItemStack(Blocks.cobblestone, 16)); + ForgeOfGodsUpgrade.CD.addExtraCost(new ItemStack(Blocks.cobblestone, 32)); + ForgeOfGodsUpgrade.EE.addExtraCost(new ItemStack(Blocks.cobblestone, 48)); + ForgeOfGodsUpgrade.END.addExtraCost(new ItemStack(Blocks.cobblestone, 64)); + } + + public static void addFakeUpgradeCostRecipes() { + GTValues.RA.stdBuilder() + .itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.START.getExtraCost())) + .itemOutputs( + CustomItemList.Godforge_GravitonFlowModulatorTier1.get(1), + CustomItemList.Machine_Multi_SmeltingModule.get(1)) + .duration(1) + .eut(1) + .metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.START.getShortNameText()) + .fake() + .addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes); + GTValues.RA.stdBuilder() + .itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.FDIM.getExtraCost())) + .itemOutputs(CustomItemList.Machine_Multi_MoltenModule.get(1)) + .duration(1) + .eut(1) + .metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.FDIM.getShortNameText()) + .fake() + .addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes); + GTValues.RA.stdBuilder() + .itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.GPCI.getExtraCost())) + .itemOutputs(CustomItemList.Machine_Multi_PlasmaModule.get(1)) + .duration(1) + .eut(1) + .metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.GPCI.getShortNameText()) + .fake() + .addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes); + GTValues.RA.stdBuilder() + .itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.QGPIU.getExtraCost())) + .itemOutputs(CustomItemList.Machine_Multi_QuarkGluonPlasmaModule.get(1)) + .fluidOutputs(MaterialsUEVplus.QuarkGluonPlasma.getFluid(1000)) + .duration(1) + .eut(1) + .metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.QGPIU.getShortNameText()) + .fake() + .addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes); + GTValues.RA.stdBuilder() + .itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.CD.getExtraCost())) + .itemOutputs(CustomItemList.Godforge_GravitonFlowModulatorTier2.get(1)) + .duration(1) + .eut(1) + .metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.CD.getShortNameText()) + .fake() + .addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes); + GTValues.RA.stdBuilder() + .itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.EE.getExtraCost())) + .itemOutputs(CustomItemList.Godforge_GravitonFlowModulatorTier3.get(1)) + .duration(1) + .eut(1) + .metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.EE.getShortNameText()) + .fake() + .addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes); + GTValues.RA.stdBuilder() + .itemInputs(ArrayUtils.addAll(ForgeOfGodsUpgrade.END.getExtraCost())) + .itemOutputs(MaterialsUEVplus.GravitonShard.getGems(1)) + .fluidOutputs(MaterialsUEVplus.MagMatter.getMolten(576), Materials.Neutronium.getPlasma(1000)) + .duration(1) + .eut(1) + .metadata(FOG_UPGRADE_NAME_SHORT, ForgeOfGodsUpgrade.END.getShortNameText()) + .fake() + .addTo(TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes); } public static void initMoltenModuleRecipes() { diff --git a/src/main/java/tectech/loader/thing/MachineLoader.java b/src/main/java/tectech/loader/thing/MachineLoader.java index bf8f2e740a8..6b181bf124b 100644 --- a/src/main/java/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/tectech/loader/thing/MachineLoader.java @@ -2279,10 +2279,10 @@ public void run() { // for // NH Uncertainty_Hatch.set( - new MTEHatchUncertainty(UncertaintyResolver.ID, "hatch.certain.tier.07", "Uncertainty Resolver", 7) + new MTEHatchUncertainty(UncertaintyResolver.ID, "hatch.certain.tier.05", "Uncertainty Resolver", 5) .getStackForm(1L)); UncertaintyX_Hatch.set( - new MTEHatchUncertainty(UncertaintyResolverX.ID, "hatch.certain.tier.10", "Uncertainty Resolver X", 10) + new MTEHatchUncertainty(UncertaintyResolverX.ID, "hatch.certain.tier.07", "Uncertainty Resolver X", 7) .getStackForm(1L)); dataIn_Hatch.set( new MTEHatchDataInput(OpticalSlaveConnector.ID, "hatch.datain.tier.07", "Optical Reception Connector", 7) diff --git a/src/main/java/tectech/recipe/GodforgeUpgradeCostFrontend.java b/src/main/java/tectech/recipe/GodforgeUpgradeCostFrontend.java new file mode 100644 index 00000000000..aa818561717 --- /dev/null +++ b/src/main/java/tectech/recipe/GodforgeUpgradeCostFrontend.java @@ -0,0 +1,74 @@ +package tectech.recipe; + +import static gregtech.api.util.GTRecipeConstants.FOG_UPGRADE_NAME_SHORT; + +import java.util.List; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.EnumChatFormatting; + +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; + +import gregtech.api.recipe.BasicUIPropertiesBuilder; +import gregtech.api.recipe.NEIRecipePropertiesBuilder; +import gregtech.api.recipe.RecipeMapFrontend; +import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.common.gui.modularui.UIHelper; +import gregtech.nei.RecipeDisplayInfo; +import tectech.thing.gui.TecTechUITextures; + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +public class GodforgeUpgradeCostFrontend extends RecipeMapFrontend { + + public GodforgeUpgradeCostFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, + NEIRecipePropertiesBuilder neiPropertiesBuilder) { + super(uiPropertiesBuilder, neiPropertiesBuilder); + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder, Pos2d windowOffset) { + builder.widget( + new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_GODFORGE_LOGO) + .setSize(18, 18) + .setPos(new Pos2d(151, 63).add(windowOffset))); + } + + @Override + public List getItemInputPositions(int itemInputCount) { + return UIHelper.getGridPositions(itemInputCount, 8, 17, 4); + } + + @Override + public List getItemOutputPositions(int itemOutputCount) { + return UIHelper.getGridPositions(itemOutputCount, 116, 26, 1); + } + + @Override + public List getFluidOutputPositions(int fluidOutputCount) { + return UIHelper.getGridPositions(fluidOutputCount, 134, 26, 1); + } + + @Override + protected void drawDurationInfo(RecipeDisplayInfo recipeInfo) {} + + @Override + protected void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {} + + @Override + protected void drawSpecialInfo(RecipeDisplayInfo recipeInfo) { + String upgradeName = recipeInfo.recipe.getMetadataOrDefault(FOG_UPGRADE_NAME_SHORT, ""); + int width = Minecraft.getMinecraft().fontRenderer.getStringWidth(upgradeName); + if (width % 2 == 1) width -= 1; + int xOffset = 18 - width / 2 - 1; + recipeInfo.drawText(" ", 83, -76); + recipeInfo.drawText( + EnumChatFormatting.BLUE.toString() + EnumChatFormatting.UNDERLINE + EnumChatFormatting.BOLD + upgradeName, + 110 + xOffset, + 0); + } +} diff --git a/src/main/java/tectech/recipe/TecTechRecipeMaps.java b/src/main/java/tectech/recipe/TecTechRecipeMaps.java index d4908df5b7f..de98a2c2749 100644 --- a/src/main/java/tectech/recipe/TecTechRecipeMaps.java +++ b/src/main/java/tectech/recipe/TecTechRecipeMaps.java @@ -85,4 +85,16 @@ public static void init() {} .logoPos(151, 63) .build(); + public static final RecipeMap godforgeFakeUpgradeCostRecipes = RecipeMapBuilder + .of("gt.recipe.upgrade_costs") + .maxIO(12, 2, 0, 2) + .addSpecialTexture(83, 38, 30, 13, GTUITextures.PICTURE_ARROW_GRAY) + .dontUseProgressBar() + .neiTransferRect(83, 38, 30, 13) + .frontend(GodforgeUpgradeCostFrontend::new) + .neiHandlerInfo( + builder -> builder.setDisplayStack(CustomItemList.Machine_Multi_ForgeOfGods.get(1)) + .setHeight(100)) + .build(); + } diff --git a/src/main/java/tectech/thing/block/RenderForgeOfGods.java b/src/main/java/tectech/thing/block/RenderForgeOfGods.java index 90914344900..af67c97d44b 100644 --- a/src/main/java/tectech/thing/block/RenderForgeOfGods.java +++ b/src/main/java/tectech/thing/block/RenderForgeOfGods.java @@ -28,8 +28,8 @@ import com.gtnewhorizon.gtnhlib.client.renderer.vbo.VertexBuffer; import tectech.Reference; -import tectech.thing.metaTileEntity.multi.godforge.ForgeOfGodsRingsStructureString; -import tectech.thing.metaTileEntity.multi.godforge.ForgeOfGodsStructureString; +import tectech.thing.metaTileEntity.multi.godforge.structure.ForgeOfGodsRingsStructureString; +import tectech.thing.metaTileEntity.multi.godforge.structure.ForgeOfGodsStructureString; import tectech.util.StructureVBO; import tectech.util.TextureUpdateRequester; diff --git a/src/main/java/tectech/thing/block/TileEntityEyeOfHarmony.java b/src/main/java/tectech/thing/block/TileEntityEyeOfHarmony.java index 06873468536..d13be249b36 100644 --- a/src/main/java/tectech/thing/block/TileEntityEyeOfHarmony.java +++ b/src/main/java/tectech/thing/block/TileEntityEyeOfHarmony.java @@ -26,6 +26,11 @@ public class TileEntityEyeOfHarmony extends TileEntity { private static final double EOH_STAR_FIELD_RADIUS = 13; private AxisAlignedBB boundingBox; + @Override + public double getMaxRenderDistanceSquared() { + return Double.MAX_VALUE; + } + // Prevent culling when block is out of frame so model can remain active. @Override public AxisAlignedBB getRenderBoundingBox() { diff --git a/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java b/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java index a8a8992a638..aac0c245e0d 100644 --- a/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java +++ b/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java @@ -25,6 +25,7 @@ public class TileEntityForgeOfGods extends TileEntity { private float rotationSpeed = 10; private int ringCount = 1; private float rotAngle = 0, rotAxisX = 1, rotAxisY = 0, rotAxisZ = 0; + private AxisAlignedBB renderBoundingBox; private ForgeOfGodsStarColor starColor = ForgeOfGodsStarColor.DEFAULT; @@ -51,15 +52,33 @@ public class TileEntityForgeOfGods extends TileEntity { private static final String STAR_COLOR_TAG = NBT_TAG + "STAR_COLOR"; public static final float BACK_PLATE_DISTANCE = -121.5f, BACK_PLATE_RADIUS = 13f; + private static final double RING_RADIUS = 63; + private static final double BEAM_LENGTH = 59; @Override public AxisAlignedBB getRenderBoundingBox() { - return INFINITE_EXTENT_AABB; + if (renderBoundingBox == null) { + double x = this.xCoord; + double y = this.yCoord; + double z = this.zCoord; + + // This could possibly be made smaller by figuring out the beam direction, + // but since this is not always known (set dynamically by the MTE), this + // currently just bounds as if the beam is in all 4 directions. + renderBoundingBox = AxisAlignedBB.getBoundingBox( + x - RING_RADIUS - BEAM_LENGTH, + y - RING_RADIUS - BEAM_LENGTH, + z - RING_RADIUS - BEAM_LENGTH, + x + RING_RADIUS + BEAM_LENGTH + 1, + y + RING_RADIUS + BEAM_LENGTH + 1, + z + RING_RADIUS + BEAM_LENGTH + 1); + } + return renderBoundingBox; } @Override public double getMaxRenderDistanceSquared() { - return 51200; + return Double.MAX_VALUE; } public void setStarRadius(float size) { @@ -200,7 +219,7 @@ public void incrementColors() { cycleStep = 0; } else { // update interp values to the next set, reset cycleStep then interpolate - cycleStep = -255; + cycleStep -= 255; cycleStarColors(); interpolateColors(); } diff --git a/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java b/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java index 9e63c852219..4ea43062b26 100644 --- a/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java +++ b/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java @@ -1,6 +1,5 @@ package tectech.thing.cover; -import java.util.Objects; import java.util.UUID; import net.minecraft.entity.player.EntityPlayer; @@ -25,6 +24,7 @@ import gregtech.api.util.ISerializableObject; import gregtech.common.gui.modularui.widget.CoverDataControllerWidget; import gregtech.common.gui.modularui.widget.CoverDataFollowerToggleButtonWidget; +import gtPlusPlus.core.tileentities.base.TileEntityBase; import tectech.mechanics.enderStorage.EnderLinkTag; import tectech.mechanics.enderStorage.EnderWorldSavedData; @@ -61,6 +61,14 @@ public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, EnderLinkTag tag = EnderWorldSavedData.getEnderLinkTag((IFluidHandler) aTileEntity); if (tag != null) { + boolean shouldBePrivate = testBit(aCoverVariable, PUBLIC_PRIVATE_MASK); + boolean isPrivate = tag.getUUID() != null; + + if (shouldBePrivate != isPrivate) { + tag = new EnderLinkTag(tag.getFrequency(), shouldBePrivate ? getOwner(aTileEntity) : null); + EnderWorldSavedData.bindEnderLinkTag(teTank, tag); + } + IFluidHandler enderTank = EnderWorldSavedData.getEnderFluidContainer(tag); if (testBit(aCoverVariable, IMPORT_EXPORT_MASK)) { @@ -73,6 +81,16 @@ public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, return aCoverVariable; } + private static UUID getOwner(Object te) { + if (te instanceof IGregTechTileEntity igte) { + return igte.getOwnerUuid(); + } else if (te instanceof TileEntityBase teb) { + return teb.getOwnerUUID(); + } else { + return null; + } + } + @Override public void onBaseTEDestroyed(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { if (aTileEntity instanceof IFluidHandler fluidHandlerSelf) { @@ -156,7 +174,6 @@ public EnderFluidLinkUIFactory(CoverUIBuildContext buildContext) { super(buildContext); } - @SuppressWarnings("PointlessArithmeticExpression") @Override protected void addUIWidgets(ModularWindow.Builder builder) { TextFieldWidget frequencyField = new TextFieldWidget(); @@ -175,8 +192,7 @@ protected void addUIWidgets(ModularWindow.Builder builder) { if (testBit(convert(getCoverData()), PUBLIC_PRIVATE_MASK)) { uuid = getUUID(); - if (!(tank instanceof IGregTechTileEntity gte)) return; - if (!uuid.equals(gte.getOwnerUuid())) return; + if (!uuid.equals(getOwner(tank))) return; } EnderWorldSavedData.bindEnderLinkTag(tank, new EnderLinkTag(val, uuid)); @@ -233,30 +249,9 @@ protected void addUIWidgets(ModularWindow.Builder builder) { private int getNewCoverVariable(int id, int coverVariable) { switch (id) { - case PUBLIC_BUTTON_ID: { - if (getUIBuildContext().getTile() instanceof IGregTechTileEntity gte) { - EnderLinkTag tag = EnderWorldSavedData.getEnderLinkTag(gte); - - if (tag != null) { - EnderWorldSavedData.bindEnderLinkTag(gte, new EnderLinkTag(tag.getFrequency(), null)); - } - } - - return toggleBit(coverVariable, PUBLIC_PRIVATE_MASK); - } - case PRIVATE_BUTTON_ID: { - if (getUIBuildContext().getTile() instanceof IGregTechTileEntity gte) { - EnderLinkTag tag = EnderWorldSavedData.getEnderLinkTag(gte); - - UUID player = getUUID(); - - if ((gte.getOwnerUuid() == null || Objects.equals(player, gte.getOwnerUuid())) && tag != null) { - EnderWorldSavedData.bindEnderLinkTag(gte, new EnderLinkTag(tag.getFrequency(), player)); - } - } - + case PUBLIC_BUTTON_ID: + case PRIVATE_BUTTON_ID: return toggleBit(coverVariable, PUBLIC_PRIVATE_MASK); - } case IMPORT_BUTTON_ID: case EXPORT_BUTTON_ID: return toggleBit(coverVariable, IMPORT_EXPORT_MASK); diff --git a/src/main/java/tectech/thing/gui/TecTechUITextures.java b/src/main/java/tectech/thing/gui/TecTechUITextures.java index 89fb7c5b110..f8e6bbe59b5 100644 --- a/src/main/java/tectech/thing/gui/TecTechUITextures.java +++ b/src/main/java/tectech/thing/gui/TecTechUITextures.java @@ -123,6 +123,8 @@ public class TecTechUITextures { .fullImage(MODID, "gui/overlay_button/furnace_mode_on"); public static final UITexture OVERLAY_BUTTON_FURNACE_MODE_OFF = UITexture .fullImage(MODID, "gui/overlay_button/furnace_mode_off"); + public static final UITexture OVERLAY_BUTTON_STATISTICS = UITexture + .fullImage(MODID, "gui/overlay_button/statistics"); public static final UITexture OVERLAY_CYCLIC_BLUE = UITexture.fullImage(MODID, "gui/overlay_button/cyclic_blue"); public static final UITexture OVERLAY_EJECTION_LOCKED = UITexture .fullImage(MODID, "gui/overlay_button/eject_disabled"); @@ -226,6 +228,7 @@ public class TecTechUITextures { .fullImage(MODID, "gui/picture/connector_red_opaque"); public static final UITexture SLOT_OUTLINE_GREEN = UITexture.fullImage(MODID, "gui/picture/green_selector"); public static final UITexture UNSELECTED_OPTION = UITexture.fullImage(MODID, "gui/picture/unselected_option"); + public static final UITexture GREEN_CHECKMARK_11x9 = UITexture.fullImage(MODID, "gui/picture/green_checkmark"); public static final UITexture PICTURE_GODFORGE_MILESTONE_CHARGE = UITexture .fullImage(MODID, "gui/picture/milestone_charge"); public static final UITexture PICTURE_GODFORGE_MILESTONE_CONVERSION = UITexture diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchUncertainty.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchUncertainty.java index 38b90e47709..507f1aa8d83 100644 --- a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchUncertainty.java +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchUncertainty.java @@ -199,13 +199,15 @@ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlaye @Override public String[] getDescription() { - return new String[] { CommonValues.TEC_MARK_EM, translateToLocal("gt.blockmachines.hatch.certain.desc.0"), // Feeling - // certain, - // or - // not? - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD - + translateToLocal("gt.blockmachines.hatch.certain.desc.1") // Schrödinger equation in a box - }; + String[] description = new String[4]; + description[0] = CommonValues.TEC_MARK_EM; + description[1] = translateToLocal("gt.blockmachines.hatch.certain.desc.0"); // Feeling certain, or not? + description[2] = EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + + translateToLocal("gt.blockmachines.hatch.certain.desc.1"); // Schrödinger equation in a box + if (mTier < 6) { + description[3] = EnumChatFormatting.DARK_RED + translateToLocal("gt.blockmachines.hatch.certain.desc.2"); + } + return description; } private boolean balanceCheck(int sideLenY, short... masses) { @@ -343,7 +345,6 @@ public void addGregTechLogo(ModularWindow.Builder builder) { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - final boolean isAdvanced = mTier > 7; builder.widget( new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) @@ -431,23 +432,17 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont @Override public void draw(float partialTicks) { - if (isAdvanced) { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4f(1f, 1f, 1f, (float) matrix[index] / 1000f); - - // super.draw but without disabling blend - GlStateManager.pushMatrix(); - getDrawable().draw(Pos2d.ZERO, getSize(), partialTicks); - GlStateManager.popMatrix(); - - glDisable(GL_BLEND); - glColor4f(1f, 1f, 1f, 1f); - } else { - if (TecTech.RANDOM.nextInt(1000) < matrix[index]) { - super.draw(partialTicks); - } - } + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(1f, 1f, 1f, (float) matrix[index] / 1000f); + + // super.draw but without disabling blend + GlStateManager.pushMatrix(); + getDrawable().draw(Pos2d.ZERO, getSize(), partialTicks); + GlStateManager.popMatrix(); + + glDisable(GL_BLEND); + glColor4f(1f, 1f, 1f, 1f); } }.setDrawable(TecTechUITextures.PICTURE_UNCERTAINTY_INDICATOR) .setPos(47 + (i / 4) * 12, 28 + (i % 4) * 12) diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java index 7c2963a30a9..ff0d2deffc2 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java @@ -125,8 +125,8 @@ protected CheckRecipeResult checkProcessing_EM() { @Override public MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType(translateToLocal("gt.blockmachines.multimachine.em.transformer.name")) // Machine Type: - // Transformer + tt.addMachineType(translateToLocal("gt.blockmachines.multimachine.em.transformer.machinetype")) // Machine Type: + // Transformer .addInfo(translateToLocal("gt.blockmachines.multimachine.em.transformer.desc.1")) // Can transform to // and from any // voltage diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java index e1f6078741c..87c77e4afbe 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java @@ -3,10 +3,12 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GTValues.V; +import static gregtech.api.enums.HatchElement.Dynamo; import static gregtech.api.enums.HatchElement.Energy; import static gregtech.api.enums.HatchElement.Maintenance; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import static net.minecraft.util.StatCollector.translateToLocal; +import static tectech.thing.metaTileEntity.multi.base.TTMultiblockBase.HatchElement.DynamoMulti; import static tectech.thing.metaTileEntity.multi.base.TTMultiblockBase.HatchElement.EnergyMulti; import java.util.ArrayList; @@ -15,7 +17,6 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -25,8 +26,8 @@ import org.jetbrains.annotations.NotNull; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; @@ -83,7 +84,7 @@ public class MTEDataBank extends TTMultiblockBase implements ISurvivalConstructa .addElement('B', ofBlock(TTCasingsContainer.sBlockCasingsTT, 2)) .addElement( 'C', - buildHatchAdder(MTEDataBank.class).atLeast(Maintenance, Energy, EnergyMulti) + buildHatchAdder(MTEDataBank.class).atLeast(Maintenance, Energy, EnergyMulti, Dynamo, DynamoMulti) .casingIndex(BlockGTCasingsTT.textureOffset) .dot(1) .buildAndChain(TTCasingsContainer.sBlockCasingsTT, 0)) @@ -281,9 +282,9 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; - return survivialBuildPiece("main", stackSize, 2, 1, 0, elementBudget, source, actor, false, true); + return survivialBuildPiece("main", stackSize, 2, 1, 0, elementBudget, env, false, true); } @Override @@ -345,18 +346,8 @@ public IGTHatchAdder adder() { } } - @Override - public boolean isPowerPassButtonEnabled() { - return true; - } - @Override public boolean isSafeVoidButtonEnabled() { return false; } - - @Override - public boolean isAllowedToWorkButtonEnabled() { - return true; - } } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java index ffe04650955..649e3c7579a 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java @@ -220,8 +220,6 @@ public MultiblockTooltipBuilder createTooltip() { // Switch With QoS .addInfo(translateToLocal("gt.blockmachines.multimachine.em.switch.desc.1")) // Used to route and // distribute computation - .addInfo(translateToLocal("gt.blockmachines.multimachine.em.switch.desc.2")) // Needs a Parametrizer to - // be configured .addTecTechHatchInfo() .beginStructureBlock(3, 3, 3, false) diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java index f3c3d6ab16d..7893298514b 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java @@ -347,8 +347,9 @@ public void outputAfterRecipe_EM() { @Override public MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); - tt.addMachineType(translateToLocal("gt.blockmachines.multimachine.em.computer.name")) // Machine Type: Quantum - // Computer + tt.addMachineType(translateToLocal("gt.blockmachines.multimachine.em.computer.machinetype")) // Machine Type: + // Quantum + // Computer .addInfo(translateToLocal("gt.blockmachines.multimachine.em.computer.desc.0")) // Controller block of // the Quantum Computer .addInfo(translateToLocal("gt.blockmachines.multimachine.em.computer.desc.1")) // Used to generate diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java index ae0f636eccc..136451fb0fb 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java @@ -16,6 +16,8 @@ import static net.minecraft.util.StatCollector.translateToLocalFormatted; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; @@ -53,6 +55,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.MTEHatch; import gregtech.api.metatileentity.implementations.MTEHatchEnergy; +import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.recipe.check.SimpleCheckRecipeResult; @@ -554,6 +557,12 @@ public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPla "gt.blockmachines.multimachine.em.research.mode." + machineType.replace(" ", "_"))); } + @Nonnull + @Override + public Collection> getAvailableRecipeMaps() { + return Arrays.asList(scannerFakeRecipes, TecTechRecipeMaps.researchStationFakeRecipes); + } + @Override protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { super.drawTexts(screenElements, inventorySlot); @@ -623,7 +632,10 @@ public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDat } else if (!tag.getBoolean("incompleteStructure")) { currentTip.add(GREEN + "Running Fine" + efficiency); } - currentTip.add("Mode: " + tag.getString("machineType")); + currentTip.add( + StatCollector.translateToLocal( + "gt.blockmachines.multimachine.em.research.mode." + tag.getString("machineType") + .replace(" ", "_"))); currentTip.add( String.format( "Computation: %,d / %,d", diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java index 28790f4492a..2bf6804e747 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java @@ -2308,8 +2308,8 @@ public int getSlotStackLimit() { builder.widget( new Scrollable().setVerticalScroll() .widget(screenElements) - .setPos(0, 7) - .setSize(190, doesBindPlayerInventory() ? 79 : 165)); + .setPos(10, 7) + .setSize(182, doesBindPlayerInventory() ? 79 : 165)); Widget powerPassButton = createPowerPassButton(); builder.widget(powerPassButton) diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEBaseModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEBaseModule.java index 8b432d2ce86..d6bd8a55ed5 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEBaseModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEBaseModule.java @@ -57,6 +57,7 @@ import tectech.TecTech; import tectech.thing.gui.TecTechUITextures; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; +import tectech.thing.metaTileEntity.multi.godforge.util.ForgeOfGodsUI; public class MTEBaseModule extends TTMultiblockBase { @@ -321,9 +322,9 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .setSize(18, 6)) .widget( new Scrollable().setVerticalScroll() - .widget(screenElements.setPos(10, 0)) - .setPos(0, 7) - .setSize(190, 79)) + .widget(screenElements) + .setPos(10, 7) + .setSize(182, 79)) .widget( TextWidget.dynamicText(this::connectionStatus) .setDefaultColor(EnumChatFormatting.BLACK) diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEExoticModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEExoticModule.java index d30f9402d91..e14a40f8631 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEExoticModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEExoticModule.java @@ -1,5 +1,6 @@ package tectech.thing.metaTileEntity.multi.godforge; +import static gregtech.api.enums.Mods.NewHorizonsCoreMod; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.util.GTRecipeBuilder.INGOTS; import static gregtech.api.util.GTRecipeBuilder.SECONDS; @@ -22,8 +23,6 @@ import java.util.Map; import java.util.stream.Stream; -import javax.annotation.Nonnull; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -42,6 +41,8 @@ import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; import com.gtnewhorizons.modularui.api.fluids.FluidTanksHandler; import com.gtnewhorizons.modularui.api.fluids.IFluidTanksHandler; +import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; +import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.math.Size; @@ -53,6 +54,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; import gregtech.api.enums.MaterialsUEVplus; @@ -69,13 +71,15 @@ import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTStreamUtil; +import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; import tectech.TecTech; import tectech.recipe.TecTechRecipeMaps; import tectech.thing.CustomItemList; import tectech.thing.gui.TecTechUITextures; -import tectech.util.GodforgeMath; +import tectech.thing.metaTileEntity.multi.godforge.util.ForgeOfGodsUI; +import tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath; public class MTEExoticModule extends MTEBaseModule { @@ -93,6 +97,7 @@ public class MTEExoticModule extends MTEBaseModule { private BigInteger powerForRecipe = BigInteger.ZERO; private static final int NUMBER_OF_INPUTS = 7; private static final int INPUT_LIST_WINDOW_ID = 11; + private static final int POSSIBLE_INPUTS_WINDOW_ID = 12; public MTEExoticModule(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -126,7 +131,7 @@ protected Stream findRecipeMatches(@Nullable RecipeMap map) { @NotNull @Override - protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) { if (!recipeInProgress || recipeRegenerated) { powerForRecipe = BigInteger.valueOf(getProcessingVoltage()) .multiply(BigInteger.valueOf(recipe.mDuration * actualParallel)); @@ -155,7 +160,8 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { } for (FluidStack stack : recipe.mFluidInputs) { - if (!ArrayUtils.contains(inputFluids, stack)) { + if (!ArrayUtils.contains(inputFluids, stack) + || inputFluids[ArrayUtils.indexOf(inputFluids, stack)].amount != stack.amount) { return SimpleCheckRecipeResult.ofFailure("waiting_for_inputs"); } } @@ -164,7 +170,7 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { @NotNull @Override - protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult onRecipeStart(@NotNull GTRecipe recipe) { EUt = calculatedEut; powerForRecipe = BigInteger.valueOf(EUt) .multiply(BigInteger.valueOf(duration * actualParallel)); @@ -181,9 +187,9 @@ protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { return CheckRecipeResultRegistry.SUCCESSFUL; } - @Nonnull + @NotNull @Override - protected OverclockCalculator createOverclockCalculator(@Nonnull GTRecipe recipe) { + protected OverclockCalculator createOverclockCalculator(@NotNull GTRecipe recipe) { return super.createOverclockCalculator(recipe).setEUt(getProcessingVoltage()) .setDurationDecreasePerOC(getOverclockTimeFactor()); } @@ -369,7 +375,7 @@ public boolean supportsSingleRecipeLocking() { @Override public boolean supportsBatchMode() { - return false; + return true; } @Override @@ -465,6 +471,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .setTooltipShowUpDelay(TOOLTIP_DELAY)); super.addUIWidgets(builder, buildContext); buildContext.addSyncedWindow(INPUT_LIST_WINDOW_ID, this::createInputListWindow); + buildContext.addSyncedWindow(POSSIBLE_INPUTS_WINDOW_ID, this::createPossibleInputsWindow); builder.widget(createMagmatterSwitch(builder)); builder.widget(createExpectedInputsButton()); builder.widget( @@ -548,6 +555,10 @@ protected ModularWindow createInputListWindow(final EntityPlayer player) { builder, (widget, val) -> widget.notifyTooltipChange())); + if (NewHorizonsCoreMod.isModLoaded()) { + builder.widget(createPossibleInputsButton()); + } + return builder.build(); } @@ -563,6 +574,155 @@ private Widget createExpectedInputsButton() { .setPos(8, 69); } + protected ModularWindow createPossibleInputsWindow(final EntityPlayer player) { + final int WIDTH = 300; + final int HEIGHT = 143; + ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); + builder.setBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); + builder.setGuiTint(getGUIColorization()); + builder.setDraggable(true); + builder.widget( + ButtonWidget.closeWindowButton(true) + .setPos(284, 4)); + + int QGPItemMapSize = exoticModulePlasmaItemMap.size(); + int QGPFluidMapSize = exoticModulePlasmaFluidMap.size(); + + IItemHandlerModifiable QGPItemHandler = new ItemStackHandler(QGPItemMapSize); + IFluidTanksHandler QGPFluidHandler = new FluidTanksHandler(QGPFluidMapSize, 128000); + + List> itemEntryList = new ArrayList<>(exoticModulePlasmaItemMap.entrySet()); + List> fluidEntryList = new ArrayList<>(exoticModulePlasmaFluidMap.entrySet()); + + int slotYQGP = 0; + + for (int i = 0; i < QGPItemMapSize + QGPFluidMapSize; i++) { + + int slotXQGP = 6 + i % 16 * 18; + slotYQGP = 17 + i / 16 * 18; + + if (i < QGPItemMapSize) { + QGPItemHandler.setStackInSlot( + i, + GTUtility.copyAmount( + 1, + itemEntryList.get(i) + .getKey())); + builder.widget( + new DrawableWidget().setDrawable(GTUITextures.BUTTON_STANDARD_PRESSED) + .setPos(slotXQGP, slotYQGP) + .setSize(18, 18)); + builder.widget( + new SlotWidget(QGPItemHandler, i).setAccess(false, false) + .setRenderStackSize(false) + .disableInteraction() + .setPos(slotXQGP, slotYQGP) + .setSize(18, 18)); + } else { + QGPFluidHandler.setFluidInTank( + i - QGPItemMapSize, + fluidEntryList.get(i - QGPItemMapSize) + .getKey() + .getFluid(), + 1); + builder.widget( + new DrawableWidget().setDrawable(ModularUITextures.FLUID_SLOT) + .setSize(18, 18) + .setPos(slotXQGP, slotYQGP)) + .widget( + new FluidSlotWidget(QGPFluidHandler, i - QGPItemMapSize).setInteraction(false, false) + .setSize(18, 18) + .setPos(slotXQGP, slotYQGP)); + } + } + + int magMatterItemMapSize = exoticModuleMagmatterItemMap.size(); + + IItemHandlerModifiable magMatterItemHandler = new ItemStackHandler(magMatterItemMapSize); + IFluidTanksHandler magMatterFluidHandler = new FluidTanksHandler(2, 128000); + magMatterFluidHandler.setFluidInTank( + 0, + MaterialsUEVplus.Space.getMolten(1) + .getFluid(), + 1); + magMatterFluidHandler.setFluidInTank( + 1, + MaterialsUEVplus.Time.getMolten(1) + .getFluid(), + 1); + + List> magMatteritemEntryList = new ArrayList<>( + exoticModuleMagmatterItemMap.entrySet()); + + int slotXMagmatter; + int slotYMagmatter; + + for (int i = 0; i < magMatterItemMapSize + 2; i++) { + slotXMagmatter = 6 + i % 16 * 18; + slotYMagmatter = slotYQGP + 30 + i / 16 * 18; + + if (i < magMatterItemMapSize) { + magMatterItemHandler.setStackInSlot( + i, + GTUtility.copyAmount( + 1, + magMatteritemEntryList.get(i) + .getKey())); + builder.widget( + new DrawableWidget().setDrawable(GTUITextures.BUTTON_STANDARD_PRESSED) + .setPos(slotXMagmatter, slotYMagmatter) + .setSize(18, 18)); + builder.widget( + new SlotWidget(magMatterItemHandler, i).setAccess(false, false) + .setRenderStackSize(false) + .disableInteraction() + .setPos(slotXMagmatter, slotYMagmatter) + .setSize(18, 18)); + } else { + builder.widget( + new DrawableWidget().setDrawable(ModularUITextures.FLUID_SLOT) + .setSize(18, 18) + .setPos(slotXMagmatter, slotYMagmatter)) + .widget( + new FluidSlotWidget(magMatterFluidHandler, i - magMatterItemMapSize) + .setInteraction(false, false) + .setSize(18, 18) + .setPos(slotXMagmatter, slotYMagmatter)); + } + } + + builder.widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.possibleinputsqgp")) + .setDefaultColor(EnumChatFormatting.BLACK) + .setTextAlignment(Alignment.Center) + .setSize(300, 9) + .setPos(0, 6)); + + builder.widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.possibleinputsmagmatter")) + .setDefaultColor(EnumChatFormatting.BLACK) + .setTextAlignment(Alignment.Center) + .setSize(300, 9) + .setPos(0, slotYQGP + 21)); + + return builder.build(); + } + + private Widget createPossibleInputsButton() { + return new ButtonWidget().setOnClick((clickData, widget) -> { + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(POSSIBLE_INPUTS_WINDOW_ID); + } + }) + .setPlayClickSound(true) + .setBackground(ModularUITextures.ICON_INFO) + .addTooltip(translateToLocal("fog.button.possibleexoticinputs.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setSize(16, 16) + .setPos(79, 37); + } + protected ButtonWidget createMagmatterSwitch(IWidgetBuilder builder) { Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { if (isMagmatterCapable) { diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEForgeOfGods.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEForgeOfGods.java index c7d52215c99..7afef33b649 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEForgeOfGods.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEForgeOfGods.java @@ -1,6 +1,9 @@ package tectech.thing.metaTileEntity.multi.godforge; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.HatchElement.InputBus; +import static gregtech.api.enums.HatchElement.InputHatch; +import static gregtech.api.enums.HatchElement.OutputBus; import static gregtech.api.enums.Mods.Avaritia; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.util.GTModHandler.getModItem; @@ -11,21 +14,20 @@ import static java.lang.Math.log; import static java.lang.Math.max; import static net.minecraft.util.StatCollector.translateToLocal; -import static tectech.loader.recipe.Godforge.godforgeUpgradeMats; import static tectech.thing.casing.TTCasingsContainer.GodforgeCasings; import static tectech.thing.casing.TTCasingsContainer.forgeOfGodsRenderBlock; -import static tectech.util.GodforgeMath.allowModuleConnection; -import static tectech.util.GodforgeMath.calculateEnergyDiscountForModules; -import static tectech.util.GodforgeMath.calculateFuelConsumption; -import static tectech.util.GodforgeMath.calculateMaxFuelFactor; -import static tectech.util.GodforgeMath.calculateMaxHeatForModules; -import static tectech.util.GodforgeMath.calculateMaxParallelForModules; -import static tectech.util.GodforgeMath.calculateProcessingVoltageForModules; -import static tectech.util.GodforgeMath.calculateSpeedBonusForModules; -import static tectech.util.GodforgeMath.calculateStartupFuelConsumption; -import static tectech.util.GodforgeMath.queryMilestoneStats; -import static tectech.util.GodforgeMath.setMiscModuleParameters; -import static tectech.util.TTUtility.toExponentForm; +import static tectech.thing.metaTileEntity.multi.godforge.upgrade.ForgeOfGodsUpgrade.*; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.allowModuleConnection; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateEnergyDiscountForModules; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateFuelConsumption; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateMaxFuelFactor; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateMaxHeatForModules; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateMaxParallelForModules; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateProcessingVoltageForModules; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateSpeedBonusForModules; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.calculateStartupFuelConsumption; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.queryMilestoneStats; +import static tectech.thing.metaTileEntity.multi.godforge.util.GodforgeMath.setMiscModuleParameters; import java.awt.Desktop; import java.awt.Toolkit; @@ -36,7 +38,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -46,8 +47,9 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraftforge.common.util.ForgeDirection; @@ -55,7 +57,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.math.LongMath; -import com.google.common.primitives.Booleans; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -65,22 +66,17 @@ import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.drawable.UITexture; import com.gtnewhorizons.modularui.api.drawable.shapes.Rectangle; -import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.math.Color; -import com.gtnewhorizons.modularui.api.math.MainAxisAlignment; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.math.Size; -import com.gtnewhorizons.modularui.api.screen.ModularUIContext; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.api.widget.IWidgetBuilder; import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; -import com.gtnewhorizons.modularui.common.widget.DynamicPositionedRow; import com.gtnewhorizons.modularui.common.widget.DynamicTextWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.FluidNameHolderWidget; @@ -88,7 +84,6 @@ import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.Scrollable; import com.gtnewhorizons.modularui.common.widget.SlotGroup; -import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.NumericWidget; import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; @@ -109,6 +104,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.MTEHatchInput; import gregtech.api.metatileentity.implementations.MTEHatchInputBus; +import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.HatchElementBuilder; @@ -118,57 +114,80 @@ import gregtech.common.tileentities.machines.MTEHatchOutputBusME; import tectech.TecTech; import tectech.loader.ConfigHandler; +import tectech.recipe.TecTechRecipeMaps; import tectech.thing.block.BlockGodforgeGlass; import tectech.thing.block.TileEntityForgeOfGods; import tectech.thing.gui.TecTechUITextures; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; -import tectech.thing.metaTileEntity.multi.godforge.ForgeOfGodsUI.StarColorRGBM; import tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor; import tectech.thing.metaTileEntity.multi.godforge.color.StarColorSetting; import tectech.thing.metaTileEntity.multi.godforge.color.StarColorStorage; +import tectech.thing.metaTileEntity.multi.godforge.structure.ForgeOfGodsRingsStructureString; +import tectech.thing.metaTileEntity.multi.godforge.structure.ForgeOfGodsStructureString; +import tectech.thing.metaTileEntity.multi.godforge.upgrade.ForgeOfGodsUpgrade; +import tectech.thing.metaTileEntity.multi.godforge.upgrade.UpgradeStorage; +import tectech.thing.metaTileEntity.multi.godforge.util.ForgeOfGodsUI; +import tectech.thing.metaTileEntity.multi.godforge.util.ForgeOfGodsUI.StarColorRGBM; +import tectech.thing.metaTileEntity.multi.godforge.util.MilestoneFormatter; +import tectech.thing.metaTileEntity.multi.godforge.util.MilestoneIcon; +import tectech.thing.metaTileEntity.multi.godforge.util.UpgradeColor; public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, ISurvivalConstructable { + // Field default values for non-zero value defaults for item NBT checks + private static final int DEFAULT_FUEL_CONSUMPTION_FACTOR = 1; + private static final int DEFAULT_MAX_BATTERY_CHARGE = 100; + private static final int DEFAULT_RING_AMOUNT = 1; + private static final int DEFAULT_ROTATION_SPEED = 5; + private static final int DEFAULT_STAR_SIZE = 20; + private static final String DEFAULT_STAR_COLOR = ForgeOfGodsStarColor.DEFAULT.getName(); + private static final MilestoneFormatter DEFAULT_FORMATTING_MODE = MilestoneFormatter.COMMA; + private static final BigInteger DEFAULT_TOTAL_POWER = BigInteger.ZERO; + private static Textures.BlockIcons.CustomIcon ScreenON; - private int fuelConsumptionFactor = 1; - private int selectedFuelType = 0; - private int internalBattery = 0; - private int maxBatteryCharge = 100; - private int gravitonShardsAvailable = 0; - private int gravitonShardsSpent = 0; - private int ringAmount = 1; - private int stellarFuelAmount = 0; - private int neededStartupFuel = 0; - private long fuelConsumption = 0; - private long totalRecipesProcessed = 0; - private long totalFuelConsumed = 0; - private float totalExtensionsBuilt = 0; - private float powerMilestonePercentage = 0; - private float recipeMilestonePercentage = 0; - private float fuelMilestonePercentage = 0; - private float structureMilestonePercentage = 0; - private float invertedPowerMilestonePercentage = 0; - private float invertedRecipeMilestonePercentage = 0; - private float invertedFuelMilestonePercentage = 0; - private float invertedStructureMilestonePercentage = 0; - private BigInteger totalPowerConsumed = BigInteger.ZERO; - private boolean batteryCharging = false; - private boolean inversion = false; - private boolean gravitonShardEjection = false; - private FormattingMode formattingMode = FormattingMode.NONE; - private boolean isRenderActive = false; - private boolean secretUpgrade = false; + private int fuelConsumptionFactor = DEFAULT_FUEL_CONSUMPTION_FACTOR; + private int selectedFuelType; + private int internalBattery; + private int maxBatteryCharge = DEFAULT_MAX_BATTERY_CHARGE; + private int gravitonShardsAvailable; + private int gravitonShardsSpent; + private int ringAmount = DEFAULT_RING_AMOUNT; + private int stellarFuelAmount; + private int neededStartupFuel; + private long fuelConsumption; + private long totalRecipesProcessed; + private long totalFuelConsumed; + private float totalExtensionsBuilt; + private float powerMilestonePercentage; + private float recipeMilestonePercentage; + private float fuelMilestonePercentage; + private float structureMilestonePercentage; + private float invertedPowerMilestonePercentage; + private float invertedRecipeMilestonePercentage; + private float invertedFuelMilestonePercentage; + private float invertedStructureMilestonePercentage; + private BigInteger totalPowerConsumed = DEFAULT_TOTAL_POWER; + private boolean batteryCharging; + private boolean inversion; + private boolean gravitonShardEjection; + private MilestoneFormatter formattingMode = DEFAULT_FORMATTING_MODE; + private boolean isRenderActive; + private boolean secretUpgrade; + private boolean isRendererDisabled; private final ItemStack[] storedUpgradeWindowItems = new ItemStack[16]; public ArrayList moduleHatches = new ArrayList<>(); protected ItemStackHandler inputSlotHandler = new ItemStackHandler(16); + private final UpgradeStorage upgrades = new UpgradeStorage(); + private ForgeOfGodsUpgrade currentUpgradeWindow; + // Star cosmetics fields // actual star cosmetics private final StarColorStorage starColors = new StarColorStorage(); - private String selectedStarColor = ForgeOfGodsStarColor.DEFAULT.getName(); - private int rotationSpeed = 5; - private int starSize = 20; + private String selectedStarColor = DEFAULT_STAR_COLOR; + private int rotationSpeed = DEFAULT_ROTATION_SPEED; + private int starSize = DEFAULT_STAR_SIZE; // editing star color private ForgeOfGodsStarColor newStarColor = starColors.newTemplateColor(); private int starColorR, starColorG, starColorB; @@ -189,9 +208,8 @@ public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, private static final int STAR_COSMETICS_WINDOW_ID = 18; private static final int STAR_CUSTOM_COLOR_WINDOW_ID = 19; private static final int STAR_CUSTOM_COLOR_IMPORT_WINDOW_ID = 20; + private static final int STATISTICS_WINDOW_ID = 21; private static final int TEXTURE_INDEX = 960; - private static final int[] FIRST_SPLIT_UPGRADES = new int[] { 12, 13, 14 }; - private static final Integer[] UPGRADE_MATERIAL_ID_CONVERSION = { 0, 5, 7, 11, 26, 29, 30 }; private static final long POWER_MILESTONE_CONSTANT = LongMath.pow(10, 15); private static final long RECIPE_MILESTONE_CONSTANT = LongMath.pow(10, 7); private static final long FUEL_MILESTONE_CONSTANT = 10_000; @@ -251,7 +269,7 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu survivialBuildPiece(STRUCTURE_PIECE_SHAFT, stackSize, 63, 14, 1, realBudget, env, false, true); - if (stackSize.stackSize > 0 && ringAmount < 1) { + if (stackSize.stackSize > 0) { built += survivialBuildPiece( STRUCTURE_PIECE_FIRST_RING, stackSize, @@ -307,7 +325,13 @@ public IStructureDefinition getStructure_EM() { .addShape(STRUCTURE_PIECE_SECOND_RING_AIR, ForgeOfGodsRingsStructureString.SECOND_RING_AIR) .addShape(STRUCTURE_PIECE_THIRD_RING, ForgeOfGodsRingsStructureString.THIRD_RING) .addShape(STRUCTURE_PIECE_THIRD_RING_AIR, ForgeOfGodsRingsStructureString.THIRD_RING_AIR) - .addElement('A', classicHatches(TEXTURE_INDEX + 3, 1, GodforgeCasings, 3)) + .addElement( + 'A', + HatchElementBuilder.builder() + .atLeast(InputBus, InputHatch, OutputBus) + .casingIndex(TEXTURE_INDEX + 3) + .dot(1) + .buildAndChain(GodforgeCasings, 3)) .addElement('B', ofBlock(GodforgeCasings, 0)) .addElement('C', ofBlock(GodforgeCasings, 1)) .addElement('D', ofBlock(GodforgeCasings, 2)) @@ -400,7 +424,7 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac return false; } - if (internalBattery != 0 && !isRenderActive) { + if (internalBattery != 0 && !isRenderActive && !isRendererDisabled) { createRenderer(); } // Check there is 1 input bus @@ -434,7 +458,7 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac return false; } - if (isUpgradeActive(26)) { + if (isUpgradeActive(CD)) { if (checkPiece(STRUCTURE_PIECE_SECOND_RING, 55, 11, -67)) { ringAmount = 2; destroySecondRing(); @@ -454,7 +478,7 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac } } - if (isUpgradeActive(29)) { + if (isUpgradeActive(EE)) { if (checkPiece(STRUCTURE_PIECE_THIRD_RING, 47, 13, -76)) { ringAmount = 3; destroyThirdRing(); @@ -487,21 +511,19 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { startRecipeProcessing(); int maxModuleCount = 8; - if (upgrades[26]) { + if (isUpgradeActive(CD)) { maxModuleCount += 4; } - if (upgrades[29]) { + if (isUpgradeActive(EE)) { maxModuleCount += 4; } - boolean isFinalUpgradeUnlocked = upgrades[30]; - if (!mInputBusses.isEmpty()) { - if (internalBattery == 0 || isFinalUpgradeUnlocked) { + if (internalBattery == 0 || isUpgradeActive(END)) { MTEHatchInputBus inputBus = mInputBusses.get(0); ItemStack[] inputBusInventory = inputBus.getRealInventory(); ItemStack itemToAbsorb = STELLAR_FUEL; - if (isFinalUpgradeUnlocked && internalBattery != 0) { + if (isUpgradeActive(END) && internalBattery != 0) { itemToAbsorb = GTOreDictUnificator.get(OrePrefixes.gem, MaterialsUEVplus.GravitonShard, 1); } if (inputBusInventory != null) { @@ -531,7 +553,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (stellarFuelAmount >= neededStartupFuel) { stellarFuelAmount -= neededStartupFuel; increaseBattery(neededStartupFuel); - createRenderer(); + if (!isRendererDisabled) createRenderer(); } } } @@ -547,7 +569,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (!ConfigHandler.debug.DEBUG_MODE) { determineGravitonShardAmount(); } - if (upgrades[30] && gravitonShardEjection) { + if (isUpgradeActive(END) && gravitonShardEjection) { ejectGravitonShards(); } @@ -562,7 +584,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { calculateEnergyDiscountForModules(module, this); setMiscModuleParameters(module, this); queryMilestoneStats(module, this); - if (!upgrades[28]) { + if (!isUpgradeActive(TBF)) { calculateProcessingVoltageForModules(module, this); } } else { @@ -651,19 +673,10 @@ public IGTHatchAdder adder() { } private TileEntityForgeOfGods getRenderer() { - IGregTechTileEntity gregTechTileEntity = this.getBaseMetaTileEntity(); - - int x = gregTechTileEntity.getXCoord(); - int y = gregTechTileEntity.getYCoord(); - int z = gregTechTileEntity.getZCoord(); - - double xOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetX; - double zOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetZ; - double yOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetY; - + ChunkCoordinates renderPos = getRenderPos(); TileEntity tile = this.getBaseMetaTileEntity() .getWorld() - .getTileEntity((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset)); + .getTileEntity(renderPos.posX, renderPos.posY, renderPos.posZ); if (tile instanceof TileEntityForgeOfGods forgeTile) { return forgeTile; @@ -684,26 +697,17 @@ private void updateRenderer() { } private void createRenderer() { - - IGregTechTileEntity gregTechTileEntity = this.getBaseMetaTileEntity(); - - int x = gregTechTileEntity.getXCoord(); - int y = gregTechTileEntity.getYCoord(); - int z = gregTechTileEntity.getZCoord(); - - double xOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetX; - double zOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetZ; - double yOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetY; + ChunkCoordinates renderPos = getRenderPos(); this.getBaseMetaTileEntity() .getWorld() - .setBlock((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset), Blocks.air); + .setBlock(renderPos.posX, renderPos.posY, renderPos.posZ, Blocks.air); this.getBaseMetaTileEntity() .getWorld() - .setBlock((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset), forgeOfGodsRenderBlock); + .setBlock(renderPos.posX, renderPos.posY, renderPos.posZ, forgeOfGodsRenderBlock); TileEntityForgeOfGods rendererTileEntity = (TileEntityForgeOfGods) this.getBaseMetaTileEntity() .getWorld() - .getTileEntity((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset)); + .getTileEntity(renderPos.posX, renderPos.posY, renderPos.posZ); switch (ringAmount) { case 2 -> { @@ -715,9 +719,7 @@ private void createRenderer() { destroySecondRing(); destroyThirdRing(); } - default -> { - destroyFirstRing(); - } + default -> destroyFirstRing(); } rendererTileEntity.setRenderRotation(getRotation(), getDirection()); @@ -727,20 +729,10 @@ private void createRenderer() { } private void destroyRenderer() { - - IGregTechTileEntity gregTechTileEntity = this.getBaseMetaTileEntity(); - - int x = gregTechTileEntity.getXCoord(); - int y = gregTechTileEntity.getYCoord(); - int z = gregTechTileEntity.getZCoord(); - - double xOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetX; - double zOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetZ; - double yOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetY; - + ChunkCoordinates renderPos = getRenderPos(); this.getBaseMetaTileEntity() .getWorld() - .setBlock((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset), Blocks.air); + .setBlock(renderPos.posX, renderPos.posY, renderPos.posZ, Blocks.air); switch (ringAmount) { case 2 -> { @@ -752,14 +744,23 @@ private void destroyRenderer() { buildSecondRing(); buildThirdRing(); } - default -> { - buildFirstRing(); - } + default -> buildFirstRing(); } isRenderActive = false; } + private ChunkCoordinates getRenderPos() { + IGregTechTileEntity gregTechTileEntity = this.getBaseMetaTileEntity(); + int x = gregTechTileEntity.getXCoord(); + int y = gregTechTileEntity.getYCoord(); + int z = gregTechTileEntity.getZCoord(); + double xOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetX; + double yOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetY; + double zOffset = 122 * getExtendedFacing().getRelativeBackInWorld().offsetZ; + return new ChunkCoordinates((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset)); + } + private void destroyFirstRing() { buildPiece(STRUCTURE_PIECE_FIRST_RING_AIR, null, false, 63, 14, -59); } @@ -786,15 +787,15 @@ private void buildThirdRing() { @Override public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!ConfigHandler.debug.DEBUG_MODE) return; - if (isRenderActive) { - destroyRenderer(); - isRenderActive = false; + if (isRendererDisabled) { + isRendererDisabled = false; + // let the renderer automatically rebuild itself as needed through normal logic } else { - ringAmount = 3; - createRenderer(); - isRenderActive = true; + isRendererDisabled = true; + if (isRenderActive) destroyRenderer(); } + aPlayer.addChatMessage( + new ChatComponentText("Animations are now " + (isRendererDisabled ? "disabled" : "enabled") + ".")); } @Override @@ -840,6 +841,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont buildContext.addSyncedWindow(STAR_COSMETICS_WINDOW_ID, this::createStarCosmeticsWindow); buildContext.addSyncedWindow(STAR_CUSTOM_COLOR_WINDOW_ID, this::createStarCustomColorWindow); buildContext.addSyncedWindow(STAR_CUSTOM_COLOR_IMPORT_WINDOW_ID, this::createStarColorImportWindow); + buildContext.addSyncedWindow(STATISTICS_WINDOW_ID, this::createStatisticsWindow); builder.widget( new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) @@ -858,7 +860,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont button.add(TecTechUITextures.OVERLAY_BUTTON_ARROW_BLUE_UP); return button.toArray(new IDrawable[0]); }) - .addTooltip("Path of Celestial Transcendence") + .addTooltip(translateToLocal("fog.button.upgradetree.tooltip")) .setPos(174, 167) .setTooltipShowUpDelay(TOOLTIP_DELAY)) .widget( @@ -882,11 +884,15 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .setPos(174, 110) .setTooltipShowUpDelay(TOOLTIP_DELAY)) .widget( - TextWidget.dynamicText(this::storedFuel) + TextWidget.dynamicText(this::storedFuelHeaderText) .setDefaultColor(EnumChatFormatting.WHITE) .setPos(6, 8) - .setSize(74, 34)) - .widget(createPowerSwitchButton()) + .setSize(185, 10)) + .widget( + TextWidget.dynamicText(this::storedFuel) + .setDefaultColor(EnumChatFormatting.WHITE) + .setPos(6, 20) + .setSize(185, 10)) .widget(createBatteryButton(builder)) .widget(createEjectionSwitch(builder)) .widget(new FakeSyncWidget.BooleanSyncer(() -> getBaseMetaTileEntity().isAllowedToWork(), val -> { @@ -955,7 +961,6 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont if (!widget.isClient()) widget.getContext() .openSyncedWindow(STAR_COSMETICS_WINDOW_ID); }) - .setSize(16, 16) .addTooltip(translateToLocal("fog.button.color.tooltip")) .setBackground(() -> { List button = new ArrayList<>(); @@ -963,8 +968,25 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont button.add(TecTechUITextures.OVERLAY_BUTTON_RAINBOW_SPIRAL); return button.toArray(new IDrawable[0]); }) - .setPos(152, 91) - .setTooltipShowUpDelay(TOOLTIP_DELAY)); + .setPos(174, 148) + .setSize(16, 16) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(STATISTICS_WINDOW_ID); + } + }) + .addTooltip(translateToLocal("fog.button.statistics.tooltip")) + .setBackground(() -> { + List button = new ArrayList<>(); + button.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + button.add(TecTechUITextures.OVERLAY_BUTTON_STATISTICS); + return button.toArray(new IDrawable[0]); + }) + .setPos(26, 91) + .setSize(16, 16) + .setTooltipShowUpDelay(TOOLTIP_DELAY)); } @Override @@ -975,42 +997,24 @@ public void addGregTechLogo(ModularWindow.Builder builder) { .setPos(172, 67)); } - @Override - protected ButtonWidget createPowerSwitchButton() { - return ForgeOfGodsUI.createPowerSwitchButton(getBaseMetaTileEntity()); - } - protected ButtonWidget createEjectionSwitch(IWidgetBuilder builder) { Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { - if (upgrades[30]) { - gravitonShardEjection = !gravitonShardEjection; - } + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + gravitonShardEjection = !gravitonShardEjection; }) - .setPlayClickSound(upgrades[30]) - .setBackground(() -> { - List ret = new ArrayList<>(); - if (!upgrades[30]) { - return ret.toArray(new IDrawable[0]); - } - if (gravitonShardEjection) { - ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); - ret.add(TecTechUITextures.OVERLAY_EJECTION_ON); - } else { - ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); - ret.add(TecTechUITextures.OVERLAY_EJECTION_LOCKED); - } - return ret.toArray(new IDrawable[0]); - }) + .setBackground( + () -> new UITexture[] { TecTechUITextures.BUTTON_CELESTIAL_32x32, + gravitonShardEjection ? TecTechUITextures.OVERLAY_EJECTION_ON + : TecTechUITextures.OVERLAY_EJECTION_LOCKED }) + .addTooltip(translateToLocal("fog.button.ejection.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) .attachSyncer( new FakeSyncWidget.BooleanSyncer(() -> gravitonShardEjection, val -> gravitonShardEjection = val), builder) - .setPos(26, 91) + .setPos(44, 91) .setSize(16, 16) - .attachSyncer(new FakeSyncWidget.BooleanSyncer(() -> upgrades[30], val -> upgrades[30] = val), builder); - if (upgrades[30]) { - button.addTooltip(translateToLocal("fog.button.ejection.tooltip")); - button.setTooltipShowUpDelay(TOOLTIP_DELAY); - } + .setEnabled($ -> isUpgradeActive(END)) + .attachSyncer(upgrades.getSyncer(END), builder); return (ButtonWidget) button; } @@ -1019,7 +1023,7 @@ protected Widget createBatteryButton(IWidgetBuilder builder) { TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); if (clickData.mouseButton == 0) { batteryCharging = !batteryCharging; - } else if (clickData.mouseButton == 1 && !widget.isClient() && upgrades[8]) { + } else if (clickData.mouseButton == 1 && !widget.isClient() && isUpgradeActive(REC)) { widget.getContext() .openSyncedWindow(BATTERY_CONFIG_WINDOW_ID); } @@ -1080,53 +1084,63 @@ protected ModularWindow createBatteryWindow(final EntityPlayer player) { } protected ModularWindow createFuelConfigWindow(final EntityPlayer player) { - final int WIDTH = 78; - final int HEIGHT = 130; - final int PARENT_WIDTH = getGUIWidth(); - final int PARENT_HEIGHT = getGUIHeight(); - ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); + final int w = 78; + final int h = 130; + final int parentW = getGUIWidth(); + final int parentH = getGUIHeight(); + + ModularWindow.Builder builder = ModularWindow.builder(w, h); builder.setBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); builder.setDraggable(true); builder.setPos( - (size, window) -> Alignment.Center.getAlignedPos(size, new Size(PARENT_WIDTH, PARENT_HEIGHT)) + (size, window) -> Alignment.Center.getAlignedPos(size, new Size(parentW, parentH)) .add( - Alignment.TopRight.getAlignedPos(new Size(PARENT_WIDTH, PARENT_HEIGHT), new Size(WIDTH, HEIGHT)) - .add(WIDTH - 3, 0))); + Alignment.TopRight.getAlignedPos(new Size(parentW, parentH), new Size(w, h)) + .add(w - 3, 0))); + + // Window header builder.widget( TextWidget.localised("gt.blockmachines.multimachine.FOG.fuelconsumption") .setPos(3, 2) - .setSize(74, 34)) - .widget( - new NumericWidget().setSetter(val -> fuelConsumptionFactor = (int) val) - .setGetter(() -> fuelConsumptionFactor) - .setBounds(1, calculateMaxFuelFactor(this)) - .setDefaultValue(1) - .setScrollValues(1, 4, 64) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(70, 18) - .setPos(4, 35) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer( - new FakeSyncWidget.ListSyncer<>( - () -> Booleans.asList(upgrades), - val -> upgrades = Booleans.toArray(val), - PacketBuffer::writeBoolean, - PacketBuffer::readBoolean), - builder, - (widget, val) -> ((NumericWidget) widget).setMaxValue(calculateMaxFuelFactor(this)))) - .widget( - new DrawableWidget().setDrawable(ModularUITextures.ICON_INFO) - .setPos(64, 24) - .setSize(10, 10) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.0")) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.1")) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.2")) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.3")) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.4")) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.5")) - .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .setSize(74, 34)); + + // Fuel factor textbox + NumericWidget fuelFactor = new NumericWidget(); + fuelFactor.setSetter(val -> fuelConsumptionFactor = (int) val) + .setGetter(() -> fuelConsumptionFactor) + .setBounds(1, calculateMaxFuelFactor(this)) + .setDefaultValue(1) + .setScrollValues(1, 4, 64) + .setTextAlignment(Alignment.Center) + .setTextColor(Color.WHITE.normal) + .setSize(70, 18) + .setPos(4, 35) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD); + builder.widget(fuelFactor); + + // Syncers for max fuel factor + builder.widget( + upgrades.getSyncer(CFCE) + .setOnClientUpdate($ -> fuelFactor.setMaxValue(calculateMaxFuelFactor(this)))); + builder.widget( + upgrades.getSyncer(GEM) + .setOnClientUpdate($ -> fuelFactor.setMaxValue(calculateMaxFuelFactor(this)))); + builder.widget( + upgrades.getSyncer(TSE) + .setOnClientUpdate($ -> fuelFactor.setMaxValue(calculateMaxFuelFactor(this)))); + + builder.widget( + new DrawableWidget().setDrawable(ModularUITextures.ICON_INFO) + .setPos(64, 24) + .setSize(10, 10) + .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.0")) + .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.1")) + .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.2")) + .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.3")) + .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.4")) + .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfo.5")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) .widget( TextWidget.localised("gt.blockmachines.multimachine.FOG.fueltype") .setPos(3, 57) @@ -1204,8 +1218,7 @@ public void buildTooltip(List tooltip) { }) .setSize(18, 18)) .setPos(29, 82) - .setSize(18, 18) - .attachSyncer(new FakeSyncWidget.IntegerSyncer(this::getFuelType, this::setFuelType), builder)) + .setSize(18, 18)) .widget( new MultiChildWidget().addChild( new FluidNameHolderWidget( @@ -1354,8 +1367,7 @@ protected ModularWindow createMilestoneWindow(final EntityPlayer player) { if (!widget.isClient()) { widget.getWindow() .closeWindow(); - widget.getContext() - .closeWindow(INDIVIDUAL_MILESTONE_WINDOW_ID); + ForgeOfGodsUI.closeWindow(widget, INDIVIDUAL_MILESTONE_WINDOW_ID); } }) .setPos(382, 6)); @@ -1363,52 +1375,24 @@ protected ModularWindow createMilestoneWindow(final EntityPlayer player) { } protected ModularWindow createIndividualMilestoneWindow(final EntityPlayer player) { - final int WIDTH = 150; - final int HEIGHT = 150; - int symbol_width; - int symbol_height; - String milestoneType; - ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); - UITexture symbol; - switch (currentMilestoneID) { - case 1 -> { - symbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CONVERSION; - symbol_width = 54; - symbol_height = 75; - milestoneType = "recipe"; - } - case 2 -> { - symbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CATALYST; - symbol_width = 75; - symbol_height = 75; - milestoneType = "fuel"; - } - case 3 -> { - symbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_COMPOSITION; - symbol_width = 75; - symbol_height = 75; - milestoneType = "purchasable"; - } - default -> { - symbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CHARGE; - symbol_width = 60; - symbol_height = 75; - milestoneType = "power"; - } - } + final int w = 150; + final int h = 150; + final MilestoneIcon icon = MilestoneIcon.VALUES[currentMilestoneID]; + final Size iconSize = icon.getSize(); + ModularWindow.Builder builder = ModularWindow.builder(w, h); builder.setBackground(TecTechUITextures.BACKGROUND_GLOW_WHITE); builder.setDraggable(true); + builder.widget( ButtonWidget.closeWindowButton(true) .setPos(134, 4)) .widget( - new DrawableWidget().setDrawable(symbol) - .setSize(symbol_width, symbol_height) - .setPos((WIDTH - symbol_width) / 2, (HEIGHT - symbol_height) / 2)) + new DrawableWidget().setDrawable(icon.getSymbol()) + .setSize(iconSize) + .setPos((w - iconSize.width) / 2, (h - iconSize.height) / 2)) .widget( - TextWidget.localised("gt.blockmachines.multimachine.FOG." + milestoneType + "milestone") - .setDefaultColor(EnumChatFormatting.GOLD) + new TextWidget(icon.getNameText()).setDefaultColor(EnumChatFormatting.GOLD) .setTextAlignment(Alignment.Center) .setPos(0, 8) .setSize(150, 15)) @@ -1459,8 +1443,8 @@ protected ModularWindow createIndividualMilestoneWindow(final EntityPlayer playe .attachSyncer( new FakeSyncWidget.ByteSyncer( () -> (byte) formattingMode.ordinal(), - val -> formattingMode = FormattingMode.VALUES[MathHelper - .clamp_int(val, 0, FormattingMode.VALUES.length - 1)]), + val -> formattingMode = MilestoneFormatter.VALUES[MathHelper + .clamp_int(val, 0, MilestoneFormatter.VALUES.length - 1)]), builder)); return builder.build(); @@ -1485,490 +1469,79 @@ private Widget createMilestoneButton(int milestoneID, int width, int height, Pos .setTooltipShowUpDelay(TOOLTIP_DELAY); } - private int currentUpgradeID = 0; - private int currentColorCode = 0; - private int currentMilestoneBG = 0; - private int gravitonShardCost = 0; - private final int[][] prereqUpgrades = new int[31][]; - private int[] followupUpgrades = new int[] {}; - private boolean isUpradeSplitStart = false; - private boolean doesCurrentUpgradeRequireExtraMats = false; - private final boolean[] allPrereqRequired = new boolean[31]; - private boolean[] upgrades = new boolean[31]; - private boolean[] materialPaidUpgrades = new boolean[7]; - protected ModularWindow createUpgradeTreeWindow(final EntityPlayer player) { - final Scrollable scrollable = new Scrollable().setVerticalScroll(); - final int PARENT_WIDTH = 300; - final int PARENT_HEIGHT = 300; - ModularWindow.Builder builder = ModularWindow.builder(PARENT_WIDTH, PARENT_HEIGHT); - - scrollable.widget(createUpgradeConnectorLine(new Pos2d(143, 71), 45, 0, 0, 0, 1)) - .widget(createUpgradeConnectorLine(new Pos2d(124, 124), 60, 27, 0, 1, 2)) - .widget(createUpgradeConnectorLine(new Pos2d(162, 124), 60, 333, 0, 1, 3)) - .widget(createUpgradeConnectorLine(new Pos2d(94, 184), 60, 27, 0, 2, 4)) - .widget(createUpgradeConnectorLine(new Pos2d(130, 184), 60, 336, 0, 2, 5)) - .widget(createUpgradeConnectorLine(new Pos2d(156, 184), 60, 24, 0, 3, 5)) - .widget(createUpgradeConnectorLine(new Pos2d(192, 184), 60, 333, 0, 3, 6)) - .widget(createUpgradeConnectorLine(new Pos2d(143, 251), 45, 0, 0, 5, 7)) - .widget(createUpgradeConnectorLine(new Pos2d(143, 311), 45, 0, 0, 7, 9)) - .widget(createUpgradeConnectorLine(new Pos2d(78, 250), 110, 5, 4, 4, 8)) - .widget(createUpgradeConnectorLine(new Pos2d(110, 290), 80, 40, 4, 7, 8)) - .widget(createUpgradeConnectorLine(new Pos2d(208, 250), 110, 355, 4, 6, 10)) - .widget(createUpgradeConnectorLine(new Pos2d(176, 290), 80, 320, 4, 7, 10)) - .widget(createUpgradeConnectorLine(new Pos2d(100, 355), 80, 313, 0, 8, 11)) - .widget(createUpgradeConnectorLine(new Pos2d(186, 355), 80, 47, 0, 10, 11)) - .widget(createUpgradeConnectorLine(new Pos2d(143, 430), 48, 0, 2, 11, 13)) - .widget(createUpgradeConnectorLine(new Pos2d(143, 490), 48, 0, 2, 13, 18)) - .widget(createUpgradeConnectorLine(new Pos2d(143, 550), 48, 0, 2, 18, 21)) - .widget(createUpgradeConnectorLine(new Pos2d(143, 610), 48, 0, 2, 21, 23)) - .widget(createUpgradeConnectorLine(new Pos2d(110, 410), 80, 40, 1, 11, 12)) - .widget(createUpgradeConnectorLine(new Pos2d(83, 490), 48, 0, 1, 12, 17)) - .widget(createUpgradeConnectorLine(new Pos2d(83, 550), 48, 0, 1, 17, 20)) - .widget(createUpgradeConnectorLine(new Pos2d(101, 590), 80, 320, 1, 20, 23)) - .widget(createUpgradeConnectorLine(new Pos2d(53, 536), 35, 45, 1, 17, 16)) - .widget(createUpgradeConnectorLine(new Pos2d(176, 410), 80, 320, 3, 11, 14)) - .widget(createUpgradeConnectorLine(new Pos2d(203, 490), 48, 0, 3, 14, 19)) - .widget(createUpgradeConnectorLine(new Pos2d(203, 550), 48, 0, 3, 19, 22)) - .widget(createUpgradeConnectorLine(new Pos2d(185, 590), 80, 40, 3, 22, 23)) - .widget(createUpgradeConnectorLine(new Pos2d(233, 476), 35, 315, 3, 14, 15)) - .widget(createUpgradeConnectorLine(new Pos2d(143, 670), 48, 0, 0, 23, 24)) - .widget(createUpgradeConnectorLine(new Pos2d(101, 707), 75, 62.3f, 0, 24, 25)) - .widget(createUpgradeConnectorLine(new Pos2d(53, 772), 78, 0, 0, 25, 26)) - .widget(createUpgradeConnectorLine(new Pos2d(95, 837), 75, 297.7f, 0, 26, 27)) - .widget(createUpgradeConnectorLine(new Pos2d(191, 837), 75, 62.3f, 0, 27, 28)) - .widget(createUpgradeConnectorLine(new Pos2d(233, 772), 78, 0, 0, 28, 29)) - .widget(createUpgradeConnectorLine(new Pos2d(191, 747), 75, 62.3f, 0, 29, 30)); + ModularWindow.Builder builder = ModularWindow.builder(300, 300); + Scrollable scrollable = new Scrollable().setVerticalScroll(); + // spotless:off scrollable - .widget( - createUpgradeBox( - 0, - 0, - 3, - new int[] {}, - false, - new int[] { 1 }, - false, - true, - 0, - new Pos2d(126, 56), - scrollable)) - .widget( - createUpgradeBox( - 1, - 0, - 1, - new int[] { 0 }, - false, - new int[] { 2, 3 }, - false, - false, - 1, - new Pos2d(126, 116), - scrollable)) - .widget( - createUpgradeBox( - 2, - 0, - 2, - new int[] { 1 }, - false, - new int[] { 4, 5 }, - false, - false, - 1, - new Pos2d(96, 176), - scrollable)) - .widget( - createUpgradeBox( - 3, - 0, - 2, - new int[] { 1 }, - false, - new int[] { 5, 6 }, - false, - false, - 1, - new Pos2d(156, 176), - scrollable)) - .widget( - createUpgradeBox( - 4, - 0, - 0, - new int[] { 2 }, - false, - new int[] { 8 }, - false, - false, - 1, - new Pos2d(66, 236), - scrollable)) - .widget( - createUpgradeBox( - 5, - 0, - 3, - new int[] { 2, 3 }, - false, - new int[] { 7 }, - false, - true, - 1, - new Pos2d(126, 236), - scrollable)) - .widget( - createUpgradeBox( - 6, - 0, - 1, - new int[] { 3 }, - false, - new int[] { 10 }, - false, - false, - 1, - new Pos2d(186, 236), - scrollable)) - .widget( - createUpgradeBox( - 7, - 0, - 3, - new int[] { 5 }, - false, - new int[] { 8, 9, 10 }, - false, - true, - 2, - new Pos2d(126, 296), - scrollable)) - .widget( - createUpgradeBox( - 8, - 4, - 0, - new int[] { 4, 7 }, - true, - new int[] { 11 }, - false, - false, - 2, - new Pos2d(56, 356), - scrollable)) - .widget( - createUpgradeBox( - 9, - 0, - 2, - new int[] { 7 }, - false, - new int[] {}, - false, - false, - 2, - new Pos2d(126, 356), - scrollable)) - .widget( - createUpgradeBox( - 10, - 4, - 1, - new int[] { 6, 7 }, - true, - new int[] { 11 }, - false, - false, - 2, - new Pos2d(196, 356), - scrollable)) - .widget( - createUpgradeBox( - 11, - 0, - 3, - new int[] { 8, 10 }, - false, - new int[] { 12, 13, 14 }, - false, - true, - 2, - new Pos2d(126, 416), - scrollable)) - .widget( - createUpgradeBox( - 12, - 1, - 2, - new int[] { 11 }, - false, - new int[] { 17 }, - true, - false, - 3, - new Pos2d(66, 476), - scrollable)) - .widget( - createUpgradeBox( - 13, - 2, - 1, - new int[] { 11 }, - false, - new int[] { 18 }, - true, - false, - 3, - new Pos2d(126, 476), - scrollable)) - .widget( - createUpgradeBox( - 14, - 3, - 0, - new int[] { 11 }, - false, - new int[] { 15, 19 }, - true, - false, - 3, - new Pos2d(186, 476), - scrollable)) - .widget( - createUpgradeBox( - 15, - 3, - 1, - new int[] { 14 }, - false, - new int[] {}, - false, - false, - 4, - new Pos2d(246, 496), - scrollable)) - .widget( - createUpgradeBox( - 16, - 1, - 1, - new int[] { 17 }, - false, - new int[] {}, - false, - false, - 4, - new Pos2d(6, 556), - scrollable)) - .widget( - createUpgradeBox( - 17, - 1, - 0, - new int[] { 12 }, - false, - new int[] { 16, 20 }, - false, - false, - 3, - new Pos2d(66, 536), - scrollable)) - .widget( - createUpgradeBox( - 18, - 2, - 1, - new int[] { 13 }, - false, - new int[] { 21 }, - false, - false, - 3, - new Pos2d(126, 536), - scrollable)) - .widget( - createUpgradeBox( - 19, - 3, - 0, - new int[] { 14 }, - false, - new int[] { 22 }, - false, - false, - 3, - new Pos2d(186, 536), - scrollable)) - .widget( - createUpgradeBox( - 20, - 1, - 0, - new int[] { 17 }, - false, - new int[] { 23 }, - false, - false, - 3, - new Pos2d(66, 596), - scrollable)) - .widget( - createUpgradeBox( - 21, - 2, - 1, - new int[] { 18 }, - false, - new int[] { 23 }, - false, - false, - 3, - new Pos2d(126, 596), - scrollable)) - .widget( - createUpgradeBox( - 22, - 3, - 1, - new int[] { 19 }, - false, - new int[] { 23 }, - false, - false, - 3, - new Pos2d(186, 596), - scrollable)) - .widget( - createUpgradeBox( - 23, - 0, - 0, - new int[] { 20, 21, 22 }, - false, - new int[] { 24 }, - false, - false, - 4, - new Pos2d(126, 656), - scrollable)) - .widget( - createUpgradeBox( - 24, - 0, - 1, - new int[] { 23 }, - false, - new int[] { 25 }, - false, - false, - 5, - new Pos2d(126, 718), - scrollable)) - .widget( - createUpgradeBox( - 25, - 0, - 1, - new int[] { 24 }, - false, - new int[] { 26 }, - false, - false, - 6, - new Pos2d(36, 758), - scrollable)) - .widget( - createUpgradeBox( - 26, - 0, - 3, - new int[] { 25 }, - false, - new int[] { 27 }, - false, - true, - 7, - new Pos2d(36, 848), - scrollable)) - .widget( - createUpgradeBox( - 27, - 0, - 2, - new int[] { 26 }, - false, - new int[] { 28 }, - false, - false, - 8, - new Pos2d(126, 888), - scrollable)) - .widget( - createUpgradeBox( - 28, - 0, - 0, - new int[] { 27 }, - false, - new int[] { 29 }, - false, - false, - 9, - new Pos2d(216, 848), - scrollable)) - .widget( - createUpgradeBox( - 29, - 0, - 3, - new int[] { 28 }, - false, - new int[] { 30 }, - false, - true, - 10, - new Pos2d(216, 758), - scrollable)) - .widget( - createUpgradeBox( - 30, - 0, - 3, - new int[] { 29 }, - false, - new int[] {}, - false, - true, - 12, - new Pos2d(126, 798), - scrollable)) - .widget( - new MultiChildWidget().addChild( - new ButtonWidget().setOnClick(((clickData, widget) -> secretUpgrade = !secretUpgrade)) - .setSize(40, 15) - .setBackground(() -> { - if (secretUpgrade) { - return new IDrawable[] { TecTechUITextures.BUTTON_SPACE_PRESSED_32x16 }; - } - return new IDrawable[0]; - }) - .addTooltip(translateToLocal("fog.upgrade.tt.secret")) - .setTooltipShowUpDelay(20)) - .addChild( - new TextWidget(translateToLocal("fog.upgrade.tt.short.secret")).setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.Center) - .setSize(34, 9) - .setPos(3, 4) - .setEnabled((widget -> secretUpgrade))) - .addChild( - new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_BLUE_OPAQUE) - .setEnabled(widget -> secretUpgrade) - .setPos(40, 4) - .setSize(20, 6)) - .setPos(new Pos2d(66, 56))) + .widget(createUpgradeConnectorLine(new Pos2d(143, 71), 45, 0, UpgradeColor.BLUE, START, IGCC)) + .widget(createUpgradeConnectorLine(new Pos2d(124, 124), 60, 27, UpgradeColor.BLUE, IGCC, STEM)) + .widget(createUpgradeConnectorLine(new Pos2d(162, 124), 60, 333, UpgradeColor.BLUE, IGCC, CFCE)) + .widget(createUpgradeConnectorLine(new Pos2d(94, 184), 60, 27, UpgradeColor.BLUE, STEM, GISS)) + .widget(createUpgradeConnectorLine(new Pos2d(130, 184), 60, 336, UpgradeColor.BLUE, STEM, FDIM)) + .widget(createUpgradeConnectorLine(new Pos2d(156, 184), 60, 24, UpgradeColor.BLUE, CFCE, FDIM)) + .widget(createUpgradeConnectorLine(new Pos2d(192, 184), 60, 333, UpgradeColor.BLUE, CFCE, SA)) + .widget(createUpgradeConnectorLine(new Pos2d(143, 251), 45, 0, UpgradeColor.BLUE, FDIM, GPCI)) + .widget(createUpgradeConnectorLine(new Pos2d(143, 311), 45, 0, UpgradeColor.BLUE, GPCI, GEM)) + .widget(createUpgradeConnectorLine(new Pos2d(78, 250), 110, 5, UpgradeColor.RED, GISS, REC)) + .widget(createUpgradeConnectorLine(new Pos2d(110, 290), 80, 40, UpgradeColor.RED, GPCI, REC)) + .widget(createUpgradeConnectorLine(new Pos2d(208, 250), 110, 355, UpgradeColor.RED, SA, CTCDD)) + .widget(createUpgradeConnectorLine(new Pos2d(176, 290), 80, 320, UpgradeColor.RED, GPCI, CTCDD)) + .widget(createUpgradeConnectorLine(new Pos2d(100, 355), 80, 313, UpgradeColor.BLUE, REC, QGPIU)) + .widget(createUpgradeConnectorLine(new Pos2d(186, 355), 80, 47, UpgradeColor.BLUE, CTCDD, QGPIU)) + .widget(createUpgradeConnectorLine(new Pos2d(143, 430), 48, 0, UpgradeColor.ORANGE, QGPIU, TCT)) + .widget(createUpgradeConnectorLine(new Pos2d(143, 490), 48, 0, UpgradeColor.ORANGE, TCT, EPEC)) + .widget(createUpgradeConnectorLine(new Pos2d(143, 550), 48, 0, UpgradeColor.ORANGE, EPEC, POS)) + .widget(createUpgradeConnectorLine(new Pos2d(143, 610), 48, 0, UpgradeColor.ORANGE, POS, NGMS)) + .widget(createUpgradeConnectorLine(new Pos2d(110, 410), 80, 40, UpgradeColor.PURPLE, QGPIU, SEFCP)) + .widget(createUpgradeConnectorLine(new Pos2d(83, 490), 48, 0, UpgradeColor.PURPLE, SEFCP, CNTI)) + .widget(createUpgradeConnectorLine(new Pos2d(83, 550), 48, 0, UpgradeColor.PURPLE, CNTI, NDPE)) + .widget(createUpgradeConnectorLine(new Pos2d(101, 590), 80, 320, UpgradeColor.PURPLE, NDPE, NGMS)) + .widget(createUpgradeConnectorLine(new Pos2d(53, 536), 35, 45, UpgradeColor.PURPLE, CNTI, DOP)) + .widget(createUpgradeConnectorLine(new Pos2d(176, 410), 80, 320, UpgradeColor.GREEN, QGPIU, GGEBE)) + .widget(createUpgradeConnectorLine(new Pos2d(203, 490), 48, 0, UpgradeColor.GREEN, GGEBE, IMKG)) + .widget(createUpgradeConnectorLine(new Pos2d(203, 550), 48, 0, UpgradeColor.GREEN, IMKG, DOR)) + .widget(createUpgradeConnectorLine(new Pos2d(185, 590), 80, 40, UpgradeColor.GREEN, DOR, NGMS)) + .widget(createUpgradeConnectorLine(new Pos2d(233, 476), 35, 315, UpgradeColor.GREEN, GGEBE, TPTP)) + .widget(createUpgradeConnectorLine(new Pos2d(143, 670), 48, 0, UpgradeColor.BLUE, NGMS, SEDS)) + .widget(createUpgradeConnectorLine(new Pos2d(101, 707), 75, 62.3f, UpgradeColor.BLUE, SEDS, PA)) + .widget(createUpgradeConnectorLine(new Pos2d(53, 772), 78, 0, UpgradeColor.BLUE, PA, CD)) + .widget(createUpgradeConnectorLine(new Pos2d(95, 837), 75, 297.7f, UpgradeColor.BLUE, CD, TSE)) + .widget(createUpgradeConnectorLine(new Pos2d(191, 837), 75, 62.3f, UpgradeColor.BLUE, TSE, TBF)) + .widget(createUpgradeConnectorLine(new Pos2d(233, 772), 78, 0, UpgradeColor.BLUE, TBF, EE)) + .widget(createUpgradeConnectorLine(new Pos2d(191, 747), 75, 62.3f, UpgradeColor.BLUE, EE, END)); + // spotless:on + + for (ForgeOfGodsUpgrade upgrade : upgrades.getAllUpgrades()) { + scrollable.widget(createUpgradeBox(upgrade, scrollable)); + } + + scrollable.widget( + new MultiChildWidget().addChild( + new ButtonWidget().setOnClick(((clickData, widget) -> secretUpgrade = !secretUpgrade)) + .setSize(40, 15) + .setBackground(() -> { + if (secretUpgrade) { + return new IDrawable[] { TecTechUITextures.BUTTON_SPACE_PRESSED_32x16 }; + } + return new IDrawable[0]; + }) + .addTooltip(translateToLocal("fog.upgrade.tt.secret")) + .setTooltipShowUpDelay(20)) + .addChild( + new TextWidget(translateToLocal("fog.upgrade.tt.short.secret")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setSize(34, 9) + .setPos(3, 4) + .setEnabled((widget -> secretUpgrade))) + .addChild( + new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_BLUE_OPAQUE) + .setEnabled(widget -> secretUpgrade) + .setPos(40, 4) + .setSize(20, 6)) + .setPos(new Pos2d(66, 56))) .widget(new TextWidget("").setPos(0, 945)); builder.widget( @@ -1984,440 +1557,178 @@ protected ModularWindow createUpgradeTreeWindow(final EntityPlayer player) { if (!widget.isClient()) { widget.getWindow() .closeWindow(); - widget.getContext() - .closeWindow(INDIVIDUAL_UPGRADE_WINDOW_ID); + ForgeOfGodsUI.closeWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID); } }) .setPos(282, 4)); if (ConfigHandler.debug.DEBUG_MODE) { - builder.widget(new MultiChildWidget().addChild(new ButtonWidget().setOnClick((clickData, widget) -> { - upgrades = new boolean[31]; - materialPaidUpgrades = new boolean[7]; - }) - .setSize(40, 15) - .setBackground(GTUITextures.BUTTON_STANDARD) - .addTooltip(translateToLocal("fog.debug.resetbutton.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY)) - .addChild( - new TextWidget(translateToLocal("fog.debug.resetbutton.text")).setTextAlignment(Alignment.Center) - .setScale(0.57f) - .setMaxWidth(36) - .setPos(3, 3)) - .addChild( - new NumericWidget().setSetter(val -> gravitonShardsAvailable = (int) val) - .setGetter(() -> gravitonShardsAvailable) - .setBounds(0, 112) - .setDefaultValue(0) - .setScrollValues(1, 4, 64) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(25, 18) - .setPos(4, 16) - .addTooltip(translateToLocal("fog.debug.gravitonshardsetter.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)) - .addChild( - new ButtonWidget().setOnClick((clickData, widget) -> Arrays.fill(upgrades, true)) - .setSize(40, 15) - .setBackground(GTUITextures.BUTTON_STANDARD) - .addTooltip(translateToLocal("fog.debug.unlockall.text")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(0, 35)) - .addChild( - new TextWidget(translateToLocal("fog.debug.unlockall.text")).setTextAlignment(Alignment.Center) - .setScale(0.57f) - .setMaxWidth(36) - .setPos(3, 38)) - .setPos(4, 4)); - - } - return builder.build(); - } - - protected ModularWindow createIndividualUpgradeWindow(final EntityPlayer player) { - UITexture background; - UITexture overlay; - UITexture milestoneSymbol; - float widthRatio; - switch (currentColorCode) { - case 1 -> { - background = TecTechUITextures.BACKGROUND_GLOW_PURPLE; - overlay = TecTechUITextures.PICTURE_OVERLAY_PURPLE; - } - case 2 -> { - background = TecTechUITextures.BACKGROUND_GLOW_ORANGE; - overlay = TecTechUITextures.PICTURE_OVERLAY_ORANGE; - } - case 3 -> { - background = TecTechUITextures.BACKGROUND_GLOW_GREEN; - overlay = TecTechUITextures.PICTURE_OVERLAY_GREEN; - } - case 4 -> { - background = TecTechUITextures.BACKGROUND_GLOW_RED; - overlay = TecTechUITextures.PICTURE_OVERLAY_RED; - } - default -> { - background = TecTechUITextures.BACKGROUND_GLOW_BLUE; - overlay = TecTechUITextures.PICTURE_OVERLAY_BLUE; - } - } - switch (currentMilestoneBG) { - case 1 -> { - milestoneSymbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CONVERSION; - widthRatio = 0.72f; - } - case 2 -> { - milestoneSymbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CATALYST; - widthRatio = 1f; - } - case 3 -> { - milestoneSymbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_COMPOSITION; - widthRatio = 1f; - } - default -> { - milestoneSymbol = TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CHARGE; - widthRatio = 0.8f; - } - } - int WIDTH = 250; - int HEIGHT = 250; - int LORE_POS = 110; - if (currentUpgradeID == 0 || currentUpgradeID == 30) { - WIDTH = 300; - HEIGHT = 300; - LORE_POS = 85; - } - ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT) - .setBackground(background) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(WIDTH - 15, 3)) - .widget( - new DrawableWidget().setDrawable(milestoneSymbol) - .setPos((int) ((1 - widthRatio / 2) * WIDTH / 2), HEIGHT / 4) - .setSize((int) (WIDTH / 2 * widthRatio), HEIGHT / 2)) - .widget( - new DrawableWidget().setDrawable(overlay) - .setPos(WIDTH / 4, HEIGHT / 4) - .setSize(WIDTH / 2, HEIGHT / 2)) - .widget( + builder.widget( new MultiChildWidget() .addChild( - new TextWidget(translateToLocal("fog.upgrade.tt." + (currentUpgradeID))) - .setTextAlignment(Alignment.Center) - .setDefaultColor(EnumChatFormatting.GOLD) - .setSize(WIDTH - 15, 30) - .setPos(9, 5)) + new ButtonWidget().setOnClick((clickData, widget) -> upgrades.resetAll()) + .setSize(40, 15) + .setBackground(GTUITextures.BUTTON_STANDARD) + .addTooltip(translateToLocal("fog.debug.resetbutton.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) .addChild( - new TextWidget(translateToLocal("fog.upgrade.text." + (currentUpgradeID))) + new TextWidget(translateToLocal("fog.debug.resetbutton.text")) .setTextAlignment(Alignment.Center) - .setDefaultColor(EnumChatFormatting.WHITE) - .setSize(WIDTH - 15, LORE_POS - 30) - .setPos(9, 30)) - .addChild( - new TextWidget( - EnumChatFormatting.ITALIC + translateToLocal("fog.upgrade.lore." + (currentUpgradeID))) - .setTextAlignment(Alignment.Center) - .setDefaultColor(0xbbbdbd) - .setSize(WIDTH - 15, (int) (HEIGHT * 0.9) - LORE_POS) - .setPos(9, LORE_POS)) - .addChild( - new TextWidget( - translateToLocal("gt.blockmachines.multimachine.FOG.shardcost") + " " - + EnumChatFormatting.BLUE - + gravitonShardCost).setTextAlignment(Alignment.Center) - .setScale(0.7f) - .setMaxWidth(70) - .setDefaultColor(0x9c9c9c) - .setPos(11, HEIGHT - 25)) + .setScale(0.57f) + .setMaxWidth(36) + .setPos(3, 3)) .addChild( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.availableshards")) + new NumericWidget().setSetter(val -> gravitonShardsAvailable = (int) val) + .setGetter(() -> gravitonShardsAvailable) + .setBounds(0, 112) + .setDefaultValue(0) + .setScrollValues(1, 4, 64) .setTextAlignment(Alignment.Center) - .setScale(0.7f) - .setMaxWidth(90) - .setDefaultColor(0x9c9c9c) - .setPos(WIDTH - 87, HEIGHT - 25)) + .setTextColor(Color.WHITE.normal) + .setSize(25, 18) + .setPos(4, 16) + .addTooltip(translateToLocal("fog.debug.gravitonshardsetter.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)) .addChild( - TextWidget.dynamicText(this::gravitonShardAmount) - .setTextAlignment(Alignment.Center) - .setScale(0.7f) - .setMaxWidth(90) - .setDefaultColor(0x9c9c9c) - .setPos(WIDTH - 27, HEIGHT - 18))) - .setSize(WIDTH, HEIGHT) - - .widget(new MultiChildWidget().addChild(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!upgrades[currentUpgradeID]) { - completeUpgrade(); - } else { - respecUpgrade(); - } - }) - .setSize(40, 15) - .setBackground(() -> { - if (upgrades[currentUpgradeID]) { - return new IDrawable[] { GTUITextures.BUTTON_STANDARD_PRESSED }; - } else { - return new IDrawable[] { GTUITextures.BUTTON_STANDARD }; - } - }) - .dynamicTooltip(this::constructionStatus) - .setTooltipShowUpDelay(TOOLTIP_DELAY)) - .addChild( - TextWidget.dynamicText(this::constructionStatusText) - .setTextAlignment(Alignment.Center) - .setScale(0.7f) - .setMaxWidth(36) - .setPos(3, 5)) - .setPos(WIDTH / 2 - 21, (int) (HEIGHT * 0.9))); - if (Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .contains(currentUpgradeID)) { - builder.widget(createMaterialInputButton(currentUpgradeID, WIDTH / 2 - 40, (int) (HEIGHT * 0.9), builder)); + new ButtonWidget().setOnClick((clickData, widget) -> upgrades.unlockAll()) + .setSize(40, 15) + .setBackground(GTUITextures.BUTTON_STANDARD) + .addTooltip(translateToLocal("fog.debug.unlockall.text")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(0, 35)) + .addChild( + new TextWidget(translateToLocal("fog.debug.unlockall.text")).setTextAlignment(Alignment.Center) + .setScale(0.57f) + .setMaxWidth(36) + .setPos(3, 38)) + .setPos(4, 4)); + } return builder.build(); } - private void completeUpgrade() { - int unlockedPrereqUpgrades = 0; - int unlockedSplitUpgrades = 0; - if (!upgrades[currentUpgradeID]) { - for (int prereqUpgrade : prereqUpgrades[currentUpgradeID]) { - if (upgrades[prereqUpgrade]) { - unlockedPrereqUpgrades++; - } - } - if (!doesCurrentUpgradeRequireExtraMats - || materialPaidUpgrades[Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .indexOf(currentUpgradeID)]) { - if (allPrereqRequired[currentUpgradeID]) { - if (unlockedPrereqUpgrades == prereqUpgrades[currentUpgradeID].length - && gravitonShardsAvailable >= gravitonShardCost) { - gravitonShardsAvailable -= gravitonShardCost; - gravitonShardsSpent += gravitonShardCost; - upgrades[currentUpgradeID] = true; - } - } else if (unlockedPrereqUpgrades > 0 || prereqUpgrades[currentUpgradeID].length == 0) { - if (isUpradeSplitStart) { - for (int splitUpgrade : FIRST_SPLIT_UPGRADES) { - if (upgrades[splitUpgrade]) { - unlockedSplitUpgrades++; - } - } - unlockedSplitUpgrades -= (ringAmount - 1); - } - if (unlockedSplitUpgrades <= 0 && gravitonShardsAvailable >= gravitonShardCost) { - gravitonShardsAvailable -= gravitonShardCost; - gravitonShardsSpent += gravitonShardCost; - upgrades[currentUpgradeID] = true; - } - } - } - } - } + protected ModularWindow createIndividualUpgradeWindow(final EntityPlayer player) { + ForgeOfGodsUpgrade upgrade = currentUpgradeWindow; - private void respecUpgrade() { - int unlockedFollowupUpgrades = 0; - int unlockedNeighboringUpgrades = 0; - boolean doesFollowupRequireAllPrereqs = false; - boolean canFollowupSpareAConnection = true; + ModularWindow.Builder builder = ModularWindow.builder(upgrade.getWindowSize()); + builder.setBackground(upgrade.getBackground()); - for (int followupUpgrade : followupUpgrades) { - if (upgrades[followupUpgrade]) { - unlockedFollowupUpgrades++; - if (allPrereqRequired[followupUpgrade]) { - doesFollowupRequireAllPrereqs = true; - } - int[] currentPrereqs = prereqUpgrades[followupUpgrade]; - for (int prereqUpgrade : currentPrereqs) { - if (upgrades[prereqUpgrade]) { - unlockedNeighboringUpgrades++; - } - } - if (unlockedNeighboringUpgrades <= 1) { - canFollowupSpareAConnection = false; - } - } + // Syncers + builder.widget( + new FakeSyncWidget.IntegerSyncer(() -> gravitonShardsAvailable, val -> gravitonShardsAvailable = val)); + builder.widget(upgrades.getSyncer(upgrade)); - unlockedNeighboringUpgrades = 0; + builder.widget( + ForgeOfGodsUI.getIndividualUpgradeGroup( + upgrade, + () -> gravitonShardsAvailable, + () -> completeUpgrade(upgrade), + () -> respecUpgrade(upgrade), + () -> isUpgradeActive(upgrade))); + + if (upgrade.hasExtraCost()) { + builder.widget( + ForgeOfGodsUI + .createMaterialInputButton(upgrade, () -> upgrades.isCostPaid(upgrade), (clickData, widget) -> { + ForgeOfGodsUI.reopenWindow(widget, MANUAL_INSERTION_WINDOW_ID); + ForgeOfGodsUI.closeWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID); + ForgeOfGodsUI.closeWindow(widget, UPGRADE_TREE_WINDOW_ID); + })); } - if (!doesFollowupRequireAllPrereqs && followupUpgrades.length > 0 && canFollowupSpareAConnection) { - unlockedFollowupUpgrades = 0; - } + return builder.build(); + } - if (unlockedFollowupUpgrades == 0) { - gravitonShardsAvailable += gravitonShardCost; - gravitonShardsSpent -= gravitonShardCost; - upgrades[currentUpgradeID] = false; + // todo ringAmount is not client synced, causing a UI desync when unlocking split upgrades + private void completeUpgrade(ForgeOfGodsUpgrade upgrade) { + if (isUpgradeActive(upgrade)) return; + if (!upgrades.checkPrerequisites(upgrade)) return; + if (!upgrades.checkSplit(upgrade, ringAmount)) return; + if (!upgrades.checkCost(upgrade, gravitonShardsAvailable)) return; - if (currentUpgradeID == 30) { - gravitonShardEjection = false; - } - } + upgrades.unlockUpgrade(upgrade); + gravitonShardsAvailable -= upgrade.getShardCost(); + gravitonShardsSpent += upgrade.getShardCost(); } - private Widget createMaterialInputButton(int upgradeID, int xCoord, int yCoord, IWidgetBuilder builder) { - return new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient() && doesCurrentUpgradeRequireExtraMats) { - ModularUIContext ctx = widget.getContext(); - ctx.openSyncedWindow(MANUAL_INSERTION_WINDOW_ID); - ctx.closeWindow(INDIVIDUAL_UPGRADE_WINDOW_ID); - ctx.closeWindow(UPGRADE_TREE_WINDOW_ID); - } - }) - .setPlayClickSound(doesCurrentUpgradeRequireExtraMats) - .setBackground(() -> { - if (doesCurrentUpgradeRequireExtraMats) { - if (materialPaidUpgrades[Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .indexOf(upgradeID)]) { - return new IDrawable[] { TecTechUITextures.BUTTON_BOXED_CHECKMARK_18x18 }; - } else { - return new IDrawable[] { TecTechUITextures.BUTTON_BOXED_EXCLAMATION_POINT_18x18 }; - } - } else { - return new IDrawable[] { GTUITextures.TRANSPARENT }; - } - }) - .setPos(xCoord, yCoord) - .setSize(15, 15) - .dynamicTooltip(this::upgradeMaterialRequirements) - .addTooltip(EnumChatFormatting.GRAY + translateToLocal("fog.button.materialrequirements.tooltip.clickhere")) - .attachSyncer( - new FakeSyncWidget.BooleanSyncer( - () -> materialPaidUpgrades[Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .indexOf(upgradeID)], - val -> materialPaidUpgrades[Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .indexOf(upgradeID)] = val), - builder); + private void respecUpgrade(ForgeOfGodsUpgrade upgrade) { + if (!isUpgradeActive(upgrade)) return; + if (!upgrades.checkDependents(upgrade)) return; + + upgrades.respecUpgrade(upgrade); + gravitonShardsAvailable += upgrade.getShardCost(); + gravitonShardsSpent -= upgrade.getShardCost(); + + if (upgrade == END) { + gravitonShardEjection = false; + } } - /** - * @param upgradeID ID of the upgrade - * @param colorCode Number deciding which colored background to use, 0 for blue, 1 for purple, 2 for - * orange and 3 for green - * @param milestone Number deciding which milestone symbol to display in the background, 0 for charge, - * 1 for conversion, 2 for catalyst and 3 for composition - * @param prerequisiteUpgradeIDs IDs of the prior upgrades directly connected to the current one - * @param requireAllPrerequisites Decides how many connected prerequisite upgrades have to be unlocked to be able to - * unlock this one. True means ALL, False means AT LEAST ONE - * @param followingUpgradeIDs IDs of the following upgrades directly connected to the current one - * @param isStartOfSplit Whether this upgrade is one of the initial split upgrades - * @param requiresExtraMaterials Whether this upgrade requires materials other than graviton shards to unlock - * @param shardCost How many graviton shards are needed to unlock this upgrade - * @param pos Position of the upgrade inside the scrollableWidget - */ - private Widget createUpgradeBox(int upgradeID, int colorCode, int milestone, int[] prerequisiteUpgradeIDs, - boolean requireAllPrerequisites, int[] followingUpgradeIDs, boolean isStartOfSplit, - boolean requiresExtraMaterials, int shardCost, Pos2d pos, IWidgetBuilder builder) { - prereqUpgrades[upgradeID] = prerequisiteUpgradeIDs; - allPrereqRequired[upgradeID] = requireAllPrerequisites; + private Widget createUpgradeBox(ForgeOfGodsUpgrade upgrade, IWidgetBuilder builder) { return new MultiChildWidget().addChild(new ButtonWidget().setOnClick((clickData, widget) -> { - currentUpgradeID = upgradeID; - currentColorCode = colorCode; - currentMilestoneBG = milestone; - gravitonShardCost = shardCost; - followupUpgrades = followingUpgradeIDs; - isUpradeSplitStart = isStartOfSplit; - doesCurrentUpgradeRequireExtraMats = requiresExtraMaterials; + currentUpgradeWindow = upgrade; if (clickData.mouseButton == 0) { if (clickData.shift) { - if (!doesCurrentUpgradeRequireExtraMats - || materialPaidUpgrades[Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .indexOf(currentUpgradeID)]) { - completeUpgrade(); - } else if (!widget.isClient()) { - ModularUIContext ctx = widget.getContext(); - ctx.openSyncedWindow(MANUAL_INSERTION_WINDOW_ID); - ctx.closeWindow(INDIVIDUAL_UPGRADE_WINDOW_ID); - ctx.closeWindow(UPGRADE_TREE_WINDOW_ID); + if (!upgrade.hasExtraCost() || upgrades.isCostPaid(upgrade)) { + completeUpgrade(upgrade); + } else { + ForgeOfGodsUI.reopenWindow(widget, MANUAL_INSERTION_WINDOW_ID); + ForgeOfGodsUI.closeWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID); + ForgeOfGodsUI.closeWindow(widget, UPGRADE_TREE_WINDOW_ID); } } else { ForgeOfGodsUI.reopenWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID); } } else if (clickData.mouseButton == 1) { - respecUpgrade(); + respecUpgrade(upgrade); } }) .setSize(40, 15) .setBackground(() -> { - if (upgrades[upgradeID]) { + if (isUpgradeActive(upgrade)) { return new IDrawable[] { TecTechUITextures.BUTTON_SPACE_PRESSED_32x16 }; } else { return new IDrawable[] { TecTechUITextures.BUTTON_SPACE_32x16 }; } }) - .addTooltip(translateToLocal("fog.upgrade.tt." + upgradeID)) + .addTooltip(upgrade.getNameText()) .setTooltipShowUpDelay(TOOLTIP_DELAY)) .addChild( - new TextWidget(translateToLocal("fog.upgrade.tt.short." + upgradeID)).setScale(0.8f) + new TextWidget(upgrade.getShortNameText()).setScale(0.8f) .setDefaultColor(EnumChatFormatting.GOLD) .setTextAlignment(Alignment.Center) .setSize(34, 9) .setPos(3, 4)) - .setPos(pos) - .attachSyncer( - new FakeSyncWidget.BooleanSyncer(() -> upgrades[upgradeID], val -> upgrades[upgradeID] = val), - builder); + .setPos(upgrade.getTreePos()) + .attachSyncer(upgrades.getSyncer(upgrade), builder); } - private Widget createUpgradeConnectorLine(Pos2d pos, int length, float rotationAngle, int colorCode, - int startUpgradeID, int endUpgradeID) { - return new DrawableWidget() - .setDrawable( - () -> (upgrades[startUpgradeID] && upgrades[endUpgradeID]) - ? coloredLine(colorCode, true).withRotationDegree(rotationAngle) - : coloredLine(colorCode, false).withRotationDegree(rotationAngle)) + private Widget createUpgradeConnectorLine(Pos2d pos, int length, float rotationAngle, UpgradeColor color, + ForgeOfGodsUpgrade startUpgrade, ForgeOfGodsUpgrade endUpgrade) { + return new DrawableWidget().setDrawable(() -> { + UITexture texture = color.getConnector(); + if (isUpgradeActive(startUpgrade) && isUpgradeActive(endUpgrade)) { + texture = color.getOpaqueConnector(); + } + return texture.withRotationDegree(rotationAngle); + }) .setPos(pos) .setSize(6, length); } - private IDrawable coloredLine(int colorCode, boolean opaque) { - IDrawable line; - switch (colorCode) { - case 1 -> { - line = opaque ? TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_PURPLE_OPAQUE - : TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_PURPLE; - } - case 2 -> { - line = opaque ? TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_ORANGE_OPAQUE - : TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_ORANGE; - } - case 3 -> { - line = opaque ? TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_GREEN_OPAQUE - : TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_GREEN; - } - case 4 -> { - line = opaque ? TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_RED_OPAQUE - : TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_RED; - } - default -> { - line = opaque ? TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_BLUE_OPAQUE - : TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_BLUE; - } - } - return line; - } - protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { - ItemStack[] inputs = godforgeUpgradeMats.get(currentUpgradeID); + ForgeOfGodsUpgrade upgrade = currentUpgradeWindow; + ItemStack[] inputs = upgrade.getExtraCost(); final int WIDTH = 189; final int HEIGHT = 106; final int PARENT_WIDTH = getGUIWidth(); final int PARENT_HEIGHT = getGUIHeight(); - final MultiChildWidget columns = new MultiChildWidget(); - final DynamicPositionedColumn column1 = new DynamicPositionedColumn(); - final DynamicPositionedColumn column2 = new DynamicPositionedColumn(); - final DynamicPositionedColumn column3 = new DynamicPositionedColumn(); - final DynamicPositionedColumn column4 = new DynamicPositionedColumn(); - final DynamicPositionedColumn column5 = new DynamicPositionedColumn(); - final DynamicPositionedColumn column6 = new DynamicPositionedColumn(); for (int i = 0; i < 16; i++) { inputSlotHandler.insertItem(i, storedUpgradeWindowItems[i], false); storedUpgradeWindowItems[i] = null; } - List columnList = Arrays.asList(column1, column2, column3, column4, column5, column6); ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); builder.setBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); @@ -2427,6 +1738,7 @@ protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { .add(Alignment.TopRight.getAlignedPos(new Size(PARENT_WIDTH, PARENT_HEIGHT), new Size(WIDTH, HEIGHT))) .subtract(5, 0) .add(0, 4)); + builder.widget(upgrades.getSyncer(upgrade)); builder.widget( SlotGroup.ofItemHandler(inputSlotHandler, 4) .startFromSlot(0) @@ -2439,10 +1751,8 @@ protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { if (!widget.isClient()) { widget.getWindow() .closeWindow(); - widget.getContext() - .openSyncedWindow(UPGRADE_TREE_WINDOW_ID); - widget.getContext() - .openSyncedWindow(INDIVIDUAL_UPGRADE_WINDOW_ID); + ForgeOfGodsUI.reopenWindow(widget, UPGRADE_TREE_WINDOW_ID); + ForgeOfGodsUI.reopenWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID); } }) .setBackground(ModularUITextures.VANILLA_BACKGROUND, new Text("x")) @@ -2450,26 +1760,8 @@ protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { .setSize(10, 10)); builder.widget(new MultiChildWidget().addChild(new ButtonWidget().setOnClick((clickData, widget) -> { if (!widget.isClient()) { - ArrayList list = new ArrayList<>(inputSlotHandler.getStacks()); - list.removeIf(Objects::isNull); - int foundInputs = 0; - int[] foundInputIndices = new int[inputs.length]; - for (ItemStack inputStack : list) { - for (ItemStack requiredStack : inputs) { - if (ItemStack.areItemStacksEqual(requiredStack, inputStack)) { - foundInputIndices[foundInputs] = inputSlotHandler.getStacks() - .indexOf(inputStack); - foundInputs++; - } - } - } - if (foundInputs == inputs.length) { - for (int index : foundInputIndices) { - inputSlotHandler.extractItem(index, inputSlotHandler.getStackInSlot(index).stackSize, false); - } - materialPaidUpgrades[Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .indexOf(currentUpgradeID)] = true; - } + upgrades.payCost(upgrade, inputSlotHandler); + ForgeOfGodsUI.reopenWindow(widget, MANUAL_INSERTION_WINDOW_ID); } }) .setPlayClickSound(true) @@ -2484,59 +1776,17 @@ protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { .setPos(5, 82) .setSize(179, 16)); - IItemHandlerModifiable upgradeMatsHandler = new ItemStackHandler(12); - int uniqueItems = inputs.length; for (int i = 0; i < 12; i++) { - int cleanDiv4 = i / 4; - if (i < uniqueItems) { - ItemStack stack = inputs[i]; - if (stack != null) { - upgradeMatsHandler.setStackInSlot(i, stack.copy()); - } - builder.widget( - new DrawableWidget().setDrawable(GTUITextures.BUTTON_STANDARD_PRESSED) - .setPos(5 + cleanDiv4 * 36, 6 + i % 4 * 18) - .setSize(18, 18)); - columnList.get(cleanDiv4) - .addChild( - new SlotWidget(upgradeMatsHandler, i).setAccess(false, false) - .setRenderStackSize(false) - .disableInteraction()); - columnList.get(cleanDiv4 + 3) - .addChild( - new TextWidget("x" + inputs[i].stackSize).setTextAlignment(Alignment.CenterLeft) - .setScale(0.8f) - .setSize(18, 8)); - } else { - builder.widget( - new DrawableWidget().setDrawable(GTUITextures.BUTTON_STANDARD_DISABLED) - .setPos(5 + cleanDiv4 * 36, 6 + i % 4 * 18) - .setSize(18, 18)); - } - } - - int counter = 0; - for (DynamicPositionedColumn column : columnList) { - int spacing = 0; - int xCord = counter * 36; - int yCord = 0; - if (counter > 2) { - spacing = 10; - xCord = 19 + (counter - 3) * 36; - yCord = 5; + final int ii = i; + ItemStack stack = null; + if (i < inputs.length) { + stack = inputs[i]; } - columns.addChild( - column.setSpace(spacing) - .setAlignment(MainAxisAlignment.SPACE_BETWEEN) - .setSize(16, 72) - .setPos(xCord, yCord)); - counter++; + Widget costWidget = ForgeOfGodsUI.createExtraCostWidget(stack, () -> upgrades.getPaidCosts(upgrade)[ii]); + costWidget.setPos(5 + (36 * (i / 4)), 6 + (18 * (i % 4))); + builder.widget(costWidget); } - builder.widget( - columns.setSize(108, 72) - .setPos(5, 6)); - return builder.build(); } @@ -2545,119 +1795,7 @@ protected ModularWindow createGeneralInfoWindow(final EntityPlayer player) { } protected ModularWindow createSpecialThanksWindow(final EntityPlayer player) { - final int WIDTH = 200; - final int HEIGHT = 200; - ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); - - builder.setBackground(TecTechUITextures.BACKGROUND_GLOW_RAINBOW); - builder.setDraggable(true); - builder.widget( - ButtonWidget.closeWindowButton(true) - .setPos(184, 4)) - .widget( - new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_GODFORGE_THANKS) - .setPos(50, 50) - .setSize(100, 100)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.contributors")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.Center) - .setScale(1f) - .setPos(0, 5) - .setSize(200, 15)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.lead")) - .setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 30) - .setSize(60, 10)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.cloud")).setScale(0.8f) - .setDefaultColor(EnumChatFormatting.AQUA) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 40) - .setSize(60, 10)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.programming")) - .setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 55) - .setSize(60, 10)) - .widget( - new TextWidget( - translateToLocal("gt.blockmachines.multimachine.FOG.serenibyss") + " " - + EnumChatFormatting.DARK_AQUA - + translateToLocal("gt.blockmachines.multimachine.FOG.teg")).setScale(0.8f) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 67) - .setSize(60, 10)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.textures")) - .setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 85) - .setSize(100, 10)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.ant")).setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GREEN) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 95) - .setSize(60, 10)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.rendering")) - .setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 110) - .setSize(100, 10)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.bucket")).setScale(0.8f) - .setDefaultColor(EnumChatFormatting.WHITE) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 120) - .setSize(60, 10)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.lore")) - .setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 135) - .setSize(100, 10)) - .widget( - delenoName().setSpace(-1) - .setAlignment(MainAxisAlignment.SPACE_BETWEEN) - .setPos(7, 145) - .setSize(60, 10)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.playtesting")) - .setScale(0.8f) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 160) - .setSize(100, 10)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.misi")).setScale(0.8f) - .setDefaultColor(0xffc26f) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 170) - .setSize(60, 10)) - .widget( - new TextWidget(EnumChatFormatting.ITALIC + translateToLocal("gt.blockmachines.multimachine.FOG.thanks")) - .setScale(0.8f) - .setDefaultColor(0xbbbdbd) - .setTextAlignment(Alignment.Center) - .setPos(90, 140) - .setSize(100, 60)); - return builder.build(); + return ForgeOfGodsUI.createSpecialThanksWindow(); } protected ModularWindow createStarCosmeticsWindow(final EntityPlayer player) { @@ -2669,8 +1807,6 @@ protected ModularWindow createStarCosmeticsWindow(final EntityPlayer player) { // Syncers builder.widget(new FakeSyncWidget.StringSyncer(() -> selectedStarColor, val -> selectedStarColor = val)); - builder.widget(new FakeSyncWidget.IntegerSyncer(() -> rotationSpeed, val -> rotationSpeed = val)); - builder.widget(new FakeSyncWidget.IntegerSyncer(() -> starSize, val -> starSize = val)); builder.widget(new FakeSyncWidget.IntegerSyncer(() -> editingStarIndex, val -> editingStarIndex = val)); builder.widget(starColors.getSyncer()); @@ -2740,50 +1876,73 @@ protected ModularWindow createStarCosmeticsWindow(final EntityPlayer player) { builder.widget(newPreset); - // Miscellaneous options not related to color settings - builder - .widget( - new TextWidget(EnumChatFormatting.UNDERLINE + translateToLocal("fog.cosmetics.misc")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(120, 25) - .setSize(80, 10)) - .widget( - TextWidget.localised("fog.cosmetics.spin") - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(120, 45) - .setSize(60, 18)) - .widget( - new NumericWidget().setSetter(val -> rotationSpeed = (int) val) - .setGetter(() -> rotationSpeed) - .setBounds(0, 100) - .setDefaultValue(5) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(35, 18) - .setPos(155, 45) - .addTooltip(translateToLocal("fog.cosmetics.onlyintegers")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)) - .widget( - TextWidget.localised("fog.cosmetics.size") - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(120, 65) - .setSize(60, 18)) - .widget( - new NumericWidget().setSetter(val -> starSize = (int) val) - .setGetter(() -> starSize) - .setBounds(1, 40) - .setDefaultValue(20) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(35, 18) - .setPos(155, 65) - .addTooltip(translateToLocal("fog.cosmetics.onlyintegers")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)); + // Misc Section + + // Header + builder.widget( + new TextWidget(EnumChatFormatting.UNDERLINE + translateToLocal("fog.cosmetics.misc")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(120, 25) + .setSize(80, 10)); + + // Spin Textbox + builder.widget( + TextWidget.localised("fog.cosmetics.spin") + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(120, 45) + .setSize(60, 18)); + + NumericWidget rotationWidget = new NumericWidget(); + rotationWidget.setGetter(() -> rotationSpeed) + .setSetter(val -> { + if (rotationSpeed != (int) val) { + rotationSpeed = (int) val; + if (!rotationWidget.isClient()) { + updateRenderer(); + } + } + }) + .setBounds(0, 100) + .setDefaultValue(5) + .setTextAlignment(Alignment.Center) + .setTextColor(Color.WHITE.normal) + .setSize(35, 18) + .setPos(155, 45) + .addTooltip(translateToLocal("fog.cosmetics.onlyintegers")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD); + builder.widget(rotationWidget); + + // Size Textbox + builder.widget( + TextWidget.localised("fog.cosmetics.size") + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(120, 65) + .setSize(60, 18)); + + NumericWidget spinWidget = new NumericWidget(); + spinWidget.setGetter(() -> starSize) + .setSetter(val -> { + if (starSize != (int) val) { + starSize = (int) val; + if (!spinWidget.isClient()) { + updateRenderer(); + } + } + }) + .setBounds(1, 40) + .setDefaultValue(20) + .setTextAlignment(Alignment.Center) + .setTextColor(Color.WHITE.normal) + .setSize(35, 18) + .setPos(155, 65) + .addTooltip(translateToLocal("fog.cosmetics.onlyintegers")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD); + builder.widget(spinWidget); return builder.build(); } @@ -3315,18 +2474,199 @@ private void openCustomStarColorWindowFresh(Widget widget, @Nullable ForgeOfGods } } - private DynamicPositionedRow delenoName() { - DynamicPositionedRow nameRow = new DynamicPositionedRow(); - String deleno = translateToLocal("gt.blockmachines.multimachine.FOG.deleno"); - int[] colors = new int[] { 0xffffff, 0xf6fff5, 0xecffec, 0xe3ffe2, 0xd9ffd9, 0xd0ffcf }; + protected ModularWindow createStatisticsWindow(final EntityPlayer player) { + final int WIDTH = 300; + final int HEIGHT = 300; + ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); + builder.setBackground(TecTechUITextures.BACKGROUND_GLOW_WHITE); + builder.setDraggable(true); - for (int i = 0; i < 6; i++) { - nameRow.addChild( - new TextWidget(Character.toString(deleno.charAt(i))).setDefaultColor(colors[i]) - .setScale(0.8f) - .setTextAlignment(Alignment.CenterLeft)); + builder + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.modulestats")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setScale(1f) + .setPos(0, 8) + .setSize(300, 15)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.heat")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(12, 56) + .setSize(69, 30) + .addTooltip(translateToLocal("fog.text.tooltip.heat")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.effectiveheat")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(12, 86) + .setSize(69, 30) + .addTooltip(translateToLocal("fog.text.tooltip.effectiveheat")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.parallel")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(12, 116) + .setSize(69, 30) + .addTooltip(translateToLocal("fog.text.tooltip.parallel")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.speedbonus")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(12, 146) + .setSize(69, 30) + .addTooltip(translateToLocal("fog.text.tooltip.speedbonus")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.energydiscount")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(12, 176) + .setSize(69, 30) + .addTooltip(translateToLocal("fog.text.tooltip.energydiscount")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.ocdivisor")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(12, 206) + .setSize(69, 30) + .addTooltip(translateToLocal("fog.text.tooltip.ocdivisor")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.powerforge")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(88, 40) + .setSize(40, 10)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.meltingcore")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(141, 40) + .setSize(40, 10)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.plasmafab")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(193, 40) + .setSize(44, 10)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.exoticizer")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setPos(246, 43) + .setSize(40, 10)); + + // Vertical grid lines + for (int i = 0; i < 4; i++) { + builder.widget( + new DrawableWidget().setDrawable(new Rectangle().setColor(Color.rgb(190, 200, 0))) + .setSize(1, 197) + .setPos(81 + 53 * i, 38)); + } + + // Horizontal grid lines + for (int i = 0; i < 7; i++) { + builder.widget( + new DrawableWidget().setDrawable(new Rectangle().setColor(Color.rgb(0, 170, 170))) + .setSize(276, 1) + .setPos(12, 55 + 30 * i)); + } + + MTESmeltingModule smelting = new MTESmeltingModule("smelting"); + MTEMoltenModule molten = new MTEMoltenModule("molten"); + MTEPlasmaModule plasma = new MTEPlasmaModule("plasma"); + MTEExoticModule exotic = new MTEExoticModule("exotic"); + + builder.widget( + new FakeSyncWidget.ByteSyncer( + () -> (byte) formattingMode.ordinal(), + val -> formattingMode = MilestoneFormatter.VALUES[MathHelper + .clamp_int(val, 0, MilestoneFormatter.VALUES.length - 1)])); + builder + .widget(new FakeSyncWidget.IntegerSyncer(() -> fuelConsumptionFactor, val -> fuelConsumptionFactor = val)); + builder.widget(upgrades.getFullSyncer()); + + for (int i = 0; i < 24; i++) { + MTEBaseModule module; + switch (i % 4) { + case 1 -> { + module = molten; + } + case 2 -> { + module = plasma; + } + case 3 -> { + module = exotic; + } + default -> { + module = smelting; + } + } + + int cleanDiv4 = i / 4; + String relevantInfo; + switch (cleanDiv4) { + case 1 -> { + calculateMaxHeatForModules(module, this); + relevantInfo = String.valueOf(formattingMode.format(module.getHeatForOC())); + } + case 2 -> { + calculateMaxParallelForModules(module, this); + relevantInfo = String.valueOf(formattingMode.format(module.getMaxParallel())); + } + case 3 -> { + calculateSpeedBonusForModules(module, this); + relevantInfo = String.valueOf(formatNumbers(module.getSpeedBonus())); + } + case 4 -> { + calculateEnergyDiscountForModules(module, this); + relevantInfo = String.valueOf(formatNumbers(module.getEnergyDiscount())); + } + case 5 -> { + setMiscModuleParameters(module, this); + relevantInfo = String.valueOf(formatNumbers(module.getOverclockTimeFactor())); + } + default -> { + calculateMaxHeatForModules(module, this); + relevantInfo = String.valueOf(formattingMode.format(module.getHeat())); + } + } + + builder.widget( + new MultiChildWidget().addChild( + new ButtonWidget().setOnClick((clickData, widget) -> {}) + .setSize(53, 30)) + .addChild( + new DynamicTextWidget(() -> new Text(relevantInfo)).setScale(1f) + .setDefaultColor(EnumChatFormatting.GREEN) + .setTextAlignment(Alignment.Center) + .setSize(53, 30)) + .setPos(81 + (i % 4) * 53, 55 + (i / 4 * 30))); } - return nameRow; + + builder.widget( + ButtonWidget.closeWindowButton(true) + .setPos(284, 4)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (clickData.mouseButton == 0) { + formattingMode = formattingMode.cycle(); + ForgeOfGodsUI.reopenWindow(widget, STATISTICS_WINDOW_ID); + } + }) + .setSize(20, 20) + .addTooltip(translateToLocal("fog.button.formatting.tooltip")) + .setBackground(TecTechUITextures.OVERLAY_CYCLIC_BLUE) + .setPos(8, 272) + .setTooltipShowUpDelay(TOOLTIP_DELAY)); + + return builder.build(); } @Override @@ -3352,117 +2692,40 @@ public MultiblockTooltipBuilder createTooltip() { + "which influences all of its functions,") .addInfo( "such as " + EnumChatFormatting.GOLD - + "unlocking new module types, increasing heat levels " + + "unlocking new module types" + + EnumChatFormatting.GRAY + + ", " + + EnumChatFormatting.GOLD + + "increasing heat levels " + EnumChatFormatting.GRAY + "and " + EnumChatFormatting.GOLD + "granting") .addInfo( - EnumChatFormatting.GOLD + "various processing speed bonuses. " + EnumChatFormatting.GOLD + "various processing speed bonuses" + + EnumChatFormatting.GRAY + + ". " + EnumChatFormatting.GRAY + "These upgrades can be unlocked by reaching") .addInfo("certain milestones and/or spending materials.") .addSeparator(EnumChatFormatting.AQUA, 73) .addInfo( EnumChatFormatting.GREEN - + "Clicking on the logo in the controller gui opens an extensive information window,") + + "Clicking on the logo in the controller gui opens an extensive information window" + + EnumChatFormatting.GRAY + + ",") .addInfo("explaining everything there is to know about this multiblock.") .beginStructureBlock(127, 29, 186, false) + .addStructureInfo("Total blocks needed for the structure with " + getRingText("1", "2", "3") + "rings:") .addStructureInfo( - "Total blocks needed for the structure with " + EnumChatFormatting.DARK_PURPLE - + "1" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "2" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "3" - + EnumChatFormatting.GRAY - + " rings:") - .addStructureInfo( - EnumChatFormatting.DARK_PURPLE + "3943" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "7279" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "11005" - + EnumChatFormatting.GRAY - + " Transcendentally Amplified Magnetic Confinement Casing") + getRingText("3943", "7279", "11005") + "Transcendentally Amplified Magnetic Confinement Casing") + .addStructureInfo(getRingText("2819", "4831", "6567") + "Singularity Reinforced Stellar Shielding Casing") + .addStructureInfo(getRingText("272", "512", "824") + "Celestial Matter Guidance Casing") + .addStructureInfo(getRingText("130", "144", "158") + "Boundless Gravitationally Severed Structure Casing") + .addStructureInfo(getRingText("9", "54", "155") + "Spatially Transcendent Gravitational Lens Block") .addStructureInfo( - EnumChatFormatting.DARK_PURPLE + "2819" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "4831" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "6567" - + EnumChatFormatting.GRAY - + " Singularity Reinforced Stellar Shielding Casing") - .addStructureInfo( - EnumChatFormatting.DARK_PURPLE + "272" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "512" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "824" - + EnumChatFormatting.GRAY - + " Celestial Matter Guidance Casing") - .addStructureInfo( - EnumChatFormatting.DARK_PURPLE + "130" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "144" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "158" - + EnumChatFormatting.GRAY - + " Boundless Gravitationally Severed Structure Casing") - .addStructureInfo( - EnumChatFormatting.DARK_PURPLE + "9" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "54" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "155" - + EnumChatFormatting.GRAY - + " Spatially Transcendent Gravitational Lens Block") - .addStructureInfo( - EnumChatFormatting.DARK_PURPLE + "345" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "357" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "397" - + EnumChatFormatting.DARK_PURPLE - + " Remote" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.DARK_GREEN - + "Medial" - + EnumChatFormatting.GRAY - + "/" - + EnumChatFormatting.AQUA - + "Central" - + EnumChatFormatting.GRAY - + " Graviton Flow Modulator") + getRingText("345", "357", "397") + getRingText("Remote", "Medial", "Central") + + "Graviton Flow Modulator") .addStructureInfo( EnumChatFormatting.GOLD + "36" + EnumChatFormatting.GRAY + " Stellar Energy Siphon Casing") .addStructureInfoSeparator() @@ -3473,6 +2736,20 @@ public MultiblockTooltipBuilder createTooltip() { return tt; } + private static String getRingText(String oneRing, String twoRings, String threeRings) { + return EnumChatFormatting.DARK_PURPLE + oneRing + + EnumChatFormatting.GRAY + + "/" + + EnumChatFormatting.DARK_GREEN + + twoRings + + EnumChatFormatting.GRAY + + "/" + + EnumChatFormatting.AQUA + + threeRings + + EnumChatFormatting.GRAY + + " "; + } + @Override public boolean energyFlowOnRunningTick(ItemStack aStack, boolean allowProduction) { return true; @@ -3497,8 +2774,8 @@ public int getFuelFactor() { return fuelConsumptionFactor; } - public boolean isUpgradeActive(int upgradeID) { - return upgrades[upgradeID]; + public boolean isUpgradeActive(ForgeOfGodsUpgrade upgrade) { + return upgrades.isUpgradeActive(upgrade); } public int getRingAmount() { @@ -3506,41 +2783,25 @@ public int getRingAmount() { } public int getTotalActiveUpgrades() { - int totalUpgrades = 0; - for (boolean upgrade : upgrades) { - if (upgrade) { - totalUpgrades++; - } - } - return totalUpgrades; + return upgrades.getTotalActiveUpgrades(); } private Text fuelUsage() { return new Text(fuelConsumption + " L/5s"); } - private Text gravitonShardAmount() { - EnumChatFormatting enoughGravitonShards = EnumChatFormatting.RED; - if (gravitonShardsAvailable >= gravitonShardCost) { - enoughGravitonShards = EnumChatFormatting.GREEN; + private Text storedFuel() { + if (internalBattery == 0) { + return new Text(stellarFuelAmount + "/" + neededStartupFuel); } - return new Text(enoughGravitonShards + Integer.toString(gravitonShardsAvailable)); - + return new Text(internalBattery + "/" + maxBatteryCharge); } - private Text storedFuel() { + private Text storedFuelHeaderText() { if (internalBattery == 0) { - return new Text( - translateToLocal("gt.blockmachines.multimachine.FOG.storedstartupfuel") + " " - + stellarFuelAmount - + "/" - + neededStartupFuel); + return new Text(translateToLocal("gt.blockmachines.multimachine.FOG.storedstartupfuel")); } - return new Text( - translateToLocal("gt.blockmachines.multimachine.FOG.storedfuel") + " " - + internalBattery - + "/" - + maxBatteryCharge); + return new Text(translateToLocal("gt.blockmachines.multimachine.FOG.storedfuel")); } private void checkInversionStatus() { @@ -3712,9 +2973,11 @@ private void ejectGravitonShards() { while (gravitonShardsAvailable >= 64) { addOutput(GTOreDictUnificator.get(OrePrefixes.gem, MaterialsUEVplus.GravitonShard, 64)); gravitonShardsAvailable -= 64; + gravitonShardsSpent += 64; } addOutput( GTOreDictUnificator.get(OrePrefixes.gem, MaterialsUEVplus.GravitonShard, gravitonShardsAvailable)); + gravitonShardsSpent += gravitonShardsAvailable; gravitonShardsAvailable = 0; } } @@ -3730,47 +2993,6 @@ private Text gravitonShardAmountText(int milestoneID) { translateToLocal("gt.blockmachines.multimachine.FOG.shardgain") + ": " + EnumChatFormatting.GRAY + sum); } - private enum FormattingMode { - - NONE, - COMMA, - EXPONENT; - - static final FormattingMode[] VALUES = values(); - - FormattingMode cycle() { - return switch (this) { - case NONE -> COMMA; - case COMMA -> EXPONENT; - case EXPONENT -> NONE; - }; - } - - String format(Number number) { - return switch (this) { - case NONE -> number.toString(); - case COMMA -> { - if (number instanceof BigInteger bi) yield formatNumbers(bi); - else yield formatNumbers(number.longValue()); - } - case EXPONENT -> { - if (number instanceof BigInteger bi) { - if (bi.compareTo(BigInteger.valueOf(1_000L)) > 0) { - yield toExponentForm(bi); - } - yield bi.toString(); - } else { - long value = number.longValue(); - if (value > 1_000L) { - yield toExponentForm(value); - } - yield Long.toString(value); - } - } - }; - } - } - private Text totalMilestoneProgress(int milestoneID) { Number progress; String suffix; @@ -3815,7 +3037,7 @@ private Text milestoneProgressText(int milestoneID) { String progressText = translateToLocal("gt.blockmachines.multimachine.FOG.progress"); Text done = new Text( translateToLocal("gt.blockmachines.multimachine.FOG.milestonecomplete") - + (formattingMode != FormattingMode.NONE ? EnumChatFormatting.DARK_RED + "?" : "")); + + (formattingMode != DEFAULT_FORMATTING_MODE ? EnumChatFormatting.DARK_RED + "?" : "")); if (milestoneProgress[milestoneID] >= 7 && !inversion) { return done; @@ -3856,26 +3078,6 @@ private Text milestoneProgressText(int milestoneID) { return new Text(progressText + ": " + EnumChatFormatting.GRAY + formattingMode.format(max) + " " + suffix); } - private Text constructionStatusText() { - return upgrades[currentUpgradeID] ? new Text(translateToLocal("fog.upgrade.respec")) - : new Text(translateToLocal("fog.upgrade.confirm")); - } - - private List constructionStatus() { - if (upgrades[currentUpgradeID]) { - return ImmutableList.of(translateToLocal("fog.upgrade.respec")); - } - return ImmutableList.of(translateToLocal("fog.upgrade.confirm")); - } - - private List upgradeMaterialRequirements() { - if (materialPaidUpgrades[Arrays.asList(UPGRADE_MATERIAL_ID_CONVERSION) - .indexOf(currentUpgradeID)]) { - return ImmutableList.of(translateToLocal("fog.button.materialrequirementsmet.tooltip")); - } - return ImmutableList.of(translateToLocal("fog.button.materialrequirements.tooltip")); - } - private void increaseBattery(int amount) { if ((internalBattery + amount) <= maxBatteryCharge) { internalBattery += amount; @@ -3921,87 +3123,22 @@ public void addTotalRecipesProcessed(long amount) { protected void setHatchRecipeMap(MTEHatchInput hatch) {} @Override - public void setItemNBT(NBTTagCompound NBT) { - NBT.setInteger("selectedFuelType", selectedFuelType); - NBT.setInteger("fuelConsumptionFactor", fuelConsumptionFactor); - NBT.setInteger("internalBattery", internalBattery); - NBT.setBoolean("batteryCharging", batteryCharging); - NBT.setInteger("batterySize", maxBatteryCharge); - NBT.setInteger("gravitonShardsAvailable", gravitonShardsAvailable); - NBT.setInteger("gravitonShardsSpent", gravitonShardsSpent); - NBT.setByteArray("totalPowerConsumed", totalPowerConsumed.toByteArray()); - NBT.setLong("totalRecipesProcessed", totalRecipesProcessed); - NBT.setLong("totalFuelConsumed", totalFuelConsumed); - NBT.setInteger("starFuelStored", stellarFuelAmount); - NBT.setBoolean("gravitonShardEjection", gravitonShardEjection); - NBT.setBoolean("secretUpgrde", secretUpgrade); - - // Store booleanArrays of all upgrades - NBTTagCompound upgradeBooleanArrayNBTTag = new NBTTagCompound(); - - int upgradeIndex = 0; - for (Boolean upgrade : upgrades) { - upgradeBooleanArrayNBTTag.setBoolean("upgrade" + upgradeIndex, upgrade); - upgradeIndex++; - } - - NBT.setTag("upgrades", upgradeBooleanArrayNBTTag); - - NBTTagCompound upgradeMaterialBooleanArrayNBTTag = new NBTTagCompound(); - - int upgradeMaterialIndex = 0; - for (Boolean upgrade : materialPaidUpgrades) { - upgradeBooleanArrayNBTTag.setBoolean("upgradeMaterial" + upgradeMaterialIndex, upgrade); - upgradeMaterialIndex++; - } - - NBT.setTag("upgradeMaterials", upgradeMaterialBooleanArrayNBTTag); - - starColors.serializeToNBT(NBT); + public RecipeMap getRecipeMap() { + return TecTechRecipeMaps.godforgeFakeUpgradeCostRecipes; + } + @Override + public void setItemNBT(NBTTagCompound NBT) { + saveGeneralNBT(NBT, false); super.saveNBTData(NBT); } @Override public void saveNBTData(NBTTagCompound NBT) { - NBT.setInteger("selectedFuelType", selectedFuelType); - NBT.setInteger("fuelConsumptionFactor", fuelConsumptionFactor); - NBT.setInteger("internalBattery", internalBattery); - NBT.setBoolean("batteryCharging", batteryCharging); - NBT.setInteger("batterySize", maxBatteryCharge); - NBT.setInteger("gravitonShardsAvailable", gravitonShardsAvailable); - NBT.setInteger("gravitonShardsSpent", gravitonShardsSpent); - NBT.setByteArray("totalPowerConsumed", totalPowerConsumed.toByteArray()); - NBT.setLong("totalRecipesProcessed", totalRecipesProcessed); - NBT.setLong("totalFuelConsumed", totalFuelConsumed); - NBT.setInteger("starFuelStored", stellarFuelAmount); - NBT.setBoolean("gravitonShardEjection", gravitonShardEjection); - NBT.setInteger("ringAmount", ringAmount); - NBT.setBoolean("secretUpgrade", secretUpgrade); - - // Store booleanArray of all upgrades - NBTTagCompound upgradeBooleanArrayNBTTag = new NBTTagCompound(); - - int upgradeIndex = 0; - for (boolean upgrade : upgrades) { - upgradeBooleanArrayNBTTag.setBoolean("upgrade" + upgradeIndex, upgrade); - upgradeIndex++; - } - - NBT.setTag("upgrades", upgradeBooleanArrayNBTTag); - - NBTTagCompound upgradeMaterialBooleanArrayNBTTag = new NBTTagCompound(); - - int upgradeMaterialIndex = 0; - for (boolean upgrade : materialPaidUpgrades) { - upgradeMaterialBooleanArrayNBTTag.setBoolean("upgradeMaterial" + upgradeMaterialIndex, upgrade); - upgradeMaterialIndex++; - } - - NBT.setTag("upgradeMaterials", upgradeMaterialBooleanArrayNBTTag); + saveGeneralNBT(NBT, true); + // Upgrade window stored items NBTTagCompound upgradeWindowStorageNBTTag = new NBTTagCompound(); - int storageIndex = 0; for (ItemStack itemStack : inputSlotHandler.getStacks()) { if (itemStack != null) { @@ -4011,69 +3148,96 @@ public void saveNBTData(NBTTagCompound NBT) { } storageIndex++; } - NBT.setTag("upgradeWindowStorage", upgradeWindowStorageNBTTag); // Renderer information NBT.setInteger("rotationSpeed", rotationSpeed); NBT.setInteger("starSize", starSize); NBT.setString("selectedStarColor", selectedStarColor); + NBT.setInteger("ringAmount", ringAmount); NBT.setBoolean("isRenderActive", isRenderActive); - - starColors.serializeToNBT(NBT); + NBT.setBoolean("isRendererDisabled", isRendererDisabled); super.saveNBTData(NBT); } + private void saveGeneralNBT(NBTTagCompound NBT, boolean force) { + if (force || selectedFuelType != 0) NBT.setInteger("selectedFuelType", selectedFuelType); + if (force || internalBattery != 0) NBT.setInteger("internalBattery", internalBattery); + if (force || batteryCharging) NBT.setBoolean("batteryCharging", batteryCharging); + if (force || gravitonShardsAvailable != 0) NBT.setInteger("gravitonShardsAvailable", gravitonShardsAvailable); + if (force || gravitonShardsSpent != 0) NBT.setInteger("gravitonShardsSpent", gravitonShardsSpent); + if (force || totalRecipesProcessed != 0) NBT.setLong("totalRecipesProcessed", totalRecipesProcessed); + if (force || totalFuelConsumed != 0) NBT.setLong("totalFuelConsumed", totalFuelConsumed); + if (force || stellarFuelAmount != 0) NBT.setInteger("starFuelStored", stellarFuelAmount); + if (force || gravitonShardEjection) NBT.setBoolean("gravitonShardEjection", gravitonShardEjection); + if (force || secretUpgrade) NBT.setBoolean("secretUpgrade", secretUpgrade); + + // Fields with non-zero defaults + if (force || fuelConsumptionFactor != DEFAULT_FUEL_CONSUMPTION_FACTOR) { + NBT.setInteger("fuelConsumptionFactor", fuelConsumptionFactor); + } + if (force || maxBatteryCharge != DEFAULT_MAX_BATTERY_CHARGE) { + NBT.setInteger("batterySize", maxBatteryCharge); + } + if (force || !DEFAULT_TOTAL_POWER.equals(totalPowerConsumed)) { + NBT.setByteArray("totalPowerConsumed", totalPowerConsumed.toByteArray()); + } + if (force || formattingMode != DEFAULT_FORMATTING_MODE) { + NBT.setInteger("formattingMode", formattingMode.ordinal()); + } + + upgrades.serializeToNBT(NBT, force); + starColors.serializeToNBT(NBT); + } + @Override public void loadNBTData(NBTTagCompound NBT) { selectedFuelType = NBT.getInteger("selectedFuelType"); - fuelConsumptionFactor = NBT.getInteger("fuelConsumptionFactor"); internalBattery = NBT.getInteger("internalBattery"); batteryCharging = NBT.getBoolean("batteryCharging"); - maxBatteryCharge = NBT.getInteger("batterySize"); gravitonShardsAvailable = NBT.getInteger("gravitonShardsAvailable"); gravitonShardsSpent = NBT.getInteger("gravitonShardsSpent"); - totalPowerConsumed = new BigInteger(NBT.getByteArray("totalPowerConsumed")); totalRecipesProcessed = NBT.getLong("totalRecipesProcessed"); totalFuelConsumed = NBT.getLong("totalFuelConsumed"); stellarFuelAmount = NBT.getInteger("starFuelStored"); gravitonShardEjection = NBT.getBoolean("gravitonShardEjection"); - ringAmount = NBT.getInteger("ringAmount"); secretUpgrade = NBT.getBoolean("secretUpgrade"); - NBTTagCompound tempBooleanTag = NBT.getCompoundTag("upgrades"); - - for (int upgradeIndex = 0; upgradeIndex < 31; upgradeIndex++) { - boolean upgrade = tempBooleanTag.getBoolean("upgrade" + upgradeIndex); - upgrades[upgradeIndex] = upgrade; + // Fields with non-zero defaults + if (NBT.hasKey("fuelConsumptionFactor")) { + fuelConsumptionFactor = NBT.getInteger("fuelConsumptionFactor"); } - - tempBooleanTag = NBT.getCompoundTag("upgradeMaterials"); - - for (int upgradeIndex = 0; upgradeIndex < 7; upgradeIndex++) { - boolean upgrade = tempBooleanTag.getBoolean("upgradeMaterial" + upgradeIndex); - materialPaidUpgrades[upgradeIndex] = upgrade; + if (NBT.hasKey("batterySize")) { + maxBatteryCharge = NBT.getInteger("batterySize"); + } + if (NBT.hasKey("totalPowerConsumed")) { + totalPowerConsumed = new BigInteger(NBT.getByteArray("totalPowerConsumed")); + } + if (NBT.hasKey("formattingMode")) { + int index = MathHelper.clamp_int(NBT.getInteger("formattingMode"), 0, MilestoneFormatter.VALUES.length); + formattingMode = MilestoneFormatter.VALUES[index]; } + // Stored items NBTTagCompound tempItemTag = NBT.getCompoundTag("upgradeWindowStorage"); - for (int index = 0; index < 16; index++) { - int stackSize = tempItemTag.getInteger(index + "stacksizeOfStoredUpgradeItems"); ItemStack itemStack = ItemStack.loadItemStackFromNBT(NBT.getCompoundTag(index + "storedUpgradeItem")); - if (itemStack != null) { storedUpgradeWindowItems[index] = itemStack.splitStack(stackSize); } } // Renderer information - rotationSpeed = NBT.getInteger("rotationSpeed"); - starSize = NBT.getInteger("starSize"); - selectedStarColor = NBT.getString("selectedStarColor"); + if (NBT.hasKey("rotationSpeed")) rotationSpeed = NBT.getInteger("rotationSpeed"); + if (NBT.hasKey("starSize")) starSize = NBT.getInteger("starSize"); + if (NBT.hasKey("selectedStarColor")) selectedStarColor = NBT.getString("selectedStarColor"); + if (NBT.hasKey("ringAmount")) ringAmount = NBT.getInteger("ringAmount"); isRenderActive = NBT.getBoolean("isRenderActive"); + isRendererDisabled = NBT.getBoolean("isRendererDisabled"); + upgrades.rebuildFromNBT(NBT); starColors.rebuildFromNBT(NBT); super.loadNBTData(NBT); diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEMoltenModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEMoltenModule.java index 51bfe51ac00..eace01bb6a7 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEMoltenModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEMoltenModule.java @@ -11,8 +11,6 @@ import java.math.BigInteger; import java.util.ArrayList; -import javax.annotation.Nonnull; - import net.minecraft.util.EnumChatFormatting; import org.jetbrains.annotations.NotNull; @@ -54,7 +52,7 @@ protected ProcessingLogic createProcessingLogic() { @NotNull @Override - protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) { if (recipe.mSpecialValue > getHeat()) { return CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); } @@ -70,9 +68,9 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { return CheckRecipeResultRegistry.SUCCESSFUL; } - @Nonnull + @NotNull @Override - protected OverclockCalculator createOverclockCalculator(@Nonnull GTRecipe recipe) { + protected OverclockCalculator createOverclockCalculator(@NotNull GTRecipe recipe) { return super.createOverclockCalculator(recipe).setEUt(getProcessingVoltage()) .setRecipeHeat(recipe.mSpecialValue) .setHeatOC(true) @@ -85,7 +83,7 @@ protected OverclockCalculator createOverclockCalculator(@Nonnull GTRecipe recipe @NotNull @Override - protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult onRecipeStart(@NotNull GTRecipe recipe) { if (!addEUToGlobalEnergyMap(userUUID, -calculatedEut * duration)) { return CheckRecipeResultRegistry.insufficientPower(calculatedEut * duration); } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEPlasmaModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEPlasmaModule.java index 29675ae5cef..05ae43e341b 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEPlasmaModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEPlasmaModule.java @@ -14,8 +14,6 @@ import java.math.BigInteger; import java.util.ArrayList; -import javax.annotation.Nonnull; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumChatFormatting; @@ -77,7 +75,7 @@ protected ProcessingLogic createProcessingLogic() { @NotNull @Override - protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) { wirelessEUt = (long) recipe.mEUt * getMaxParallel(); if (getUserEU(userUUID).compareTo(BigInteger.valueOf(wirelessEUt * recipe.mDuration)) < 0) { return CheckRecipeResultRegistry.insufficientPower(wirelessEUt * recipe.mDuration); @@ -91,7 +89,7 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { @NotNull @Override - protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult onRecipeStart(@NotNull GTRecipe recipe) { wirelessEUt = (long) recipe.mEUt * maxParallel; if (!addEUToGlobalEnergyMap(userUUID, -calculatedEut * duration)) { return CheckRecipeResultRegistry.insufficientPower(wirelessEUt * recipe.mDuration); @@ -106,9 +104,9 @@ protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { return CheckRecipeResultRegistry.SUCCESSFUL; } - @Nonnull + @NotNull @Override - protected OverclockCalculator createOverclockCalculator(@Nonnull GTRecipe recipe) { + protected OverclockCalculator createOverclockCalculator(@NotNull GTRecipe recipe) { return super.createOverclockCalculator(recipe).setEUt(getProcessingVoltage()) .setDurationDecreasePerOC(getOverclockTimeFactor()); } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTESmeltingModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTESmeltingModule.java index ba8e5f26661..1e499b3507a 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTESmeltingModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTESmeltingModule.java @@ -17,8 +17,6 @@ import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; - import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -70,7 +68,7 @@ public RecipeMap getRecipeMap() { return furnaceMode ? RecipeMaps.furnaceRecipes : RecipeMaps.blastFurnaceRecipes; } - @Nonnull + @NotNull @Override public Collection> getAvailableRecipeMaps() { return Arrays.asList(RecipeMaps.blastFurnaceRecipes, RecipeMaps.furnaceRecipes); @@ -89,7 +87,7 @@ protected ProcessingLogic createProcessingLogic() { @NotNull @Override - protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) { if (recipe.mSpecialValue > getHeat()) { return CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); @@ -108,7 +106,7 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { @NotNull @Override - protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { + protected CheckRecipeResult onRecipeStart(@NotNull GTRecipe recipe) { if (!addEUToGlobalEnergyMap(userUUID, -calculatedEut * duration)) { return CheckRecipeResultRegistry.insufficientPower(calculatedEut * duration); } @@ -124,9 +122,9 @@ protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { return CheckRecipeResultRegistry.SUCCESSFUL; } - @Nonnull + @NotNull @Override - protected OverclockCalculator createOverclockCalculator(@Nonnull GTRecipe recipe) { + protected OverclockCalculator createOverclockCalculator(@NotNull GTRecipe recipe) { return super.createOverclockCalculator(recipe).setEUt(getProcessingVoltage()) .setRecipeHeat(recipe.mSpecialValue) .setHeatOC(true) diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java index 9593c1db95b..900ef76f636 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java @@ -11,9 +11,9 @@ import org.jetbrains.annotations.Nullable; -import com.cleanroommc.modularui.utils.Color; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.drawable.shapes.Rectangle; +import com.gtnewhorizons.modularui.api.math.Color; import tectech.thing.gui.TecTechUITextures; @@ -29,6 +29,7 @@ public class ForgeOfGodsStarColor { public static final int DEFAULT_GREEN = 204; public static final int DEFAULT_BLUE = 255; public static final float DEFAULT_GAMMA = 3.0f; + public static final int DEFAULT_CYCLE_SPEED = 1; public static final ForgeOfGodsStarColor DEFAULT = new ForgeOfGodsStarColor("Default") .addColor(DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE, DEFAULT_GAMMA) @@ -43,15 +44,29 @@ public class ForgeOfGodsStarColor { .setCustomDrawable(TecTechUITextures.PICTURE_RAINBOW_SQUARE) .registerPreset(); - public static final ForgeOfGodsStarColor CLOUD_PICK = new ForgeOfGodsStarColor("Cloud's Pick") - .addColor(DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE, DEFAULT_GAMMA) // todo @cloud + public static final ForgeOfGodsStarColor CLOUDS_PICK = new ForgeOfGodsStarColor("Cloud's Pick") + .addColor(255, 255, 0, 0.8f) + .addColor(0, 0, 0, 0) + .addColor(0, 255, 255, 0.4f) + .addColor(0, 0, 0, 0) + .setCycleSpeed(1) + .setCustomDrawable( + new Rectangle() + .setColor(Color.rgb(255, 255, 0), Color.rgb(0, 0, 0), Color.rgb(0, 0, 0), Color.rgb(0, 255, 255))) .registerPreset(); - public static final ForgeOfGodsStarColor MAYA_PICK = new ForgeOfGodsStarColor("Maya's Pick") - .addColor(91, 206, 250, 3.0f) - .addColor(245, 169, 184, 3.0f) + public static final ForgeOfGodsStarColor MAYAS_PICK = new ForgeOfGodsStarColor("Maya's Pick") + .addColor(0, 0, 0, 0.0f) + .addColor(109, 201, 225, 1.0f) .addColor(255, 255, 255, 3.0f) + .addColor(255, 172, 210, 1.0f) .setCycleSpeed(1) + .setCustomDrawable( + new Rectangle().setColor( + Color.rgb(255, 172, 210), + Color.rgb(255, 255, 255), + Color.rgb(0, 0, 0), + Color.rgb(109, 201, 225))) .registerPreset(); public static List getDefaultColors() { @@ -68,7 +83,7 @@ public static List getDefaultColors() { // Star render settings private final List settings = new ArrayList<>(); - private int cycleSpeed = 1; + private int cycleSpeed = DEFAULT_CYCLE_SPEED; protected ForgeOfGodsStarColor(String name) { this(name, LATEST_VERSION); diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsRingsStructureString.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/structure/ForgeOfGodsRingsStructureString.java similarity index 99% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsRingsStructureString.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/structure/ForgeOfGodsRingsStructureString.java index fcff5c7026f..116dc7b5ba5 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsRingsStructureString.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/structure/ForgeOfGodsRingsStructureString.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge; +package tectech.thing.metaTileEntity.multi.godforge.structure; import static tectech.util.TTUtility.replaceLetters; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsStructureString.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/structure/ForgeOfGodsStructureString.java similarity index 99% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsStructureString.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/structure/ForgeOfGodsStructureString.java index 1780be0079b..277db1d1e13 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsStructureString.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/structure/ForgeOfGodsStructureString.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge; +package tectech.thing.metaTileEntity.multi.godforge.structure; import static tectech.util.TTUtility.appendStringArrays; import static tectech.util.TTUtility.replaceLetters; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/upgrade/ForgeOfGodsUpgrade.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/upgrade/ForgeOfGodsUpgrade.java new file mode 100644 index 00000000000..05b5f491d74 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/upgrade/ForgeOfGodsUpgrade.java @@ -0,0 +1,475 @@ +package tectech.thing.metaTileEntity.multi.godforge.upgrade; + +import static tectech.thing.metaTileEntity.multi.godforge.upgrade.ForgeOfGodsUpgrade.BGWindowSize.*; +import static tectech.thing.metaTileEntity.multi.godforge.util.MilestoneIcon.*; +import static tectech.thing.metaTileEntity.multi.godforge.util.UpgradeColor.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.List; +import java.util.Set; +import java.util.function.UnaryOperator; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +import com.google.common.collect.ImmutableSet; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.math.Size; + +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectList; +import tectech.thing.metaTileEntity.multi.godforge.util.MilestoneIcon; +import tectech.thing.metaTileEntity.multi.godforge.util.UpgradeColor; + +public enum ForgeOfGodsUpgrade { + + START, + IGCC, + STEM, + CFCE, + GISS, + FDIM, + SA, + GPCI, + REC, + GEM, + CTCDD, + QGPIU, + SEFCP, + TCT, + GGEBE, + TPTP, + DOP, + CNTI, + EPEC, + IMKG, + NDPE, + POS, + DOR, + NGMS, + SEDS, + PA, + CD, + TSE, + TBF, + EE, + END, + + ; + + public static final ForgeOfGodsUpgrade[] VALUES = values(); + + static final Set SPLIT_UPGRADES; + + static { + // Build upgrade data. Done here due to potential forward references + + // spotless:off + + START.build(b -> b + .background(BLUE, COMPOSITION) + .windowSize(LARGE) + .treePos(126, 56)); + + IGCC.build(b -> b + .prereqs(START) + .cost(1) + .background(BLUE, CONVERSION) + .treePos(126, 116)); + + STEM.build(b -> b + .prereqs(IGCC) + .cost(1) + .background(BLUE, CATALYST) + .treePos(96, 176)); + + CFCE.build(b -> b + .prereqs(IGCC) + .cost(1) + .background(BLUE, CATALYST) + .treePos(156, 176)); + + GISS.build(b -> b + .prereqs(STEM) + .cost(1) + .background(BLUE, CHARGE) + .treePos(66, 236)); + + FDIM.build(b -> b + .prereqs(STEM, CFCE) + .cost(1) + .background(BLUE, COMPOSITION) + .treePos(126, 236)); + + SA.build(b -> b + .prereqs(CFCE) + .cost(1) + .background(BLUE, CONVERSION) + .treePos(186, 236)); + + GPCI.build(b -> b + .prereqs(FDIM) + .cost(2) + .background(BLUE, COMPOSITION) + .treePos(126, 296)); + + REC.build(b -> b + .prereqs(GISS, FDIM) + .requireAllPrereqs() + .cost(2) + .background(RED, CHARGE) + .treePos(56, 356)); + + GEM.build(b -> b + .prereqs(GPCI) + .cost(2) + .background(BLUE, CATALYST) + .treePos(126, 356)); + + CTCDD.build(b -> b + .prereqs(GPCI, SA) + .requireAllPrereqs() + .cost(2) + .background(RED, CONVERSION) + .treePos(196, 356)); + + QGPIU.build(b -> b + .prereqs(REC, CTCDD) + .cost(2) + .background(BLUE, CATALYST) + .treePos(126, 416)); + + SEFCP.build(b -> b + .prereqs(QGPIU) + .cost(3) + .background(PURPLE, CATALYST) + .treePos(66, 476)); + + TCT.build(b -> b + .prereqs(QGPIU) + .cost(3) + .background(ORANGE, CONVERSION) + .treePos(126, 476)); + + GGEBE.build(b -> b + .prereqs(QGPIU) + .cost(3) + .background(GREEN, CHARGE) + .treePos(186, 476)); + + TPTP.build(b -> b + .prereqs(GGEBE) + .cost(4) + .background(GREEN, CONVERSION) + .treePos(246, 496)); + + DOP.build(b -> b + .prereqs(CNTI) + .cost(4) + .background(PURPLE, CONVERSION) + .treePos(6, 556)); + + CNTI.build(b -> b + .prereqs(SEFCP) + .cost(3) + .background(PURPLE, CHARGE) + .treePos(66, 536)); + + EPEC.build(b -> b + .prereqs(TCT) + .cost(3) + .background(ORANGE, CONVERSION) + .treePos(126, 536)); + + IMKG.build(b -> b + .prereqs(GGEBE) + .cost(3) + .background(GREEN, CHARGE) + .treePos(186, 536)); + + NDPE.build(b -> b + .prereqs(CNTI) + .cost(3) + .background(PURPLE, CHARGE) + .treePos(66, 596)); + + POS.build(b -> b + .prereqs(EPEC) + .cost(3) + .background(ORANGE, CONVERSION) + .treePos(126, 596)); + + DOR.build(b -> b + .prereqs(IMKG) + .cost(3) + .background(GREEN, CONVERSION) + .treePos(186, 596)); + + NGMS.build(b -> b + .prereqs(NDPE, POS, DOR) + .cost(4) + .background(BLUE, CHARGE) + .treePos(126, 656)); + + SEDS.build(b -> b + .prereqs(NGMS) + .cost(5) + .background(BLUE, CONVERSION) + .treePos(126, 718)); + + PA.build(b -> b + .prereqs(SEDS) + .cost(6) + .background(BLUE, CONVERSION) + .treePos(36, 758)); + + CD.build(b -> b + .prereqs(PA) + .cost(7) + .background(BLUE, COMPOSITION) + .treePos(36, 848)); + + TSE.build(b -> b + .prereqs(CD) + .cost(8) + .background(BLUE, CATALYST) + .treePos(126, 888)); + + TBF.build(b -> b + .prereqs(TSE) + .cost(9) + .background(BLUE, CHARGE) + .treePos(216, 848)); + + EE.build(b -> b + .prereqs(TBF) + .cost(10) + .background(BLUE, COMPOSITION) + .treePos(216, 758)); + + END.build(b -> b + .prereqs(EE) + .cost(12) + .background(BLUE, COMPOSITION) + .windowSize(LARGE) + .treePos(126, 798)); + + // spotless:on + + // Build split upgrade set + SPLIT_UPGRADES = ImmutableSet.of(SEFCP, TCT, GGEBE); + + // Build inverse dependents mapping + EnumMap> dependencies = new EnumMap<>(ForgeOfGodsUpgrade.class); + for (ForgeOfGodsUpgrade upgrade : VALUES) { + for (ForgeOfGodsUpgrade prerequisite : upgrade.prerequisites) { + dependencies.computeIfAbsent(prerequisite, $ -> new ArrayList<>()) + .add(upgrade); + } + } + for (var entry : dependencies.entrySet()) { + ForgeOfGodsUpgrade upgrade = entry.getKey(); + List deps = entry.getValue(); + if (deps != null) { + upgrade.dependents = deps.toArray(new ForgeOfGodsUpgrade[0]); + } + } + } + + // Static tree linking + private ForgeOfGodsUpgrade[] prerequisites; + private boolean requireAllPrerequisites; + + // Cost + private int shardCost; + private final List extraCost = new ArrayList<>(); + + // UI + private UpgradeColor color; + private MilestoneIcon icon; + private BGWindowSize windowSize; + private Pos2d treePos; + + // Pre-generated data + private ForgeOfGodsUpgrade[] dependents = new ForgeOfGodsUpgrade[0]; + private final String name; + private final String nameShort; + private final String bodyText; + private final String loreText; + + ForgeOfGodsUpgrade() { + this.name = "fog.upgrade.tt." + ordinal(); + this.nameShort = "fog.upgrade.tt.short." + ordinal(); + this.bodyText = "fog.upgrade.text." + ordinal(); + this.loreText = "fog.upgrade.lore." + ordinal(); + } + + private void build(UnaryOperator u) { + Builder b = u.apply(new Builder()); + + this.prerequisites = b.prerequisites != null ? b.prerequisites.toArray(new ForgeOfGodsUpgrade[0]) + : new ForgeOfGodsUpgrade[0]; + this.requireAllPrerequisites = b.requireAllPrerequisites; + this.shardCost = b.shardCost; + this.color = b.color; + this.icon = b.icon; + this.windowSize = b.windowSize; + this.treePos = b.treePos; + } + + public void addExtraCost(ItemStack... cost) { + if (extraCost.size() + cost.length > 12) { + throw new IllegalArgumentException("Too many inputs for Godforge upgrade cost, cannot be more than 12!"); + } + extraCost.addAll(Arrays.asList(cost)); + } + + public ForgeOfGodsUpgrade[] getPrerequisites() { + return prerequisites; + } + + public boolean requiresAllPrerequisites() { + return requireAllPrerequisites; + } + + public ForgeOfGodsUpgrade[] getDependents() { + return dependents; + } + + public int getShardCost() { + return shardCost; + } + + public boolean hasExtraCost() { + return !extraCost.isEmpty(); + } + + public ItemStack[] getExtraCost() { + return extraCost.toArray(new ItemStack[0]); + } + + public UITexture getBackground() { + return color.getBackground(); + } + + public UITexture getOverlay() { + return color.getOverlay(); + } + + public UITexture getSymbol() { + return icon.getSymbol(); + } + + public float getSymbolWidthRatio() { + return icon.getWidthRatio(); + } + + public Size getWindowSize() { + return windowSize.getWindowSize(); + } + + public int getLoreYPos() { + return windowSize.getLoreY(); + } + + public Pos2d getTreePos() { + return treePos; + } + + public String getNameText() { + return StatCollector.translateToLocal(name); + } + + public String getShortNameText() { + return StatCollector.translateToLocal(nameShort); + } + + public String getBodyText() { + return StatCollector.translateToLocal(bodyText); + } + + public String getLoreText() { + return StatCollector.translateToLocal(loreText); + } + + public static class Builder { + + // Tree linking + private ObjectList prerequisites; + private boolean requireAllPrerequisites; + + // Cost + private int shardCost; + + // UI + private UpgradeColor color = BLUE; + private MilestoneIcon icon = CHARGE; + private BGWindowSize windowSize = STANDARD; + private Pos2d treePos = new Pos2d(0, 0); + + private Builder() {} + + public Builder prereqs(ForgeOfGodsUpgrade... prereqs) { + if (this.prerequisites != null) { + throw new IllegalArgumentException("Cannot repeat calls to ForgeOfGodsUpgrade$Builder#prereqs"); + } + this.prerequisites = new ObjectArrayList<>(prereqs); + return this; + } + + public Builder requireAllPrereqs() { + this.requireAllPrerequisites = true; + return this; + } + + // Cost + public Builder cost(int shards) { + this.shardCost = shards; + return this; + } + + // UI + public Builder background(UpgradeColor color, MilestoneIcon icon) { + this.color = color; + this.icon = icon; + return this; + } + + public Builder windowSize(BGWindowSize windowSize) { + this.windowSize = windowSize; + return this; + } + + public Builder treePos(int x, int y) { + this.treePos = new Pos2d(x, y); + return this; + } + } + + enum BGWindowSize { + + STANDARD(250, 250, 110), + LARGE(300, 300, 85), + + ; + + private final Size size; + private final int loreY; + + BGWindowSize(int width, int height, int loreY) { + this.size = new Size(width, height); + this.loreY = loreY; + } + + public Size getWindowSize() { + return size; + } + + public int getLoreY() { + return loreY; + } + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/upgrade/UpgradeStorage.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/upgrade/UpgradeStorage.java new file mode 100644 index 00000000000..a473cc15ed0 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/upgrade/UpgradeStorage.java @@ -0,0 +1,285 @@ +package tectech.thing.metaTileEntity.multi.godforge.upgrade; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.EnumMap; +import java.util.stream.Stream; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; + +import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; + +import gregtech.api.util.GTUtility; + +public class UpgradeStorage { + + private final EnumMap unlockedUpgrades = new EnumMap<>(ForgeOfGodsUpgrade.class); + + public UpgradeStorage() { + for (ForgeOfGodsUpgrade upgrade : ForgeOfGodsUpgrade.VALUES) { + unlockedUpgrades.put(upgrade, new UpgradeData()); + } + } + + /** Whether the passed upgrade is already unlocked (purchased). */ + public boolean isUpgradeActive(ForgeOfGodsUpgrade upgrade) { + return getData(upgrade).isActive(); + } + + public boolean isCostPaid(ForgeOfGodsUpgrade upgrade) { + return getData(upgrade).isCostPaid(); + } + + public short[] getPaidCosts(ForgeOfGodsUpgrade upgrade) { + return getData(upgrade).amountsPaid; + } + + /** Handles consuming items and updating state if successful. Does NOT handle graviton shards! */ + public void payCost(ForgeOfGodsUpgrade upgrade, ItemStackHandler handler) { + UpgradeData data = getData(upgrade); + + if (!upgrade.hasExtraCost()) { + data.costPaid = true; + return; + } + + ItemStack[] extraCost = upgrade.getExtraCost(); + for (int i = 0; i < handler.getSlots(); i++) { + ItemStack inputStack = handler.getStackInSlot(i); + if (inputStack == null) continue; + + for (int j = 0; j < extraCost.length; j++) { + ItemStack costStack = extraCost[j]; + int alreadyPaid = data.amountsPaid[j]; + if (alreadyPaid >= costStack.stackSize) continue; + + if (GTUtility.areStacksEqual(inputStack, costStack)) { + int maxExtract = costStack.stackSize - alreadyPaid; + ItemStack extractedStack = handler.extractItem(i, maxExtract, false); + if (extractedStack != null) { + data.amountsPaid[j] += extractedStack.stackSize; + } + } + } + } + + // Check if all costs are paid + for (int i = 0; i < extraCost.length; i++) { + ItemStack costStack = extraCost[i]; + if (costStack == null) continue; + if (data.amountsPaid[i] < costStack.stackSize) { + return; + } + } + data.costPaid = true; + } + + public void unlockUpgrade(ForgeOfGodsUpgrade upgrade) { + getData(upgrade).active = true; + } + + public void respecUpgrade(ForgeOfGodsUpgrade upgrade) { + getData(upgrade).active = false; + } + + /** + * Whether the passed upgrade can be unlocked, checking that the prerequisites are satisfied. + */ + public boolean checkPrerequisites(ForgeOfGodsUpgrade upgrade) { + ForgeOfGodsUpgrade[] prereqs = upgrade.getPrerequisites(); + if (prereqs.length == 0) return true; + + Stream prereqStream = Arrays.stream(prereqs) + .map(unlockedUpgrades::get); + + if (upgrade.requiresAllPrerequisites()) { + return prereqStream.allMatch(UpgradeData::isActive); + } + return prereqStream.anyMatch(UpgradeData::isActive); + } + + public boolean checkSplit(ForgeOfGodsUpgrade upgrade, int maxSplitUpgrades) { + if (ForgeOfGodsUpgrade.SPLIT_UPGRADES.contains(upgrade)) { + return ForgeOfGodsUpgrade.SPLIT_UPGRADES.stream() + .map(unlockedUpgrades::get) + .filter(UpgradeData::isActive) + .count() < maxSplitUpgrades; + } + return true; + } + + public boolean checkCost(ForgeOfGodsUpgrade upgrade, int availableShards) { + if (upgrade.getShardCost() > availableShards) return false; + return !upgrade.hasExtraCost() || isCostPaid(upgrade); + } + + /** @return true if any dependent upgrades are currently unlocked. */ + public boolean checkDependents(ForgeOfGodsUpgrade upgrade) { + for (ForgeOfGodsUpgrade dependent : upgrade.getDependents()) { + if (!isUpgradeActive(dependent)) continue; + + // Check failed, this dependent strictly requires the passed upgrade + if (dependent.requiresAllPrerequisites()) return false; + + // Check for some other prerequisite upgrade of the dependent to make sure that + // if the passed upgrade is removed, that upgrade is still valid + if (Arrays.stream(dependent.getPrerequisites()) + .map(unlockedUpgrades::get) + .filter(UpgradeData::isActive) + .count() <= 1) { + return false; + } + } + return true; + } + + private UpgradeData getData(ForgeOfGodsUpgrade upgrade) { + return unlockedUpgrades.computeIfAbsent(upgrade, $ -> new UpgradeData()); + } + + private boolean hasAnyProgress() { + if (isUpgradeActive(ForgeOfGodsUpgrade.START)) return true; + + // Check if any costs have been paid in any upgrades + for (var entry : unlockedUpgrades.entrySet()) { + ForgeOfGodsUpgrade upgrade = entry.getKey(); + if (upgrade.hasExtraCost()) { + UpgradeData data = entry.getValue(); + if (data.isCostPaid()) return true; + for (int i = 0; i < data.amountsPaid.length; i++) { + if (data.amountsPaid[i] != 0) return true; + } + } + } + + return false; + } + + public int getTotalActiveUpgrades() { + return (int) unlockedUpgrades.values() + .stream() + .map(UpgradeData::isActive) + .count(); + } + + public Collection getAllUpgrades() { + return unlockedUpgrades.keySet(); + } + + public void resetAll() { + for (UpgradeData data : unlockedUpgrades.values()) { + data.active = false; + data.costPaid = false; + } + } + + public void unlockAll() { + for (UpgradeData data : unlockedUpgrades.values()) { + data.active = true; + } + } + + public void serializeToNBT(NBTTagCompound NBT, boolean force) { + if (!force && !hasAnyProgress()) return; + + NBTTagCompound upgradeTag = new NBTTagCompound(); + for (ForgeOfGodsUpgrade upgrade : ForgeOfGodsUpgrade.VALUES) { + UpgradeData data = unlockedUpgrades.get(upgrade); + upgradeTag.setBoolean("upgrade" + upgrade.ordinal(), data.isActive()); + if (upgrade.hasExtraCost()) { + NBTTagCompound costTag = new NBTTagCompound(); + costTag.setBoolean("paid", data.isCostPaid()); + for (int i = 0; i < data.amountsPaid.length; i++) { + costTag.setShort("costPaid" + i, data.amountsPaid[i]); + } + upgradeTag.setTag("extraCost" + upgrade.ordinal(), costTag); + } + } + NBT.setTag("upgrades", upgradeTag); + } + + public void rebuildFromNBT(NBTTagCompound NBT) { + if (!NBT.hasKey("upgrades")) return; + + NBTTagCompound upgradeTag = NBT.getCompoundTag("upgrades"); + for (int i = 0; i < ForgeOfGodsUpgrade.VALUES.length; i++) { + ForgeOfGodsUpgrade upgrade = ForgeOfGodsUpgrade.VALUES[i]; + UpgradeData data = unlockedUpgrades.get(upgrade); + data.active = upgradeTag.getBoolean("upgrade" + upgrade.ordinal()); + if (upgrade.hasExtraCost() && upgradeTag.hasKey("extraCost" + upgrade.ordinal())) { + NBTTagCompound costTag = upgradeTag.getCompoundTag("extraCost" + upgrade.ordinal()); + data.costPaid = costTag.getBoolean("paid"); + for (int j = 0; j < data.amountsPaid.length; j++) { + data.amountsPaid[j] = costTag.getShort("costPaid" + j); + } + } + } + } + + /** Sync widget to sync a single upgrade. */ + public FakeSyncWidget getSyncer(ForgeOfGodsUpgrade upgrade) { + return new FakeSyncWidget<>( + () -> unlockedUpgrades.get(upgrade), + val -> unlockedUpgrades.put(upgrade, val), + UpgradeData::writeToBuffer, + UpgradeData::readFromBuffer); + } + + /** Sync widget to sync the full upgrade tree. */ + public FakeSyncWidget getFullSyncer() { + return new FakeSyncWidget.ListSyncer<>(() -> new ArrayList<>(unlockedUpgrades.values()), val -> { + for (int i = 0; i < val.size(); i++) { + unlockedUpgrades.put(ForgeOfGodsUpgrade.VALUES[i], val.get(i)); + } + }, UpgradeData::writeToBuffer, UpgradeData::readFromBuffer); + } + + private static class UpgradeData { + + private boolean active; + private boolean costPaid; + private final short[] amountsPaid = new short[12]; + + public boolean isActive() { + return active; + } + + public boolean isCostPaid() { + return costPaid; + } + + private static void writeToBuffer(PacketBuffer buf, UpgradeData data) { + buf.writeBoolean(data.isActive()); + buf.writeBoolean(data.isCostPaid()); + for (int i = 0; i < data.amountsPaid.length; i++) { + buf.writeShort(data.amountsPaid[i]); + } + } + + private static UpgradeData readFromBuffer(PacketBuffer buf) { + UpgradeData data = new UpgradeData(); + data.active = buf.readBoolean(); + data.costPaid = buf.readBoolean(); + for (int i = 0; i < data.amountsPaid.length; i++) { + data.amountsPaid[i] = buf.readShort(); + } + return data; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + UpgradeData that = (UpgradeData) o; + + if (active != that.active) return false; + if (costPaid != that.costPaid) return false; + return Arrays.equals(amountsPaid, that.amountsPaid); + } + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsUI.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/ForgeOfGodsUI.java similarity index 61% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsUI.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/ForgeOfGodsUI.java index a63ba81d7e3..46ea5825347 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsUI.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/ForgeOfGodsUI.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge; +package tectech.thing.metaTileEntity.multi.godforge.util; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static net.minecraft.util.StatCollector.translateToLocal; @@ -13,13 +13,17 @@ import java.util.function.DoubleSupplier; import java.util.function.Supplier; +import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import com.google.common.collect.ImmutableList; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.math.MainAxisAlignment; import com.gtnewhorizons.modularui.api.math.Size; import com.gtnewhorizons.modularui.api.screen.ModularUIContext; import com.gtnewhorizons.modularui.api.screen.ModularWindow; @@ -27,14 +31,18 @@ import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.DynamicPositionedRow; import com.gtnewhorizons.modularui.common.widget.DynamicTextWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.MultiChildWidget; import com.gtnewhorizons.modularui.common.widget.Scrollable; import com.gtnewhorizons.modularui.common.widget.SliderWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.NumericWidget; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; import gregtech.api.enums.VoidingMode; import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.modularui.IControllerWithOptionalFeatures; @@ -42,6 +50,7 @@ import tectech.TecTech; import tectech.thing.gui.TecTechUITextures; import tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor; +import tectech.thing.metaTileEntity.multi.godforge.upgrade.ForgeOfGodsUpgrade; /** * Holds UI element builders and other conveniences shared between the primary Forge of the Gods and its modules. @@ -295,7 +304,7 @@ public static ModularWindow createGeneralInfoWindow(Supplier inversionG .setPos(7, 140) .setSize(150, 15)) .widget( - TextWidget.dynamicText(() -> inversionInfoText(inversionGetter.get())) + TextWidget.dynamicText(() -> inversionHeaderText(inversionGetter.get())) .setDefaultColor(EnumChatFormatting.WHITE) .setTextAlignment(Alignment.CenterLeft) .setPos(7, 155) @@ -419,6 +428,15 @@ public static void reopenWindow(Widget widget, int windowId) { } } + public static void closeWindow(Widget widget, int windowId) { + if (!widget.isClient()) { + ModularUIContext ctx = widget.getContext(); + if (ctx.isWindowOpen(windowId)) { + ctx.closeWindow(windowId); + } + } + } + public enum StarColorRGBM { RED(EnumChatFormatting.RED, RED_ARGB, 0, 255, ForgeOfGodsStarColor.DEFAULT_RED), @@ -546,4 +564,345 @@ public static Widget createStarColorButton(Supplier text, Supplier shardGetter, + Runnable complete, Runnable respec, Supplier check) { + MultiChildWidget widget = new MultiChildWidget(); + widget.setSize(upgrade.getWindowSize()); + + Size windowSize = upgrade.getWindowSize(); + int w = windowSize.width; + int h = windowSize.height; + + // Close window button + widget.addChild( + ButtonWidget.closeWindowButton(true) + .setPos(w - 15, 3)); + + // Background symbol + widget.addChild( + new DrawableWidget().setDrawable(upgrade.getSymbol()) + .setPos((int) ((1 - upgrade.getSymbolWidthRatio() / 2) * w / 2), h / 4) + .setSize((int) (w / 2 * upgrade.getSymbolWidthRatio()), h / 2)); + + // Background overlay + widget.addChild( + new DrawableWidget().setDrawable(upgrade.getOverlay()) + .setPos(w / 4, h / 4) + .setSize(w / 2, h / 2)); + + // Upgrade name title + widget.addChild( + new TextWidget(upgrade.getNameText()).setTextAlignment(Alignment.Center) + .setDefaultColor(EnumChatFormatting.GOLD) + .setSize(w - 15, 30) + .setPos(9, 5)); + + // Upgrade body text + widget.addChild( + new TextWidget(upgrade.getBodyText()).setTextAlignment(Alignment.Center) + .setDefaultColor(EnumChatFormatting.WHITE) + .setSize(w - 15, upgrade.getLoreYPos() - 30) + .setPos(9, 30)); + + // Lore Text + widget.addChild( + new TextWidget(EnumChatFormatting.ITALIC + upgrade.getLoreText()).setTextAlignment(Alignment.Center) + .setDefaultColor(0xbbbdbd) + .setSize(w - 15, (int) (h * 0.9) - upgrade.getLoreYPos()) + .setPos(9, upgrade.getLoreYPos())); + + // Shard cost text + String costStr = " " + EnumChatFormatting.BLUE + upgrade.getShardCost(); + widget.addChild( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.shardcost") + costStr) + .setTextAlignment(Alignment.Center) + .setScale(0.7f) + .setMaxWidth(70) + .setDefaultColor(0x9c9c9c) + .setPos(11, h - 25)); + + // Available shards text + widget.addChild( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.availableshards")) + .setTextAlignment(Alignment.Center) + .setScale(0.7f) + .setMaxWidth(90) + .setDefaultColor(0x9c9c9c) + .setPos(w - 87, h - 25)); + + // Available shards amount + widget.addChild( + TextWidget.dynamicText(() -> getAvailableShardsText(upgrade, shardGetter)) + .setTextAlignment(Alignment.Center) + .setScale(0.7f) + .setMaxWidth(90) + .setDefaultColor(0x9c9c9c) + .setPos(w - 27, h - 18)); + + // Complete button group + MultiChildWidget completeGroup = new MultiChildWidget(); + completeGroup.setPos(w / 2 - 21, (int) (h * 0.9)); + + // Complete button + completeGroup.addChild(new ButtonWidget().setOnClick(($, $$) -> { + if (check.get()) { + respec.run(); + } else { + complete.run(); + } + }) + .setSize(40, 15) + .setBackground( + () -> new IDrawable[] { + check.get() ? GTUITextures.BUTTON_STANDARD_PRESSED : GTUITextures.BUTTON_STANDARD }) + .dynamicTooltip(() -> constructionStatusString(check)) + .setTooltipShowUpDelay(TOOLTIP_DELAY)); + + // Complete text overlay + completeGroup.addChild( + TextWidget.dynamicText(() -> constructionStatusText(check)) + .setTextAlignment(Alignment.Center) + .setScale(0.7f) + .setMaxWidth(36) + .setPos(3, 5)); + + widget.addChild(completeGroup); + + return widget; + } + + public static Widget createMaterialInputButton(ForgeOfGodsUpgrade upgrade, Supplier check, + BiConsumer clickAction) { + Size windowSize = upgrade.getWindowSize(); + int w = windowSize.width; + int h = windowSize.height; + + return new ButtonWidget().setOnClick(clickAction) + .setPlayClickSound(true) + .setBackground( + () -> new IDrawable[] { check.get() ? TecTechUITextures.BUTTON_BOXED_CHECKMARK_18x18 + : TecTechUITextures.BUTTON_BOXED_EXCLAMATION_POINT_18x18 }) + .setPos(w / 2 - 40, (int) (h * 0.9)) + .setSize(15, 15) + .dynamicTooltip(() -> upgradeMaterialRequirements(check)) + .addTooltip( + EnumChatFormatting.GRAY + translateToLocal("fog.button.materialrequirements.tooltip.clickhere")); + } + + private static Text getAvailableShardsText(ForgeOfGodsUpgrade upgrade, Supplier shardGetter) { + EnumChatFormatting enoughShards = EnumChatFormatting.RED; + if (shardGetter.get() >= upgrade.getShardCost()) { + enoughShards = EnumChatFormatting.GREEN; + } + return new Text(enoughShards + Integer.toString(shardGetter.get())); + } + + private static List constructionStatusString(Supplier check) { + if (check.get()) { + return ImmutableList.of(translateToLocal("fog.upgrade.respec")); + } + return ImmutableList.of(translateToLocal("fog.upgrade.confirm")); + } + + private static Text constructionStatusText(Supplier check) { + if (check.get()) { + return new Text(translateToLocal("fog.upgrade.respec")); + } + return new Text(translateToLocal("fog.upgrade.confirm")); + } + + private static List upgradeMaterialRequirements(Supplier check) { + if (check.get()) { + return ImmutableList.of(translateToLocal("fog.button.materialrequirementsmet.tooltip")); + } + return ImmutableList.of(translateToLocal("fog.button.materialrequirements.tooltip")); + } + + public static Widget createExtraCostWidget(final ItemStack costStack, Supplier paidAmount) { + MultiChildWidget widget = new MultiChildWidget(); + widget.setSize(36, 18); + + if (costStack == null) { + // Nothing to pay, so just create a simple disabled slot drawable + widget.addChild( + new DrawableWidget().setDrawable(GTUITextures.BUTTON_STANDARD_DISABLED) + .setSize(18, 18)); + return widget; + } + + // Item slot + ItemStackHandler handler = new ItemStackHandler(1); + ItemStack handlerStack = costStack.copy(); + handlerStack.stackSize = Math.max(1, handlerStack.stackSize - paidAmount.get()); + handler.setStackInSlot(0, handlerStack); + widget.addChild( + new SlotWidget(handler, 0).setAccess(false, false) + .setRenderStackSize(false) + .disableInteraction() + .setBackground(GTUITextures.BUTTON_STANDARD_PRESSED)) + .addChild(new ButtonWidget().setOnClick((clickData, w) -> { + if (widget.isClient()) { + if (clickData.mouseButton == 0) { + GuiCraftingRecipe.openRecipeGui("item", handlerStack.copy()); + } else if (clickData.mouseButton == 1) { + GuiUsageRecipe.openRecipeGui("item", handlerStack.copy()); + } + } + }) + .setSize(16, 16) + .setPos(1, 1)); + + // Progress text + widget.addChild(new DynamicTextWidget(() -> { + short paid = paidAmount.get(); + EnumChatFormatting color = EnumChatFormatting.YELLOW; + if (paid == 0) color = EnumChatFormatting.RED; + else if (paid == costStack.stackSize) color = EnumChatFormatting.GREEN; + return new Text(color + "x" + (costStack.stackSize - paid)); + }).setTextAlignment(Alignment.Center) + .setScale(0.8f) + .setPos(18, 5) + .setSize(18, 9) + .setEnabled(w -> paidAmount.get() < costStack.stackSize)); + + // Completed checkmark + widget.addChild( + new DrawableWidget().setDrawable(TecTechUITextures.GREEN_CHECKMARK_11x9) + .setPos(21, 5) + .setSize(11, 9) + .setEnabled(w -> paidAmount.get() >= costStack.stackSize)); + + return widget; + } + + public static ModularWindow createSpecialThanksWindow() { + final int WIDTH = 200; + final int HEIGHT = 200; + ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); + + builder.setBackground(TecTechUITextures.BACKGROUND_GLOW_RAINBOW); + builder.setDraggable(true); + builder.widget( + ButtonWidget.closeWindowButton(true) + .setPos(184, 4)) + .widget( + new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_GODFORGE_THANKS) + .setPos(50, 50) + .setSize(100, 100)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.contributors")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setScale(1f) + .setPos(0, 5) + .setSize(200, 15)) + .widget( + new TextWidget( + EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.lead")) + .setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 30) + .setSize(60, 10)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.cloud")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.AQUA) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 40) + .setSize(60, 10)) + .widget( + new TextWidget( + EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.programming")) + .setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 55) + .setSize(60, 10)) + .widget( + new TextWidget( + translateToLocal("gt.blockmachines.multimachine.FOG.serenibyss") + " " + + EnumChatFormatting.DARK_AQUA + + translateToLocal("gt.blockmachines.multimachine.FOG.teg")).setScale(0.8f) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 67) + .setSize(60, 10)) + .widget( + new TextWidget( + EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.textures")) + .setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 85) + .setSize(100, 10)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.ant")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GREEN) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 95) + .setSize(60, 10)) + .widget( + new TextWidget( + EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.rendering")) + .setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 110) + .setSize(100, 10)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.bucket")).setScale(0.8f) + .setDefaultColor(EnumChatFormatting.WHITE) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 120) + .setSize(60, 10)) + .widget( + new TextWidget( + EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.lore")) + .setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 135) + .setSize(100, 10)) + .widget( + delenoName().setSpace(-1) + .setAlignment(MainAxisAlignment.SPACE_BETWEEN) + .setPos(7, 145) + .setSize(60, 10)) + .widget( + new TextWidget( + EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.playtesting")) + .setScale(0.8f) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 160) + .setSize(100, 10)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.misi")).setScale(0.8f) + .setDefaultColor(0xffc26f) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 170) + .setSize(60, 10)) + .widget( + new TextWidget(EnumChatFormatting.ITALIC + translateToLocal("gt.blockmachines.multimachine.FOG.thanks")) + .setScale(0.8f) + .setDefaultColor(0xbbbdbd) + .setTextAlignment(Alignment.Center) + .setPos(90, 140) + .setSize(100, 60)); + return builder.build(); + } + + private static DynamicPositionedRow delenoName() { + DynamicPositionedRow nameRow = new DynamicPositionedRow(); + String deleno = translateToLocal("gt.blockmachines.multimachine.FOG.deleno"); + int[] colors = new int[] { 0xffffff, 0xf6fff5, 0xecffec, 0xe3ffe2, 0xd9ffd9, 0xd0ffcf }; + + for (int i = 0; i < 6; i++) { + nameRow.addChild( + new TextWidget(Character.toString(deleno.charAt(i))).setDefaultColor(colors[i]) + .setScale(0.8f) + .setTextAlignment(Alignment.CenterLeft)); + } + return nameRow; + } } diff --git a/src/main/java/tectech/util/GodforgeMath.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/GodforgeMath.java similarity index 84% rename from src/main/java/tectech/util/GodforgeMath.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/GodforgeMath.java index d4d43f01cf2..e0f059167ba 100644 --- a/src/main/java/tectech/util/GodforgeMath.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/GodforgeMath.java @@ -1,4 +1,6 @@ -package tectech.util; +package tectech.thing.metaTileEntity.multi.godforge.util; + +import static tectech.thing.metaTileEntity.multi.godforge.upgrade.ForgeOfGodsUpgrade.*; import java.math.BigInteger; @@ -17,7 +19,7 @@ public static int getRandomIntInRange(int min, int max) { public static double calculateFuelConsumption(MTEForgeOfGods godforge) { double upgradeFactor = 1; - if (godforge.isUpgradeActive(2)) { + if (godforge.isUpgradeActive(STEM)) { upgradeFactor = 0.8; } if (godforge.getFuelType() == 0) { @@ -34,13 +36,13 @@ public static int calculateStartupFuelConsumption(MTEForgeOfGods godforge) { public static int calculateMaxFuelFactor(MTEForgeOfGods godforge) { int fuelCap = 5; - if (godforge.isUpgradeActive(27)) { + if (godforge.isUpgradeActive(TSE)) { fuelCap = Integer.MAX_VALUE; } else { - if (godforge.isUpgradeActive(9)) { + if (godforge.isUpgradeActive(GEM)) { fuelCap += godforge.getTotalActiveUpgrades(); } - if (godforge.isUpgradeActive(3)) { + if (godforge.isUpgradeActive(CFCE)) { fuelCap *= 1.2; } } @@ -59,7 +61,7 @@ public static int calculateEffectiveFuelFactor(MTEForgeOfGods godforge) { public static void calculateMaxHeatForModules(MTEBaseModule module, MTEForgeOfGods godforge) { double logBase = 1.5; int baseHeat = 12601; - if (godforge.isUpgradeActive(12)) { + if (godforge.isUpgradeActive(SEFCP)) { if (module instanceof MTESmeltingModule) { logBase = 1.12; } else { @@ -74,7 +76,7 @@ public static void calculateMaxHeatForModules(MTEBaseModule module, MTEForgeOfGo public static int calculateOverclockHeat(MTEBaseModule module, MTEForgeOfGods godforge, Integer recipeHeat) { int actualHeat; double exponent; - if (godforge.isUpgradeActive(20)) { + if (godforge.isUpgradeActive(NDPE)) { if (module instanceof MTESmeltingModule) { exponent = 0.85; } else { @@ -85,7 +87,7 @@ public static int calculateOverclockHeat(MTEBaseModule module, MTEForgeOfGods go } else { actualHeat = recipeHeat; } - } else if (godforge.isUpgradeActive(17)) { + } else if (godforge.isUpgradeActive(CNTI)) { actualHeat = Math.min(recipeHeat, 30000); } else { actualHeat = Math.min(recipeHeat, 15000); @@ -96,11 +98,11 @@ public static int calculateOverclockHeat(MTEBaseModule module, MTEForgeOfGods go public static void calculateSpeedBonusForModules(MTEBaseModule module, MTEForgeOfGods godforge) { double speedBonus = 1; - if (godforge.isUpgradeActive(1)) { + if (godforge.isUpgradeActive(IGCC)) { speedBonus = Math.pow(module.getHeat(), -0.01); } - if (godforge.isUpgradeActive(22)) { + if (godforge.isUpgradeActive(DOR)) { if (module instanceof MTEPlasmaModule) { speedBonus /= Math.pow(module.getMaxParallel(), 0.02); } else { @@ -109,7 +111,7 @@ public static void calculateSpeedBonusForModules(MTEBaseModule module, MTEForgeO } if (module instanceof MTEExoticModule) { - if (godforge.isUpgradeActive(25)) { + if (godforge.isUpgradeActive(PA)) { speedBonus = Math.sqrt(speedBonus); } else { speedBonus = 1; @@ -141,17 +143,17 @@ public static void calculateMaxParallelForModules(MTEBaseModule module, MTEForge } if (module instanceof MTEMoltenModule - || (module instanceof MTESmeltingModule && godforge.isUpgradeActive(16))) { + || (module instanceof MTESmeltingModule && godforge.isUpgradeActive(DOP))) { isMoltenOrSmeltingWithUpgrade = true; } - if (godforge.isUpgradeActive(10)) { + if (godforge.isUpgradeActive(CTCDD)) { node53 = 2; } - if (godforge.isUpgradeActive(6)) { + if (godforge.isUpgradeActive(SA)) { fuelFactorMultiplier = 1 + calculateEffectiveFuelFactor(godforge) / 15f; - if (godforge.isUpgradeActive(13)) { + if (godforge.isUpgradeActive(TCT)) { if (isMoltenOrSmeltingWithUpgrade) { fuelFactorMultiplier *= 3; } else { @@ -160,7 +162,7 @@ public static void calculateMaxParallelForModules(MTEBaseModule module, MTEForge } } - if (godforge.isUpgradeActive(18)) { + if (godforge.isUpgradeActive(EPEC)) { if (isMoltenOrSmeltingWithUpgrade) { heatMultiplier = 1 + module.getHeat() / 15000f; } else { @@ -168,7 +170,7 @@ public static void calculateMaxParallelForModules(MTEBaseModule module, MTEForge } } - if (godforge.isUpgradeActive(21)) { + if (godforge.isUpgradeActive(POS)) { if (isMoltenOrSmeltingWithUpgrade) { upgradeAmountMultiplier = 1 + godforge.getTotalActiveUpgrades() / 5f; } else { @@ -179,7 +181,7 @@ public static void calculateMaxParallelForModules(MTEBaseModule module, MTEForge float totalBonuses = node53 * fuelFactorMultiplier * heatMultiplier * upgradeAmountMultiplier; if (module instanceof MTEExoticModule) { - if (godforge.isUpgradeActive(25)) { + if (godforge.isUpgradeActive(PA)) { totalBonuses = (float) Math.sqrt(totalBonuses); } else { totalBonuses = 1; @@ -195,11 +197,11 @@ public static void calculateEnergyDiscountForModules(MTEBaseModule module, MTEFo double fillRatioDiscount = 1; double maxBatteryDiscount = 1; - if (godforge.isUpgradeActive(8)) { + if (godforge.isUpgradeActive(REC)) { maxBatteryDiscount = 1 - (1 - Math.pow(1.05, -0.05 * godforge.getMaxBatteryCharge())) / 20; } - if (godforge.isUpgradeActive(19)) { + if (godforge.isUpgradeActive(IMKG)) { double fillRatioMinusZeroPointFive = (double) godforge.getBatteryCharge() / godforge.getMaxBatteryCharge() - 0.5; if (module instanceof MTEPlasmaModule) { @@ -210,7 +212,7 @@ public static void calculateEnergyDiscountForModules(MTEBaseModule module, MTEFo } if (module instanceof MTEExoticModule) { - if (godforge.isUpgradeActive(25)) { + if (godforge.isUpgradeActive(PA)) { fillRatioDiscount = Math.sqrt(fillRatioDiscount); maxBatteryDiscount = Math.sqrt(maxBatteryDiscount); } else { @@ -225,11 +227,11 @@ public static void calculateEnergyDiscountForModules(MTEBaseModule module, MTEFo public static void calculateProcessingVoltageForModules(MTEBaseModule module, MTEForgeOfGods godforge) { long voltage = 2_000_000_000; - if (godforge.isUpgradeActive(4)) { + if (godforge.isUpgradeActive(GISS)) { voltage += calculateEffectiveFuelFactor(godforge) * 100_000_000L; } - if (godforge.isUpgradeActive(23)) { + if (godforge.isUpgradeActive(NGMS)) { voltage *= Math.pow(4, godforge.getRingAmount()); } @@ -240,20 +242,20 @@ public static void setMiscModuleParameters(MTEBaseModule module, MTEForgeOfGods int plasmaTier = 0; double overclockTimeFactor = 2; - if (godforge.isUpgradeActive(30)) { + if (godforge.isUpgradeActive(END)) { plasmaTier = 2; - } else if (godforge.isUpgradeActive(24)) { + } else if (godforge.isUpgradeActive(SEDS)) { plasmaTier = 1; } - if (godforge.isUpgradeActive(14)) { + if (godforge.isUpgradeActive(GGEBE)) { if (module instanceof MTEPlasmaModule) { overclockTimeFactor = 2.3; } else { overclockTimeFactor = 2.15; } if (module instanceof MTEExoticModule) { - if (godforge.isUpgradeActive(25)) { + if (godforge.isUpgradeActive(PA)) { overclockTimeFactor = 2 + Math.pow(overclockTimeFactor - 2, 2); } else { overclockTimeFactor = 2; @@ -261,25 +263,25 @@ public static void setMiscModuleParameters(MTEBaseModule module, MTEForgeOfGods } } - module.setUpgrade83(godforge.isUpgradeActive(19)); - module.setMultiStepPlasma(godforge.isUpgradeActive(15)); + module.setUpgrade83(godforge.isUpgradeActive(IMKG)); + module.setMultiStepPlasma(godforge.isUpgradeActive(TPTP)); module.setPlasmaTier(plasmaTier); - module.setMagmatterCapable(godforge.isUpgradeActive(30)); - module.setVoltageConfig(godforge.isUpgradeActive(28)); + module.setMagmatterCapable(godforge.isUpgradeActive(END)); + module.setVoltageConfig(godforge.isUpgradeActive(TBF)); module.setOverclockTimeFactor(overclockTimeFactor); } public static boolean allowModuleConnection(MTEBaseModule module, MTEForgeOfGods godforge) { - if (module instanceof MTEMoltenModule && godforge.isUpgradeActive(5)) { + if (module instanceof MTEMoltenModule && godforge.isUpgradeActive(FDIM)) { return true; } - if (module instanceof MTEPlasmaModule && godforge.isUpgradeActive(7)) { + if (module instanceof MTEPlasmaModule && godforge.isUpgradeActive(GPCI)) { return true; } - if (module instanceof MTEExoticModule && godforge.isUpgradeActive(11)) { + if (module instanceof MTEExoticModule && godforge.isUpgradeActive(QGPIU)) { return true; } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/MilestoneFormatter.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/MilestoneFormatter.java new file mode 100644 index 00000000000..a1b4a9c9682 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/MilestoneFormatter.java @@ -0,0 +1,47 @@ +package tectech.thing.metaTileEntity.multi.godforge.util; + +import static gregtech.api.util.GTUtility.formatNumbers; +import static tectech.util.TTUtility.toExponentForm; + +import java.math.BigInteger; + +public enum MilestoneFormatter { + + NONE, + COMMA, + EXPONENT; + + public static final MilestoneFormatter[] VALUES = values(); + + public MilestoneFormatter cycle() { + return switch (this) { + case NONE -> COMMA; + case COMMA -> EXPONENT; + case EXPONENT -> NONE; + }; + } + + public String format(Number number) { + return switch (this) { + case NONE -> number.toString(); + case COMMA -> { + if (number instanceof BigInteger bi) yield formatNumbers(bi); + else yield formatNumbers(number.longValue()); + } + case EXPONENT -> { + if (number instanceof BigInteger bi) { + if (bi.compareTo(BigInteger.valueOf(1_000L)) > 0) { + yield toExponentForm(bi); + } + yield bi.toString(); + } else { + long value = number.longValue(); + if (value > 1_000L) { + yield toExponentForm(value); + } + yield Long.toString(value); + } + } + }; + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/MilestoneIcon.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/MilestoneIcon.java new file mode 100644 index 00000000000..41af5b0e187 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/MilestoneIcon.java @@ -0,0 +1,46 @@ +package tectech.thing.metaTileEntity.multi.godforge.util; + +import net.minecraft.util.StatCollector; + +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Size; + +import tectech.thing.gui.TecTechUITextures; + +public enum MilestoneIcon { + + CHARGE(TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CHARGE, 60, 75, "power"), + CONVERSION(TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CONVERSION, 54, 75, "recipe"), + CATALYST(TecTechUITextures.PICTURE_GODFORGE_MILESTONE_CATALYST, 75, 75, "fuel"), + COMPOSITION(TecTechUITextures.PICTURE_GODFORGE_MILESTONE_COMPOSITION, 75, 75, "purchasable"), + + ; + + public static final MilestoneIcon[] VALUES = values(); + + private final UITexture symbol; + private final Size size; + private final String name; + + MilestoneIcon(UITexture symbol, int width, int height, String shortName) { + this.symbol = symbol; + this.size = new Size(width, height); + this.name = "gt.blockmachines.multimachine.FOG." + shortName + "milestone"; + } + + public UITexture getSymbol() { + return symbol; + } + + public Size getSize() { + return size; + } + + public float getWidthRatio() { + return 1.0f * size.width / size.height; + } + + public String getNameText() { + return StatCollector.translateToLocal(name); + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/UpgradeColor.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/UpgradeColor.java new file mode 100644 index 00000000000..7bcab73f267 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/util/UpgradeColor.java @@ -0,0 +1,72 @@ +package tectech.thing.metaTileEntity.multi.godforge.util; + +import com.gtnewhorizons.modularui.api.drawable.UITexture; + +import tectech.thing.gui.TecTechUITextures; + +public enum UpgradeColor { + + // spotless:off + + BLUE( + TecTechUITextures.BACKGROUND_GLOW_BLUE, + TecTechUITextures.PICTURE_OVERLAY_BLUE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_BLUE_OPAQUE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_BLUE), + + PURPLE( + TecTechUITextures.BACKGROUND_GLOW_PURPLE, + TecTechUITextures.PICTURE_OVERLAY_PURPLE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_PURPLE_OPAQUE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_PURPLE), + + ORANGE( + TecTechUITextures.BACKGROUND_GLOW_ORANGE, + TecTechUITextures.PICTURE_OVERLAY_ORANGE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_ORANGE_OPAQUE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_ORANGE), + + GREEN( + TecTechUITextures.BACKGROUND_GLOW_GREEN, + TecTechUITextures.PICTURE_OVERLAY_GREEN, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_GREEN_OPAQUE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_GREEN), + + RED( + TecTechUITextures.BACKGROUND_GLOW_RED, + TecTechUITextures.PICTURE_OVERLAY_RED, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_RED_OPAQUE, + TecTechUITextures.PICTURE_UPGRADE_CONNECTOR_RED), + + ; + + // spotless:on + + private final UITexture background; + private final UITexture overlay; + private final UITexture opaqueConnector; + private final UITexture connector; + + UpgradeColor(UITexture background, UITexture overlay, UITexture opaqueConnector, UITexture connector) { + this.background = background; + this.overlay = overlay; + this.opaqueConnector = opaqueConnector; + this.connector = connector; + } + + public UITexture getBackground() { + return background; + } + + public UITexture getOverlay() { + return overlay; + } + + public UITexture getOpaqueConnector() { + return opaqueConnector; + } + + public UITexture getConnector() { + return connector; + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeData.java b/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeData.java index f78e0b92bbc..32eac048465 100644 --- a/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeData.java +++ b/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeData.java @@ -4,7 +4,6 @@ import static net.minecraft.util.StatCollector.translateToLocal; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -189,7 +188,8 @@ public void onBlockDestroyed() { for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { IGregTechTileEntity gregTechTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(side); - if (gregTechTileEntity != null && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeData neighbor) { + if (gregTechTileEntity != null && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeData neighbor + && neighbor.isConnectedAtSide(side.getOpposite())) { neighbor.mConnections &= ~side.getOpposite().flag; neighbor.connectionCount--; } @@ -223,37 +223,6 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } } - @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, - float aY, float aZ, ItemStack aTool) { - IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); - - if (this.isConnectedAtSide(wrenchingSide)) { - this.mConnections &= ~wrenchingSide.flag; - this.connectionCount--; - - IGregTechTileEntity gregTechTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(wrenchingSide); - - if (gregTechTileEntity != null && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeData neighbor) { - neighbor.mConnections &= ~wrenchingSide.getOpposite().flag; - neighbor.connectionCount--; - } - - } else { - this.mConnections |= wrenchingSide.flag; - this.connectionCount++; - - IGregTechTileEntity gregTechTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(wrenchingSide); - - if (gregTechTileEntity != null && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeData neighbor) { - neighbor.mConnections |= wrenchingSide.getOpposite().flag; - neighbor.connectionCount--; - } - } - - return super.onWrenchRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); - } - @Override public boolean canConnectData(ForgeDirection side) { return true; diff --git a/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeEnergy.java b/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeEnergy.java index 33219cb70c3..e94f4d31ff3 100644 --- a/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeEnergy.java +++ b/src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeEnergy.java @@ -4,7 +4,6 @@ import static net.minecraft.util.StatCollector.translateToLocal; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -156,8 +155,8 @@ public void onBlockDestroyed() { for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { IGregTechTileEntity gregTechTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(side); - if (gregTechTileEntity != null - && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeEnergy neighbor) { + if (gregTechTileEntity != null && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeEnergy neighbor + && neighbor.isConnectedAtSide(side.getOpposite())) { neighbor.mConnections &= ~side.getOpposite().flag; neighbor.connectionCount--; } @@ -191,39 +190,6 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } } - @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, - float aY, float aZ, ItemStack aTool) { - IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); - - if (this.isConnectedAtSide(wrenchingSide)) { - this.mConnections &= ~wrenchingSide.flag; - this.connectionCount--; - - IGregTechTileEntity gregTechTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(wrenchingSide); - - if (gregTechTileEntity != null - && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeEnergy neighbor) { - neighbor.mConnections &= ~wrenchingSide.getOpposite().flag; - neighbor.connectionCount--; - } - - } else { - this.mConnections |= wrenchingSide.flag; - this.connectionCount++; - - IGregTechTileEntity gregTechTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(wrenchingSide); - - if (gregTechTileEntity != null - && gregTechTileEntity.getMetaTileEntity() instanceof MTEPipeEnergy neighbor) { - neighbor.mConnections |= wrenchingSide.getOpposite().flag; - neighbor.connectionCount--; - } - } - - return super.onWrenchRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); - } - @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { active = nbtTagCompound.getBoolean("eActive"); diff --git a/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/36.png b/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/36.png index 951edab1172..746dd4ee96f 100644 Binary files a/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/36.png and b/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/36.png differ diff --git a/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/6.png b/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/6.png index ca649b92ea6..8329ae97159 100644 Binary files a/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/6.png and b/src/main/resources/assets/ggfab/textures/items/gt.ggfab.d1/6.png differ diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index 0ed55b6ee28..850e013a73c 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -793,6 +793,9 @@ GT5U.waila.drone_downlink.noConnection=Not connected GT5U.waila.drone_downlink.connection=Connect to centre: GT5U.waila.drone_downlink.connectionCount=Connection Count: GT5U.waila.drone_downlink.droneLevel=Drone Level: +GT5U.waila.producing=Producing: +GT5U.waila.producing.andmore= And %d More... + achievement.flintpick=First Tools achievement.flintpick.desc=Craft a flint pick @@ -1627,6 +1630,12 @@ gt.solar.system.mercury=Mercury gt.solar.system.titan=Titan gt.solar.system.phobos=Phobos +item.flintSword.name=Flint Sword +item.flintAxe.name=Flint Axe +item.flintShovel.name=Flint Shovel +item.flintPickaxe.name=Flint Pickaxe +item.flintHoe.name=Flint Hoe + gt.multiBlock.controller.cokeOven=Coke Oven gt.locker.waila_armor_slot_none=Slot %s: §7None diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/COOLANT_DUCT_CASING.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/COOLANT_DUCT_CASING.png new file mode 100644 index 00000000000..05a642390b8 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/COOLANT_DUCT_CASING.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/HEATING_DUCT_CASING.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/HEATING_DUCT_CASING.png new file mode 100644 index 00000000000..e67fa4aa7f0 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/HEATING_DUCT_CASING.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png index c7aa4234b9e..20fc47ebb1f 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_SHIELDED_ACCELERATOR.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY.png index 6092ec4c180..41faf024689 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY.png and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png index ffd43d8dc23..fa8c266e909 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png.mcmeta new file mode 100644 index 00000000000..506cb885792 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":4 + } +} diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png index 3bb29bbda66..cbdd48cac74 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png.mcmeta new file mode 100644 index 00000000000..506cb885792 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":4 + } +} diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_GLOW.png index b7955d63ab8..af3a94364a6 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_GLOW.png and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/picture/arrow_gray.png b/src/main/resources/assets/gregtech/textures/gui/picture/arrow_gray.png new file mode 100644 index 00000000000..392add33206 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/picture/arrow_gray.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/picture/plasma_arc_furnace_recycling.png b/src/main/resources/assets/gregtech/textures/gui/picture/plasma_arc_furnace_recycling.png deleted file mode 100644 index 2dbf7ce0705..00000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/picture/plasma_arc_furnace_recycling.png and /dev/null differ diff --git a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER.png b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER.png index 2c31a02b59e..8233bfdc9b0 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER.png and b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER_OVERLAY.png index e3033547c38..aaf105ca9aa 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_ELECTRIC_SCREWDRIVER_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER.png b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER.png index eed4a90317c..834cd174a47 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER.png and b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/iconsets/HANDLE_SCREWDRIVER_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt.png index 622a45dc42c..4059c4f7d5d 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Botania-Dragonstone/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt.png index 3a8108a64d2..a6388077252 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver.png index 6d6a4c02215..4ed3d7b1dfd 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Dreamwood/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt.png index bbfdedeba93..7129de0b6e3 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver.png index 377e34f1888..69bc768b6bc 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingrock/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt.png index 8bc1fd82762..85f3d73f364 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver.png index 44714a53363..a6bea4082e9 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/Livingwood/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt.png index 4880804fee0..63a4a47d8a6 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt_OVERLAY.png index 33336d7ff8b..82559bbcee8 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver.png index 2a28cabc34c..f9c08079c29 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver_OVERLAY.png index 4a65b594014..39d9cfc1274 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/MagnetohydrodynamicallyConstrainedStarMatter/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt.png index 068a3909b7e..0828889f9b9 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/WhiteDwarfMatter/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt.png index 829db27426e..f2979d98491 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver.png index d08d1a0207a..175c53a34d8 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/bedrockium/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt.png index 2b1e56eaad6..de1762e3954 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver.png index b66fbe80615..6c1c2ef5072 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/eternity/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt.png index bbdfa256373..f62242c2af7 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/exohalkonite/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt.png index 3c63df6bfdc..e4ac4989fb7 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver.png index 8004e42d529..4d66d901a7f 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotexohalkonite/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt.png index fe663719309..4f25d09cc93 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/hotprotohalkonite/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt.png index c3056f7ad04..3c221897952 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver.png index 11873775672..9c516da5ea0 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/infinity/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt.png index 89fcf268793..2e4a0a08187 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver.png index 1354d0b76f8..35a0987d283 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/magmatter/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt.png index 587217e11df..1e4812c68ab 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/protohalkonite/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt.png index 793a3600ebd..65f7f702f51 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver.png index 1f97bc45d0b..d64fc012b48 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/spacetime/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt.png index 2353a5ff663..9c88c6e3a30 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver.png index 2343ef9d24b..2d817a159a6 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/CUSTOM/universium/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt_OVERLAY.png index 9c310b5b096..9b93e46cff3 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver.png index 6b0517b8791..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver_OVERLAY.png index 2aea2f961d4..dce77e23166 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ENRICHED/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt_OVERLAY.png index d2c1f987c0c..9b93e46cff3 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver_OVERLAY.png index 8235e1df693..dce77e23166 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver.png index 6b0517b8791..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_A/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt_OVERLAY.png index 036f53807f4..425c21fc04d 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver_OVERLAY.png index 2c279e4205f..faa140a72d9 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt.png index c6f1bc9d38e..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver.png index 6b0517b8791..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/NUCLEAR/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver.png index 6b0517b8791..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver_OVERLAY.png index d83a131004a..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/REFINED/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt.png index 8675564a9b1..fc2d7c88b71 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bolt_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver.png index a4f9a321788..141b62f5b13 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver_OVERLAY.png index 3f0d6efcacd..1f1e672d0db 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver_OVERLAY.png and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/toolHeadScrewdriver_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/tools/flintAxe.png b/src/main/resources/assets/gregtech/textures/items/tools/flintAxe.png new file mode 100644 index 00000000000..4a1a8c8334b Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/tools/flintAxe.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/tools/flintHoe.png b/src/main/resources/assets/gregtech/textures/items/tools/flintHoe.png new file mode 100644 index 00000000000..ed788a127f6 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/tools/flintHoe.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/tools/flintPickaxe.png b/src/main/resources/assets/gregtech/textures/items/tools/flintPickaxe.png new file mode 100644 index 00000000000..d26be7b33fe Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/tools/flintPickaxe.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/tools/flintShovel.png b/src/main/resources/assets/gregtech/textures/items/tools/flintShovel.png new file mode 100644 index 00000000000..48290a5a995 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/tools/flintShovel.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/tools/flintSword.png b/src/main/resources/assets/gregtech/textures/items/tools/flintSword.png new file mode 100644 index 00000000000..a8c538a4fe7 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/tools/flintSword.png differ diff --git a/src/main/resources/assets/gtnhlanth/lang/en_US.lang b/src/main/resources/assets/gtnhlanth/lang/en_US.lang index b9729347d53..7bc43c8d5c1 100644 --- a/src/main/resources/assets/gtnhlanth/lang/en_US.lang +++ b/src/main/resources/assets/gtnhlanth/lang/en_US.lang @@ -13,7 +13,7 @@ gtnhlanth.tt.hintdot=Hint block with dot %s GT5U.gui.text.gtnhlanth.nocoolant=No coolant present in machine! GT5U.gui.text.gtnhlanth.inscoolant=Insufficient coolant in machine! GT5U.gui.text.gtnhlanth.noaccel=Particle type can't be accelerated! -GT5U.gui.text.gtnhlanth.low_input_rate=Input amount too low! +GT5U.gui.text.gtnhlanth.low_input_eut=Input EU/t too low to produce photons! GT5U.gui.text.gtnhlanth.scerror=Math error, broken recipe? # NEI diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png index 8d03f0fe170..3c86ca2a325 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t1.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png index 23e79ebb16a..8070f653ef4 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.antenna_t2.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png index 80e1b9af979..e5d655fc94e 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.coolant_delivery.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png index 2532325e8ed..c1d38b4335d 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png.mcmeta b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png.mcmeta new file mode 100644 index 00000000000..d2b37d77606 --- /dev/null +++ b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.electrode.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": true, + "frametime": 10 + } +} diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png index 0cd77fe120c..a95f5a5eb0e 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.focus_manipulator.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png index c7aa4234b9e..20fc47ebb1f 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png index f5cb01e83c3..06c4251d33f 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.shielded_accelerator_glass.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png index 31a73624bff..a0a94ce327a 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png and b/src/main/resources/assets/gtnhlanth/textures/blocks/casing.target_receptacle.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png b/src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png index e64484950e1..86e03a65597 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png and b/src/main/resources/assets/gtnhlanth/textures/items/etched_mask1.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png b/src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png index eebe09bdfa8..74d7c9a6076 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png and b/src/main/resources/assets/gtnhlanth/textures/items/iron_quartz_plate.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png b/src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png index bbdbfb9f53b..1539ae8011f 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png and b/src/main/resources/assets/gtnhlanth/textures/items/mask_substrate.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png b/src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png index 075d4291620..a53033f9d51 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png and b/src/main/resources/assets/gtnhlanth/textures/items/masked_mask_substrate.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/acc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/acc.png new file mode 100644 index 00000000000..7697e8206ec Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/acc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png index cbb39abb608..bde61aca195 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/asoc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png index 561e64860a8..9686bf51970 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank1.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png index 561e64860a8..364e526a1c2 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank2.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png index 561e64860a8..03c51a17574 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/blank3.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/cblank.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/cblank.png new file mode 100644 index 00000000000..f50d99f04aa Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/cblank.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ccpu.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ccpu.png new file mode 100644 index 00000000000..e463952e0db Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ccpu.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ccpu2.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ccpu2.png new file mode 100644 index 00000000000..6016b9c04e6 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ccpu2.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png index fbce1c288ca..2ee457a94f9 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/cpu.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/csoc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/csoc.png new file mode 100644 index 00000000000..5fb440e04ef Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/csoc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png index b2ee8eec84c..2daf9d19d88 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/hpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png index 109432abf39..0240e5cf351 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ilc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/lcc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/lcc.png new file mode 100644 index 00000000000..196b7189fb9 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/lcc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png index d297990869b..02c6efaf10d 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/lpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png index 388d8494d60..991bea5d761 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nand.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png index c76e03744d4..b3b8f91eac3 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ncpu.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png index c5526b530dd..048c2cc8b58 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/nor.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png index 1a3d2866f27..7a59e46bcb4 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/npic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png index ce29d88643f..faa1154a70f 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/pic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png index 4431df6b034..f7b08572de1 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ppic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/prcpu.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prcpu.png new file mode 100644 index 00000000000..bd972a50498 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prcpu.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/prhpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prhpic.png new file mode 100644 index 00000000000..c6779afbdac Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prhpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/prncpu.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prncpu.png new file mode 100644 index 00000000000..6af5abae0a9 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prncpu.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/prnpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prnpic.png new file mode 100644 index 00000000000..3dcc0740dfd Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prnpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/prpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prpic.png new file mode 100644 index 00000000000..28ae06f7560 Binary files /dev/null and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/prpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png index b4668e98871..a15b921c83c 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qbit.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png index c421ebe38b9..0ce60e66483 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/qpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png index 569fc38d75f..42d71443701 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ram.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png index 931c2a4f478..2801fbbe873 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/soc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png index 10209d8c630..b921f474dda 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ssoc.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png index 54b0d412bbb..4370da5a4fb 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/uhpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png index a3274605e5d..f1eb42384b3 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png and b/src/main/resources/assets/gtnhlanth/textures/items/photomask/ulpic.png differ diff --git a/src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png b/src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png index 14e9cd5b482..09f54483a3c 100644 Binary files a/src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png and b/src/main/resources/assets/gtnhlanth/textures/items/substrate_precursor.png differ diff --git a/src/main/resources/assets/kubatech/textures/blocks/casing/defc_2.png b/src/main/resources/assets/kubatech/textures/blocks/casing/defc_2.png index 18948e711d1..7aa78f8f3cc 100644 Binary files a/src/main/resources/assets/kubatech/textures/blocks/casing/defc_2.png and b/src/main/resources/assets/kubatech/textures/blocks/casing/defc_2.png differ diff --git a/src/main/resources/assets/kubatech/textures/blocks/casing/defc_3.png b/src/main/resources/assets/kubatech/textures/blocks/casing/defc_3.png index 7aa78f8f3cc..18948e711d1 100644 Binary files a/src/main/resources/assets/kubatech/textures/blocks/casing/defc_3.png and b/src/main/resources/assets/kubatech/textures/blocks/casing/defc_3.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE1.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE1.png deleted file mode 100644 index 020ed28da82..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE1.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE2.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE2.png deleted file mode 100644 index 12e321b7e9f..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE2.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE3.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE3.png deleted file mode 100644 index c6d77153564..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE3.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE4.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE4.png deleted file mode 100644 index 7f21c841aae..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE4.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE5.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE5.png deleted file mode 100644 index 3466822e049..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE5.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE6.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE6.png deleted file mode 100644 index c1ae3ca1af4..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE6.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE7.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE7.png deleted file mode 100644 index a0263e43419..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE7.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE8.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE8.png deleted file mode 100644 index 26956df456e..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE8.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE9.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE9.png deleted file mode 100644 index f30b34fe4a8..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE9.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE1.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE1.png deleted file mode 100644 index 288df82736d..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE1.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE1.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE1.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE1.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE2.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE2.png deleted file mode 100644 index b8c344736e8..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE2.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE2.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE2.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE2.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE3.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE3.png deleted file mode 100644 index 0ef17da006e..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE3.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE3.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE3.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE3.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE4.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE4.png deleted file mode 100644 index 07dd921123a..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE4.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE4.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE4.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE4.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE5.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE5.png deleted file mode 100644 index 49e957bc1fa..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE5.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE5.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE5.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE5.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE6.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE6.png deleted file mode 100644 index 2dd6ca5a8ec..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE6.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE6.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE6.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE6.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE7.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE7.png deleted file mode 100644 index 16091f0e18c..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE7.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE7.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE7.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE7.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE8.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE8.png deleted file mode 100644 index 698d96bf111..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE8.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE8.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE8.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE8.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE9.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE9.png deleted file mode 100644 index 963d8b1a225..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE9.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE9.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE9.png.mcmeta deleted file mode 100644 index d746756cbd1..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/LARGECENTRIFUGE_ACTIVE9.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation":{} -} \ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE1.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE1.png deleted file mode 100644 index e9b05f8181e..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE1.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE1.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE1.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE1.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE2.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE2.png deleted file mode 100644 index 07b795be97c..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE2.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE2.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE2.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE2.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE3.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE3.png deleted file mode 100644 index e1ad601839e..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE3.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE3.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE3.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE3.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE4.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE4.png deleted file mode 100644 index f69d8cb0ec8..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE4.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE4.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE4.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE4.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE5.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE5.png deleted file mode 100644 index f863ec49e6b..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE5.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE5.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE5.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE5.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE6.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE6.png deleted file mode 100644 index a61511d4c22..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE6.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE6.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE6.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE6.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE7.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE7.png deleted file mode 100644 index 73a0abe065a..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE7.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE7.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE7.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE7.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE8.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE8.png deleted file mode 100644 index 269ab80e3b5..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE8.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE8.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE8.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE8.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE9.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE9.png deleted file mode 100644 index 54ac28edc86..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE9.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE9.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE9.png.mcmeta deleted file mode 100644 index dd1bedb1201..00000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE9.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL1.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL1.png deleted file mode 100644 index 34991094fd7..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL1.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL2.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL2.png deleted file mode 100644 index 50ce1abd9c1..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL2.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL3.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL3.png deleted file mode 100644 index c4a02dcd25c..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL3.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL4.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL4.png deleted file mode 100644 index 5955b40f1e6..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL4.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL5.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL5.png deleted file mode 100644 index 7fee9a77ade..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL5.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL6.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL6.png deleted file mode 100644 index ff418776b69..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL6.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL7.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL7.png deleted file mode 100644 index 59217da11ff..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL7.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL8.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL8.png deleted file mode 100644 index 3af97940056..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL8.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL9.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL9.png deleted file mode 100644 index d1210901762..00000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/iconsets/SC_TURBINE_IDEL9.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_0.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_0.png new file mode 100644 index 00000000000..482c67e6be2 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_0.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_1.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_1.png new file mode 100644 index 00000000000..2b4fc736115 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_1.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_2.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_2.png new file mode 100644 index 00000000000..45b8ec9f6f6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_2.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_3.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_3.png new file mode 100644 index 00000000000..bad33ed910d Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_3.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_4.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_4.png new file mode 100644 index 00000000000..2787d8530e5 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_4.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_5.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_5.png new file mode 100644 index 00000000000..355cbe27192 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_5.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_6.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_6.png new file mode 100644 index 00000000000..44d30c40dde Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_6.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_7.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_7.png new file mode 100644 index 00000000000..2c2c84a1e71 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_7.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_8.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_8.png new file mode 100644 index 00000000000..dcfe6ac299b Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_8.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_9.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_9.png new file mode 100644 index 00000000000..a7c2aec6ecc Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/mode_9.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_0.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_0.png new file mode 100644 index 00000000000..6416b809c07 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_0.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_1.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_1.png new file mode 100644 index 00000000000..5bada8dd710 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_1.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_2.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_2.png new file mode 100644 index 00000000000..808c2659813 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_2.png differ diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_3.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_3.png new file mode 100644 index 00000000000..de9cbead42f Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/gui/overlay_button/throughput_3.png differ diff --git a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/55.png b/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/55.png index 7336e19c220..97ae3949a06 100644 Binary files a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/55.png and b/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/55.png differ diff --git a/src/main/resources/assets/miscutils/textures/items/MU-metatool.01/4.png b/src/main/resources/assets/miscutils/textures/items/MU-metatool.01/4.png new file mode 100644 index 00000000000..0cd00c493c2 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/items/MU-metatool.01/4.png differ diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 3117cf6a0c5..f2986f0a5c8 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -503,10 +503,11 @@ gt.blockmachines.hatch.param.tier.10.name=Parametrizer tXt gt.blockmachines.hatch.param.desc.0=For parametrization of Multiblocks gt.blockmachines.hatch.param.desc.1=E=mine*craft -gt.blockmachines.hatch.certain.tier.07.name=Uncertainty Resolver -gt.blockmachines.hatch.certain.tier.10.name=Uncertainty Resolver X +gt.blockmachines.hatch.certain.tier.05.name=Uncertainty Resolver +gt.blockmachines.hatch.certain.tier.07.name=Uncertainty Resolver X gt.blockmachines.hatch.certain.desc.0=Feeling certain, or not? gt.blockmachines.hatch.certain.desc.1=Schrödinger equation in a box +gt.blockmachines.hatch.certain.desc.2=Deprecated! Use Uncertainty Resolver X gt.blockmachines.hatch.datain.tier.07.name=Optical Reception Connector gt.blockmachines.hatch.datain.desc.0=Quantum Data Input for Multiblocks @@ -644,6 +645,7 @@ gt.blockcasingsBA0.8.desc.1=Who wouldn't want a 32k epoxy multi? #Multiblocks gt.blockmachines.multimachine.em.transformer.name=Active Transformer +gt.blockmachines.multimachine.em.transformer.machinetype=Active Transformer, AT gt.blockmachines.multimachine.em.transformer.hint=1 - Energy IO Hatches or High Power Casing gt.blockmachines.multimachine.em.transformer.desc.1=Can transform to and from any voltage gt.blockmachines.multimachine.em.transformer.desc.2=Only 0.004% power loss, HAYO! @@ -699,6 +701,7 @@ gt.blockmachines.multimachine.em.switch.desc.0=Controller block of the Network S gt.blockmachines.multimachine.em.switch.desc.1=Routes and distributes computation gt.blockmachines.multimachine.em.computer.name=Quantum Computer +gt.blockmachines.multimachine.em.computer.machinetype=Quantum Computer, QC gt.blockmachines.multimachine.em.computer.hint.0=1 - Classic/Data Hatches or Computer casing gt.blockmachines.multimachine.em.computer.hint.1=2 - Rack Hatches or Advanced computer casing gt.blockmachines.multimachine.em.computer.desc=You need it to process the number above @@ -714,8 +717,8 @@ gt.blockmachines.multimachine.em.databank.name=Data Bank gt.blockmachines.multimachine.em.databank.hint.0=1 - Classic Hatches or high power casing gt.blockmachines.multimachine.em.databank.hint.1=2 - Data Access/Data Bank Master Hatches or computer casing gt.blockmachines.multimachine.em.databank.desc.0=Controller block of the Data Bank -gt.blockmachines.multimachine.em.databank.desc.1=Used to supply Assembling Lines with more Data Sticks -gt.blockmachines.multimachine.em.databank.desc.2=and give multiple Assembling Lines access to the same Data Stick +gt.blockmachines.multimachine.em.databank.desc.1=Used to supply Assembly Lines with more Data Sticks +gt.blockmachines.multimachine.em.databank.desc.2=and give multiple Assembly Lines access to the same Data Stick gt.blockmachines.multimachine.em.databank.desc.3=Use screwdriver to toggle wireless mode gt.blockmachines.multimachine.em.junction.name=Matter Junction @@ -765,7 +768,7 @@ gt.blockmachines.multimachine.em.scanner.desc.0=Controller block of the Elementa gt.blockmachines.multimachine.em.research.type=Research Station, Scanner gt.blockmachines.multimachine.em.research.hint.0=1 - Classic/Data Hatches or Computer casing gt.blockmachines.multimachine.em.research.hint.1=2 - Holder Hatch -gt.blockmachines.multimachine.em.research.desc.1=Used to scan Data Sticks for Assembling Line Recipes +gt.blockmachines.multimachine.em.research.desc.1=Used to scan Data Sticks for Assembly Line Recipes gt.blockmachines.multimachine.em.research.desc.2=Needs to be fed with computation to work gt.blockmachines.multimachine.em.research.desc.3=Does not consume the item until the Data Stick is written gt.blockmachines.multimachine.em.research.desc.4=Use screwdriver to change mode @@ -990,7 +993,7 @@ fog.upgrade.text.0=Unlocks the base functionality of the Forge of the Gods, mean fog.upgrade.text.1=Unlocks a recipe time reduction multiplier based on the current heat the multi is running at. This bonus is calculated via following formula: Multiplier = 1 / (Heat^0.01) fog.upgrade.text.2=Increases fuel efficiency by multiplying the actual fuel consumption by 0.8 fog.upgrade.text.3=Multiplies the maximum fuel consumption by 1.2 -fog.upgrade.text.4=Increases the base processing voltage of the multi by: Stellar Fuel Units/sec * 10^8 EU/t +fog.upgrade.text.4=Increases the base processing voltage of all modules by: Stellar Fuel Units/sec * 10^8 EU/t fog.upgrade.text.5=Unlocks the Helioflux Melting Core module. fog.upgrade.text.6=Unlocks a multiplier to maximum parallel based on fuel consumption rate. This bonus is calculated via this formula: Multiplier = 1 + (Stellar Fuel Units/sec) / 15 fog.upgrade.text.7=Unlocks the Heliothermal Plasma Fabricator module and basic element -> plasma processing (1 step plasmas, T3 fusion maximum). @@ -998,15 +1001,15 @@ fog.upgrade.text.8=Unlocks a configuration window for maximum battery size and i fog.upgrade.text.9=Increases maximum fuel consumption by 1 Stellar Fuel Unit/sec for every purchased upgrade. fog.upgrade.text.10=Adds a x2 multiplier to maximum parallel. fog.upgrade.text.11=Unlocks the Heliofusion Exoticizer module and quark gluon plasma creation. At this point this module is not affected by any other multipliers or bonuses from other upgrades. -fog.upgrade.text.12=Improves the fuel consumption -> heat conversion formula. Improved formula: Heat = log1.12(Stellar Fuel Units/sec) * 1000 + 12601 +fog.upgrade.text.12=Improves the fuel consumption -> heat conversion formula. Improved formula: Power Forge Heat = log1.12(Stellar Fuel Units/sec) * 1000 + 12601, Melting Core Heat = log1.18(Stellar Fuel Units/sec) * 1000 + 12601 fog.upgrade.text.13=Improves the formula of SA to: Multiplier = 1 + (Stellar Fuel Units/sec) / 5 fog.upgrade.text.14=Improves the OC formula from 4/2 OCs to 4/2.3 OCs. fog.upgrade.text.15=Allows the Heliothermal Plasma Fabricator to process multi step plasmas. Tier restriction still applies. fog.upgrade.text.16=Allows the Helioflare Power Forge to receive the full benefits of the Helioflux Melting Core upgrade path. fog.upgrade.text.17=Increases the cap of EBF heat bonuses to 30,000K. fog.upgrade.text.18=Unlocks a multiplier to maximum parallel based on current heat. This bonus is calculated via this formula: Multiplier = 1 + Heat / 15000 -fog.upgrade.text.19=Improves the EBF energy reduction heat bonus from 5% to 8% and adds an energy discount based on the fill level of the internal battery. This bonus is calculated via this formula: Discount = (Current fill level / Max Capacity - 0.5)^2 * (-0.6) + 0.15 -fog.upgrade.text.20=EBF heat bonuses are granted above 30,000K, but the heat value used in heat bonus calculations is determined by this formula: Actual Heat = 30000 + (Current Heat - 30000)^0.85 +fog.upgrade.text.19=Improves the EBF energy reduction heat bonus from 5% to 8% and adds an energy discount based on the fill level of the internal battery. This bonus is calculated via the formula: Discount = (Current fill level / Max Capacity - 0.5)^2 * (-0.6) + 0.15, multiplied by 2/3 for modules other than the Plasma Fabricator +fog.upgrade.text.20=EBF heat bonuses are granted above 30,000K, but the heat value used in heat bonus calculations is determined by this formula: Power Forge Heat = 30000 + (Current Heat - 30000)^0.85, Melting Core Heat = 30000 + (Current Heat - 30000)^0.8 fog.upgrade.text.21=Unlocks a multiplier to maximum parallel based on total amount of purchased upgrades. This bonus is calculated via this formula: Multiplier = 1 + Upgrade Amount / 5 fog.upgrade.text.22=Improves IGCC based on current maximum parallel. Improved Formula: Multiplier = (1 / Heat^0.01) / (Parallel^0.02) fog.upgrade.text.23=Multiplies maximum processing voltage by 4 per active ring, applies after other bonuses. @@ -1021,9 +1024,10 @@ fog.upgrade.text.30=Unlocks Magmatter production in the Heliofusion Exoticizer, fog.debug.resetbutton.text=Reset fog.debug.resetbutton.tooltip=Resets all upgrades to zero fog.debug.unlockall.text=Unlock all upgrades -fog.debug.gravitonshardsetter.tooltip=Set the amount of availabe graviton shards +fog.debug.gravitonshardsetter.tooltip=Set the amount of available graviton shards fog.button.fuelconfig.tooltip=Fuel Configuration Menu +fog.button.upgradetree.tooltip=Path of Celestial Transcendence fog.button.furnacemode.tooltip.01=Blast Mode fog.button.furnacemode.tooltip.02=Furnace Mode fog.button.magmattermode.tooltip.01=Quark-Gluon Plasma Mode @@ -1041,11 +1045,19 @@ fog.button.materialrequirements.tooltip.clickhere=Click to open material inserti fog.button.ejection.tooltip=Toggle Graviton Shard Ejection fog.button.formatting.tooltip=Toggle Number Formatting fog.button.exoticinputs.tooltip=Click to display expected inputs +fog.button.possibleexoticinputs.tooltip=Click to display all possible inputs fog.button.reciperefresh.tooltip=Click to reset recipe fog.button.refreshtimer.tooltip=Reset ready in fog.button.seconds=Seconds fog.button.thanks.tooltip=List of Contributors fog.button.color.tooltip=Cosmetics Menu +fog.button.statistics.tooltip=Stats Overview +fog.text.tooltip.heat=Heat value used for checking if a recipe can run +fog.text.tooltip.effectiveheat=Heat value used for calculating bonuses +fog.text.tooltip.parallel=Maximum parallel amount +fog.text.tooltip.speedbonus=Multiplier for base recipe time, making it shorter +fog.text.tooltip.energydiscount=Multiplier for base energy usage, reducing it +fog.text.tooltip.ocdivisor=Divisor for recipe time reduction per overclock (does not affect perfect OCs) achievement.gt.blockmachines.multimachine.em.forge_of_gods=Forge of the Gods @@ -1088,6 +1100,8 @@ gt.blockmachines.multimachine.FOG.milestoneinfo=View Milestone Progress gt.blockmachines.multimachine.FOG.inversionactive=Inversion Active gt.blockmachines.multimachine.FOG.inversion=Inversion gt.blockmachines.multimachine.FOG.expectedinputs=Expected Inputs +gt.blockmachines.multimachine.FOG.possibleinputsqgp=Possible Input Materials for QGP +gt.blockmachines.multimachine.FOG.possibleinputsmagmatter=Possible Input Materials for Magmatter gt.blockmachines.multimachine.FOG.inversioninfotext=Once all milestones of the Forge reach tier 7, inversion activates. This uncaps the maximum tier of all milestones and allows to scale infinitely. The scaling of each milestone changes from exponential to linear, but the granted graviton shard amount keeps increasing. The amount of progress needed for each subsequent milestone is as much as needed for the 7th tier of each milestone. The Composition milestone is once again an exception, as that continues to scale by 1 each tier, with it's own formula for calculating progress. Each module type is given a value, ranging from 1 for the Helioflare Power Forge to 5 for the Heliofusion Exoticizer in magmatter mode, then the amount of each module present is substracted by 1 and multiplied by its value. These values are added up and divided by 5, this is the final milestone tier on top of the base 7. gt.blockmachines.multimachine.FOG.powermilestone=Charge gt.blockmachines.multimachine.FOG.recipemilestone=Conversion @@ -1098,7 +1112,7 @@ gt.blockmachines.multimachine.FOG.recipes=Recipes Processed gt.blockmachines.multimachine.FOG.fuelconsumed=Fuel Units Consumed gt.blockmachines.multimachine.FOG.extensions=Extensions Built gt.blockmachines.multimachine.FOG.shardgain=Graviton Shards gained -gt.blockmachines.multimachine.FOG.consumeUpgradeMats=Click to consume upgrade materials, supply §4exact§r stacksizes +gt.blockmachines.multimachine.FOG.consumeUpgradeMats=Click to consume upgrade materials gt.blockmachines.multimachine.FOG.clickhere=Confused? Click here for some general info gt.blockmachines.multimachine.FOG.introduction=§NIntroduction gt.blockmachines.multimachine.FOG.introductioninfotext=There's a lot going on in the Forge of the Gods, which can be quite confusing at first. This menu aims to explain everything that is happening and all the capabilities/mechanics of the forge. @@ -1126,6 +1140,17 @@ gt.blockmachines.multimachine.FOG.bucket=BucketBrigade gt.blockmachines.multimachine.FOG.playtesting=Playtesting gt.blockmachines.multimachine.FOG.misi=Misi gt.blockmachines.multimachine.FOG.thanks=A huge thank you to these incredible people for helping to make this a reality! -Cloud +gt.blockmachines.multimachine.FOG.modulestats=Module Statistics +gt.blockmachines.multimachine.FOG.powerforge=Power Forge +gt.blockmachines.multimachine.FOG.meltingcore=Melting Core +gt.blockmachines.multimachine.FOG.plasmafab=Plasma Fabricator +gt.blockmachines.multimachine.FOG.exoticizer=Exoticizer +gt.blockmachines.multimachine.FOG.heat=Heat +gt.blockmachines.multimachine.FOG.effectiveheat=Effective Heat +gt.blockmachines.multimachine.FOG.speedbonus=Speed Bonus +gt.blockmachines.multimachine.FOG.energydiscount=Energy Discount +gt.blockmachines.multimachine.FOG.ocdivisor=OC Divisor +gt.blockmachines.multimachine.FOG.clickstat=Click to view value breakdown gt.blockmachines.multimachine.FOG.hint.0=1 - Classic Hatches or Transcendentally Amplified Magnetic Confinement Casing gt.blockmachines.multimachine.FOG.hint.1=2 - Module Controllers or Singularity Reinforced Stellar Shielding Casing @@ -1317,6 +1342,7 @@ gt.recipe.researchStation=Research Station gt.recipe.fog_plasma=Heliothermal Plasma Fabricator gt.recipe.fog_exotic=Heliofusion Exoticizer gt.recipe.fog_molten=Helioflux Melting Core +gt.recipe.upgrade_costs=Godforge Upgrades # NEI diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang index ac33177b27b..01515076f2b 100644 --- a/src/main/resources/assets/tectech/lang/zh_CN.lang +++ b/src/main/resources/assets/tectech/lang/zh_CN.lang @@ -403,8 +403,8 @@ gt.blockmachines.hatch.param.tier.10.name=参数仪 tXt gt.blockmachines.hatch.param.desc.0=多方块机器的参数化 gt.blockmachines.hatch.param.desc.1=E=mine*craft² -gt.blockmachines.hatch.certain.tier.07.name=未定元解析器 -gt.blockmachines.hatch.certain.tier.10.name=未定元解析器 X +gt.blockmachines.hatch.certain.tier.05.name=未定元解析器 +gt.blockmachines.hatch.certain.tier.07.name=未定元解析器 X gt.blockmachines.hatch.certain.desc.0=你真的很确定吗? gt.blockmachines.hatch.certain.desc.1=盒子里的薛定谔方程 @@ -590,7 +590,6 @@ gt.blockmachines.multimachine.em.switch.name=QoS网络交换机 gt.blockmachines.multimachine.em.switch.hint=1 - 基础仓室、光学接口或电子计算机机械方块 gt.blockmachines.multimachine.em.switch.desc.0=QoS网络交换机的控制器方块 gt.blockmachines.multimachine.em.switch.desc.1=用于路由和分发算力 -gt.blockmachines.multimachine.em.switch.desc.2=需要通过参数仪进行配置 gt.blockmachines.multimachine.em.computer.name=量子计算机 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/statistics.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/statistics.png new file mode 100644 index 00000000000..bee81de488a Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/overlay_button/statistics.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/green_checkmark.png b/src/main/resources/assets/tectech/textures/gui/picture/green_checkmark.png new file mode 100644 index 00000000000..3816be66b25 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/picture/green_checkmark.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/picture/rainbow_square.png b/src/main/resources/assets/tectech/textures/gui/picture/rainbow_square.png index 545a44c4e5d..fe2b63b50e8 100644 Binary files a/src/main/resources/assets/tectech/textures/gui/picture/rainbow_square.png and b/src/main/resources/assets/tectech/textures/gui/picture/rainbow_square.png differ diff --git a/src/mixin/java/gregtech/mixin/mixins/early/minecraft/VanillaTradingMixin.java b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/VanillaTradingMixin.java new file mode 100644 index 00000000000..1c050d0ed83 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/VanillaTradingMixin.java @@ -0,0 +1,26 @@ +package gregtech.mixin.mixins.early.minecraft; + +import java.util.Random; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.village.MerchantRecipeList; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +@Mixin(EntityVillager.class) +public class VanillaTradingMixin { + + @Inject(method = "func_146089_b", at = @At("HEAD"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) + private static void gt5u$removeEyeOfEnder(MerchantRecipeList p_146089_0_, Item p_146089_1_, Random p_146089_2_, + float p_146089_3_, CallbackInfo ci) { + if (p_146089_1_.equals(Items.ender_eye)) { + ci.cancel(); + } + } +} diff --git a/src/test/java/gregtech/api/util/LongRunningAverageTest.java b/src/test/java/gregtech/api/util/LongRunningAverageTest.java new file mode 100644 index 00000000000..9342f27fc8f --- /dev/null +++ b/src/test/java/gregtech/api/util/LongRunningAverageTest.java @@ -0,0 +1,171 @@ +package gregtech.api.util; + +import static org.junit.jupiter.api.Assertions.*; + +import java.math.BigInteger; + +import org.junit.jupiter.api.Test; + +import it.unimi.dsi.fastutil.longs.LongArrayList; +import it.unimi.dsi.fastutil.longs.LongList; + +// the main test subject is the internal 127-bit long arithmetic and ring buffer management +// so BigIntegers and Lists with manually maintained size limit is used as test reference +class LongRunningAverageTest { + + private static final long[] data; + + static { + data = new long[200000]; + // some random number close to long max + for (int i = 0; i < 100000; i++) { + data[i] = Long.MAX_VALUE / (long) Math.sqrt(i + 1); + } + for (int i = 100000; i > 0; i--) { + data[200000 - i] = Long.MAX_VALUE / (long) Math.sqrt(i + 1); + } + } + + @Test + void avg() { + BigInteger expectedSum = BigInteger.ZERO; + LongRunningAverage average = new LongRunningAverage(data.length); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + expectedSum = expectedSum.add(BigInteger.valueOf(val)); + average.update(val); + int ii = i + 1; + assertEquals( + expectedSum.divide(BigInteger.valueOf(i + 1)) + .doubleValue(), + average.avg(), + val / 1e8d, + () -> "Iteration #" + ii); + } + average = new LongRunningAverage(10); + LongList l = new LongArrayList(); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + average.update(val); + l.add(val); + if (l.size() > 10) { + l.removeElements(0, 1); + } + BigInteger avg = l.longStream() + .mapToObj(BigInteger::valueOf) + .reduce(BigInteger::add) + .get() + .divide(BigInteger.valueOf(Math.min(i + 1, 10))); + int ii = i + 1; + assertEquals(avg.doubleValue(), average.avg(), val / 1e8d, () -> "Iteration #" + ii); + } + } + + @Test + void avgLong() { + BigInteger expectedSum = BigInteger.ZERO; + LongRunningAverage average = new LongRunningAverage(data.length); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + expectedSum = expectedSum.add(BigInteger.valueOf(val)); + average.update(val); + int ii = i + 1; + assertEquals( + expectedSum.divide(BigInteger.valueOf(i + 1)) + .longValueExact(), + average.avgLong(), + () -> "Iteration #" + ii); + } + average = new LongRunningAverage(10); + LongList l = new LongArrayList(); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + average.update(val); + l.add(val); + if (l.size() > 10) { + l.removeElements(0, 1); + } + BigInteger avg = l.longStream() + .mapToObj(BigInteger::valueOf) + .reduce(BigInteger::add) + .get() + .divide(BigInteger.valueOf(Math.min(i + 1, 10))); + int ii = i + 1; + assertEquals(avg.longValueExact(), average.avgLong(), () -> "Iteration #" + ii); + } + } + + @Test + void size() { + LongRunningAverage average = new LongRunningAverage(data.length); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + average.update(val); + int ii = i + 1; + assertEquals(i + 1, average.size(), () -> "Iteration #" + ii); + } + average = new LongRunningAverage(10); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + average.update(val); + int ii = i + 1; + assertEquals(Math.min(10, i + 1), average.size(), () -> "Iteration #" + ii); + } + } + + @Test + void sum() { + BigInteger expected = BigInteger.ZERO; + LongRunningAverage average = new LongRunningAverage(data.length); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + expected = expected.add(BigInteger.valueOf(val)); + average.update(val); + BigInteger our = average.sum(); + int ii = i + 1; + assertEquals(expected, our, () -> "Iteration #" + ii); + } + average = new LongRunningAverage(10); + LongList l = new LongArrayList(); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + average.update(val); + l.add(val); + if (l.size() > 10) { + l.removeElements(0, 1); + } + int ii = i + 1; + assertEquals( + l.longStream() + .mapToObj(BigInteger::valueOf) + .reduce(BigInteger::add) + .get(), + average.sum(), + () -> "Iteration #" + ii); + } + } + + @Test + void view() { + LongRunningAverage average = new LongRunningAverage(data.length / 10); + LongData view = average.view(10); + LongList l = new LongArrayList(); + for (int i = 0; i < data.length; i++) { + long val = data[i]; + average.update(val); + l.add(val); + if (l.size() > 10) { + l.removeElements(0, 1); + } + int ii = i + 1; + assertEquals(l.size(), view.size(), () -> "Iteration #" + ii); + assertEquals( + l.longStream() + .mapToObj(BigInteger::valueOf) + .reduce(BigInteger::add) + .get(), + view.sum(), + () -> "Iteration #" + ii); + } + } +}