Skip to content

Commit

Permalink
glasses for structure (#1986)
Browse files Browse the repository at this point in the history
* glasses for structure
* new Api for glasses
* changed glass requirements

* fix api desc

* sa
  • Loading branch information
Quetz4l authored May 14, 2023
1 parent b36546c commit 4fc648a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 67 deletions.
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies {
compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.4.16:dev") { transitive = false }
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.2.8:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Botania:1.9.22-GTNH: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")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package gregtech.api.multitileentity.multiblock.casing;

import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockUnlocalizedName;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
import static gregtech.api.enums.Mods.*;

import com.gtnewhorizon.structurelib.structure.IStructureElementChain;

public class Glasses {

/** support all Bart, Botania, Ic2, Thaumcraft glasses for multiblock structure **/
public static <T> IStructureElementChain<T> chainAllGlasses() {
return ofChain(
// IndustrialCraft2 glass
ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true),

// Botania glass
ofBlockUnlocalizedName(Botania.ID, "manaGlass", 0, false),
ofBlockUnlocalizedName(Botania.ID, "elfGlass", 0, false),
ofBlockUnlocalizedName(Botania.ID, "hourglass", 0, false),

// BartWorks glass
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true),

// warded glass
ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.GT_Mod.GT_FML_LOGGER;
import static gregtech.api.enums.GT_HatchElement.*;
import static gregtech.api.enums.Mods.BartWorks;
import static gregtech.api.enums.Mods.IndustrialCraft2;
import static gregtech.api.enums.Mods.Thaumcraft;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW;
Expand Down Expand Up @@ -41,6 +38,7 @@
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_MultiInput;
import gregtech.api.multitileentity.multiblock.casing.Glasses;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.*;
import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine;
Expand All @@ -65,24 +63,10 @@ public class GT_MetaTileEntity_AssemblyLine
.addShape(
STRUCTURE_PIECE_LAST,
transpose(new String[][] { { " ", "e", " " }, { "d", "l", "d" }, { "g", "m", "g" }, { "o", "i", "b" }, }))
.addElement('G', ofBlock(GregTech_API.sBlockCasings3, 10)) // grate
// machine
// casing
.addElement('l', ofBlock(GregTech_API.sBlockCasings2, 9)) // assembler
// machine
// casing
.addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling
// line
// casing
.addElement(
'g',
ofChain(
ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true),
// warded
// glass
ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false)))
.addElement('G', ofBlock(GregTech_API.sBlockCasings3, 10)) // grate machine casing
.addElement('l', ofBlock(GregTech_API.sBlockCasings2, 9)) // assembler machine casing
.addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casing
.addElement('g', Glasses.chainAllGlasses())
.addElement(
'e',
ofChain(
Expand All @@ -108,20 +92,7 @@ public class GT_MetaTileEntity_AssemblyLine
.addElement(
'I',
ofChain(
// all
// blocks
// nearby
// use
// solid
// steel
// casing,
// so
// let's
// use
// the
// texture
// of
// that
// all blocks nearby use solid steel casing, so let's use the texture of that
InputBus.newAny(16, 5, ForgeDirection.DOWN),
ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4)))
.addElement('i', InputBus.newAny(16, 5, ForgeDirection.DOWN))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.enums.GT_HatchElement.*;
import static gregtech.api.enums.Mods.BartWorks;
import static gregtech.api.enums.Mods.IndustrialCraft2;
import static gregtech.api.enums.Mods.Thaumcraft;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofFrame;
Expand Down Expand Up @@ -41,6 +38,7 @@
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.multitileentity.multiblock.casing.Glasses;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
Expand Down Expand Up @@ -76,15 +74,7 @@ public class GT_MetaTileEntity_IntegratedOreFactory extends
{ "EEEEEE ", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEE " } }))
.addElement('i', ofBlock(GregTech_API.sBlockCasings8, 7))
.addElement('s', ofBlock(GregTech_API.sBlockCasings4, 1))
.addElement(
'g',
ofChain(
ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true),
// warded
// glass
ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false)))
.addElement('g', Glasses.chainAllGlasses())
.addElement('x', ofBlock(GregTech_API.sBlockCasings2, 3))
.addElement('p', ofBlock(GregTech_API.sBlockCasings2, 15))
.addElement('t', ofFrame(Materials.TungstenSteel))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.enums.GT_HatchElement.*;
import static gregtech.api.enums.GT_Values.*;
import static gregtech.api.enums.Mods.BartWorks;
import static gregtech.api.enums.Mods.IndustrialCraft2;
import static gregtech.api.enums.Mods.Thaumcraft;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW;
Expand Down Expand Up @@ -64,6 +61,7 @@
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.multitileentity.multiblock.casing.Glasses;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
Expand Down Expand Up @@ -207,15 +205,7 @@ public class GT_MetaTileEntity_PCBFactory extends
.addElement('E', ofFrame(Materials.DamascusSteel))
.addElement('C', ofBlock(GregTech_API.sBlockCasings8, 11))
.addElement('D', ofBlock(GregTech_API.sBlockReinforced, 2))
.addElement(
'A',
ofChain(
ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true),
// warded
// glass
ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false)))
.addElement('A', Glasses.chainAllGlasses())
.addElement('B', ofBlock(GregTech_API.sBlockCasings3, 10))
.addElement('F', ofFrame(Materials.VibrantAlloy))
.addElement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static com.google.common.primitives.Ints.saturatedCast;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.enums.Mods.*;
import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.*;

import java.util.ArrayList;
Expand Down Expand Up @@ -40,6 +39,7 @@
import gregtech.api.logic.ComplexParallelProcessingLogic;
import gregtech.api.multitileentity.enums.GT_MultiTileCasing;
import gregtech.api.multitileentity.multiblock.base.ComplexParallelController;
import gregtech.api.multitileentity.multiblock.casing.Glasses;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_StructureUtility;
Expand Down Expand Up @@ -218,13 +218,7 @@ public IStructureDefinition<AdvChemicalReactor> getStructureDefinition() {
.addElement(
'W',
GT_StructureUtility.ofCoil(AdvChemicalReactor::setCoilTier, AdvChemicalReactor::getCoilTier))
.addElement(
'G',
ofChain(
ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true),
ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true),
ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false)))
.addElement('G', Glasses.chainAllGlasses())
.build();
}
return STRUCTURE_DEFINITION;
Expand Down

0 comments on commit 4fc648a

Please sign in to comment.