From 22a702d8b7ef2a5f5ae1a38c4056ed6ab2643b14 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:14:45 -0400 Subject: [PATCH] Add Brewery Multi (#3257) Co-authored-by: Martin Robertz --- .../java/gregtech/api/enums/ItemList.java | 4 + .../gregtech/api/enums/MetaTileEntityIDs.java | 1 + .../java/gregtech/api/enums/Textures.java | 8 + .../common/blocks/BlockCasings10.java | 5 +- .../machines/multi/MTEIndustrialBrewery.java | 248 ++++++++++++++++++ .../preload/LoaderMetaTileEntities.java | 5 + .../iconsets/CASING_REINFORCED_WOOD.png | Bin 0 -> 480 bytes .../iconsets/CASING_REINFORCED_WOOD_TOP.png | Bin 0 -> 395 bytes .../iconsets/OVERLAY_FRONT_MULTI_BREWERY.png | Bin 0 -> 254 bytes .../OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png | Bin 0 -> 255 bytes ...VERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png | Bin 0 -> 255 bytes .../OVERLAY_FRONT_MULTI_BREWERY_GLOW.png | Bin 0 -> 256 bytes 12 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialBrewery.java create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/CASING_REINFORCED_WOOD.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/CASING_REINFORCED_WOOD_TOP.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MULTI_BREWERY_GLOW.png diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index 8bd9027a236..52e3484156d 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -1489,6 +1489,8 @@ public enum ItemList implements IItemContainer { Casing_Fluid_Solidifier, Radiator_Fluid_Solidifier, + Casing_Reinforced_Wood, + Machine_Multi_IndustrialCompressor, Machine_Multi_HIPCompressor, Machine_Multi_NeutroniumCompressor, @@ -1506,6 +1508,8 @@ public enum ItemList implements IItemContainer { Black_Hole_Opener, Black_Hole_Closer, + Machine_Multi_IndustrialBrewery, + Machine_Multi_IndustrialLaserEngraver, Laser_Plate, Casing_Laser, diff --git a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java index f815f60cad8..c3cbbb02cf3 100644 --- a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java +++ b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java @@ -765,6 +765,7 @@ public enum MetaTileEntityIDs { BLACKHOLE_COMPRESSOR_CONTROLLER(3008), HEAT_DETECTOR_HATCH(3009), INDUSTRIAL_EXTRACTOR_CONTROLLER(3010), + INDUSTRIAL_BREWERY_CONTROLLER(3011), DraconicEvolutionFusionCrafterController(5001), CHEST_BUFFER_ULV(9230), CHEST_BUFFER_LV(9231), diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 39dc57af413..5e21d6e9e98 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -336,6 +336,9 @@ public enum BlockIcons implements IIconContainer, Runnable { MACHINE_CASING_MS160, RADIATOR_MS160, + CASING_REINFORCED_WOOD, + CASING_REINFORCED_WOOD_TOP, + OVERLAY_FRONT_MULTI_CANNER, OVERLAY_FRONT_MULTI_CANNER_ACTIVE, OVERLAY_FRONT_MULTI_CANNER_ACTIVE_GLOW, @@ -368,6 +371,11 @@ public enum BlockIcons implements IIconContainer, Runnable { OVERLAY_FRONT_INDUSTRIAL_EXTRACTOR_ACTIVE_GLOW, OVERLAY_FRONT_INDUSTRIAL_EXTRACTOR_GLOW, + OVERLAY_FRONT_MULTI_BREWERY, + OVERLAY_FRONT_MULTI_BREWERY_ACTIVE, + OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW, + OVERLAY_FRONT_MULTI_BREWERY_GLOW, + LASER_PLATE, MACHINE_CASING_LASER, OVERLAY_FRONT_ENGRAVER, diff --git a/src/main/java/gregtech/common/blocks/BlockCasings10.java b/src/main/java/gregtech/common/blocks/BlockCasings10.java index e5c2e96f32c..ada1c589270 100644 --- a/src/main/java/gregtech/common/blocks/BlockCasings10.java +++ b/src/main/java/gregtech/common/blocks/BlockCasings10.java @@ -32,9 +32,9 @@ public BlockCasings10() { .addStringLocalization(getUnlocalizedName() + ".11.name", "Extreme Density Space-Bending Casing"); GTLanguageManager .addStringLocalization(getUnlocalizedName() + ".12.name", "Background Radiation Absorbent Casing"); - GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Solidifier Casing"); GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Solidifier Radiator"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Reinforced Wooden Casing"); ItemList.Casing_Electromagnetic_Separator.set(new ItemStack(this, 1, 0)); ItemList.Casing_Laser.set(new ItemStack(this, 1, 1)); @@ -51,6 +51,7 @@ public BlockCasings10() { ItemList.Background_Radiation_Casing.set(new ItemStack(this, 1, 12)); ItemList.Casing_Fluid_Solidifier.set(new ItemStack(this, 1, 13)); ItemList.Radiator_Fluid_Solidifier.set(new ItemStack(this, 1, 14)); + ItemList.Casing_Reinforced_Wood.set(new ItemStack(this, 1, 15)); } @Override @@ -77,6 +78,8 @@ public IIcon getIcon(int ordinalSide, int aMeta) { case 12 -> Textures.BlockIcons.RADIATION_ABSORBENT_CASING.getIcon(); case 13 -> Textures.BlockIcons.MACHINE_CASING_MS160.getIcon(); case 14 -> Textures.BlockIcons.RADIATOR_MS160.getIcon(); + case 15 -> ordinalSide > 1 ? Textures.BlockIcons.CASING_REINFORCED_WOOD.getIcon() + : Textures.BlockIcons.CASING_REINFORCED_WOOD_TOP.getIcon(); default -> Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialBrewery.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialBrewery.java new file mode 100644 index 00000000000..b0f4b98d464 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialBrewery.java @@ -0,0 +1,248 @@ +package gregtech.common.tileentities.machines.multi; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static gregtech.api.enums.GTValues.AuthorFourIsTheNumber; +import static gregtech.api.enums.HatchElement.Energy; +import static gregtech.api.enums.HatchElement.InputBus; +import static gregtech.api.enums.HatchElement.InputHatch; +import static gregtech.api.enums.HatchElement.Maintenance; +import static gregtech.api.enums.HatchElement.OutputBus; +import static gregtech.api.enums.HatchElement.OutputHatch; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_BREWERY; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_BREWERY_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_BREWERY_GLOW; +import static gregtech.api.util.GTStructureUtility.buildHatchAdder; +import static gregtech.api.util.GTStructureUtility.ofFrame; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +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.GregTechAPI; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; +import gregtech.api.metatileentity.implementations.MTEExtendedPowerMultiBlockBase; +import gregtech.api.multitileentity.multiblock.casing.Glasses; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GTUtility; +import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.blocks.BlockCasings10; + +public class MTEIndustrialBrewery extends MTEExtendedPowerMultiBlockBase + implements ISurvivalConstructable { + + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + // spotless:off + new String[][]{{ + "BBB", + "BBB", + "B~B", + "BBB", + "C C" + },{ + "BBB", + "A A", + "A A", + "BBB", + " " + },{ + "BBB", + "BAB", + "BAB", + "BBB", + "C C" + }}) + //spotless:on + .addElement( + 'B', + buildHatchAdder(MTEIndustrialBrewery.class) + .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy) + .casingIndex(((BlockCasings10) GregTechAPI.sBlockCasings10).getTextureIndex(15)) + .dot(1) + .buildAndChain( + onElementPass(MTEIndustrialBrewery::onCasingAdded, ofBlock(GregTechAPI.sBlockCasings10, 15)))) + .addElement('A', Glasses.chainAllGlasses()) + .addElement('C', ofFrame(Materials.Steel)) + .build(); + + public MTEIndustrialBrewery(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public MTEIndustrialBrewery(String aName) { + super(aName); + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new MTEIndustrialBrewery(this.mName); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirection side, ForgeDirection aFacing, + int colorIndex, boolean aActive, boolean redstoneLevel) { + ITexture[] rTexture; + if (side == aFacing) { + if (aActive) { + rTexture = new ITexture[] { + Textures.BlockIcons + .getCasingTextureForId(GTUtility.getCasingTextureIndex(GregTechAPI.sBlockCasings10, 15)), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_BREWERY_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_BREWERY_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + } else { + rTexture = new ITexture[] { + Textures.BlockIcons + .getCasingTextureForId(GTUtility.getCasingTextureIndex(GregTechAPI.sBlockCasings10, 15)), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_BREWERY) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_BREWERY_GLOW) + .extFacing() + .glow() + .build() }; + } + } else { + rTexture = new ITexture[] { Textures.BlockIcons + .getCasingTextureForId(GTUtility.getCasingTextureIndex(GregTechAPI.sBlockCasings10, 15)) }; + } + return rTexture; + } + + @Override + protected MultiblockTooltipBuilder createTooltip() { + MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); + tt.addMachineType("Brewery") + .addInfo("Controller Block for the Big Barrel Brewery") + .addInfo("50% faster than singleblock machines of the same voltage") + .addInfo("Gains 4 parallels per voltage tier") + .addInfo(AuthorFourIsTheNumber) + .addSeparator() + .beginStructureBlock(3, 5, 3, true) + .addController("Front Center") + .addCasingInfoMin("Reinforced Wooden Casing", 14, false) + .addCasingInfoExactly("Any Glass", 6, false) + .addCasingInfoExactly("Steel Frame Box", 4, false) + .addInputBus("Any Wooden Casing", 1) + .addOutputBus("Any Wooden Casing", 1) + .addInputHatch("Any Wooden Casing", 1) + .addOutputHatch("Any Wooden Casing", 1) + .addEnergyHatch("Any Wooden Casing", 1) + .addMaintenanceHatch("Any Wooden Casing", 1) + .toolTipFinisher("GregTech"); + return tt; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 1, 2, 0); + } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { + if (mMachine) return -1; + return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 2, 0, elementBudget, env, false, true); + } + + private int mCasingAmount; + + private void onCasingAdded() { + mCasingAmount++; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasingAmount = 0; + return checkPiece(STRUCTURE_PIECE_MAIN, 1, 2, 0) && mCasingAmount >= 14; + } + + @Override + protected void setProcessingLogicPower(ProcessingLogic logic) { + logic.setAvailableVoltage(GTUtility.roundUpVoltage(this.getMaxInputVoltage())); + logic.setAvailableAmperage(1L); + } + + @Override + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic().setSpeedBonus(1F / 1.5F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); + } + + public int getMaxParallelRecipes() { + return (4 * GTUtility.getTier(this.getMaxInputVoltage())); + } + + @Override + public RecipeMap getRecipeMap() { + return RecipeMaps.brewingRecipes; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public boolean supportsVoidProtection() { + return true; + } + + @Override + public boolean supportsBatchMode() { + return true; + } + + @Override + public boolean supportsInputSeparation() { + return true; + } + + @Override + public boolean supportsSingleRecipeLocking() { + return true; + } +} diff --git a/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java b/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java index 6f31a451351..37afba759b7 100644 --- a/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/LoaderMetaTileEntities.java @@ -1039,6 +1039,7 @@ import gregtech.common.tileentities.machines.multi.MTEFusionComputer3; import gregtech.common.tileentities.machines.multi.MTEHeatExchanger; import gregtech.common.tileentities.machines.multi.MTEImplosionCompressor; +import gregtech.common.tileentities.machines.multi.MTEIndustrialBrewery; import gregtech.common.tileentities.machines.multi.MTEIndustrialElectromagneticSeparator; import gregtech.common.tileentities.machines.multi.MTEIndustrialExtractor; import gregtech.common.tileentities.machines.multi.MTEIndustrialLaserEngraver; @@ -1622,6 +1623,10 @@ private static void registerMultiblockControllers() { "multimachine.blackholecompressor", "Pseudostable Black Hole Containment Field").getStackForm(1)); + ItemList.Machine_Multi_IndustrialBrewery.set( + new MTEIndustrialBrewery(INDUSTRIAL_BREWERY_CONTROLLER.ID, "multimachine.brewery", "Big Barrel Brewery") + .getStackForm(1)); + ItemList.Machine_Multi_Autoclave.set( new MTEMultiAutoclave(MULTI_AUTOCLAVE_CONTROLLER.ID, "multimachine.autoclave", "Industrial Autoclave") .getStackForm(1)); diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/CASING_REINFORCED_WOOD.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/CASING_REINFORCED_WOOD.png new file mode 100644 index 0000000000000000000000000000000000000000..7687cf92a6ef2e0ea38ef68878f5bdfa1f1c5db3 GIT binary patch literal 480 zcmV<60U!Q}P)Px$nn^@KR5*=wl0j?RFc^j(%Wkr0bzp2u-G-(Nb}0mU8uYqTFZ+@E4cnh6^i&A+ zI$W|Q9b2%S+Ssw;9$d+i%f6HKeXrj4kt}ci`K)<2J_KNsZULB{9utm3`jw>_%liia z^qydPdJI4~4*7ODH{$d81pr4!C#=`M0k~V-0&sJ^AWJgd`^mq+91(6YCQ3uO)es;qMdxO6{3NlQvbpMX5cZl*V*< z|3IE(G(|<8WQbPS3bH)!kfkJEt<8Eg7#f|e5yOK6r=gANS{ZbJAn+ZtqAF>Cpxo`8 zWZxH#;U?WWbGuZn5WX)6rF?}~RHd`FkDzIas>H zK)m{60>z;m8Bx4?L_f>_-8{gjY19$egIP2&7pBYpt@c{e1-hXfeP0;7K84<7_n!d; WhOg=vV*(Wb0000Px$MM*?KR5*=|Qo(M6FbsVpv<$DAG;Kp@lc*-`xc~nkPOQ^bwP}N(1a_bf3G^_Z zu=DKqo=x=mu^k>CHUNPA@dN-U@(kJ-C?b^AZjl23_XulyC?Y5#6nTdKgpU&dppAhx zCIBg-MebwxJ-!7ltDTd`1inSCDWXXMhqb+vsOTPS(f6&5LAp+$jTr|pU@oz&zFeNJ zlbg0gvRW;CX=BiJHn0)LG8k634F&*lbGZb}Qi@>U{&-p}*xBtYgp|Ua(T}=qg50;j zYU;Luqw6~B!H1w0U8}cFy|}{2c84e$+pO*Jdpu9FZ69C-%bQF7IcWD?5g pv-&x!i@CrPr4&xyTm?7z^*_lYpDXKU-ar5V002ovPDHLkV1jc|vQz*7 literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..6092ec4c180d0e05ffac7183e90cdf5a5f4a9b54 GIT binary patch literal 254 zcmVa&ZnI&pC(I+7O!nE@r@G znm}tEJT9i#1Z+i%cm~}&@GGLAY@urhT$}?a&s7I}iW$H&pmV2tAw-DP@1XXUT;n*l z0rc>-u8_|DX;QBB8Mf_I0r@F>Q*#DAZ8V3t`)B%BZ=QSGx43|cvj6}907*qoM6N<$ Ef<6RhYybcN literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..ffd43d8dc23e8320eb3205fcf1629b1d0a134b1c GIT binary patch literal 255 zcmV#0LBIRInMId82EwhG|8 zoW>Ef)*(j8Xsdu!_!9M?`2?4~-voIHO(&pa4nUu)4EQ7yfO>#)$9o|}u*L77vCM002ovPDHLk FV1i&^Y6SoQ literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..3bb29bbda660983e1c67cc3af70b987d72a8b374 GIT binary patch literal 255 zcmVz&J8-ZEgYLhjj4e93~-<1Gon?ce*#m3|9RPv|XgE zwRr$Nyms9@`%9R7@An_aQ2}xa-<0janqy>}xcO)LS5LpFhTV3o5L*BM002ovPDHLk FV1m86V?qD` literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..b7955d63ab896c55563aac4ce30b822a23db287c GIT binary patch literal 256 zcmV+b0ssDqP)RMNv3=BGwKkZifjkXLB5w<8g#+aY9 z0yyWQ+O}ogh5^ofpN(Y!hs&M?SAbp9fGmnl3t1kJVk-bqB{>C9EQEmGdn8)~NU{J< zT?f`$j!81vB48=nBt57;!L$Qe@TzlJLe&W*IR%iPDi4^G1t2}3xzn>!if#5D