Skip to content

Commit

Permalink
GT++ multiblock glow texture support (#3704)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
serenibyss and Dream-Master authored Dec 26, 2024
1 parent 633c49d commit 569c3ee
Show file tree
Hide file tree
Showing 179 changed files with 950 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1119,27 +1119,56 @@ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, Ite
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
int aColorIndex, boolean aActive, boolean aRedstone) {
if (side == facing) {
if (aActive) return new ITexture[] { getCasingTexture(), TextureFactory.builder()
.addIcon(getActiveOverlay())
ITexture casingTexture = getCasingTexture();
if (side != facing) {
return new ITexture[] { casingTexture };
}

int textures = 1;
IIconContainer container = aActive ? getActiveOverlay() : getInactiveOverlay();
ITexture overlay = null;
if (container != null) {
textures++;
overlay = TextureFactory.builder()
.addIcon(container)
.extFacing()
.build() };
return new ITexture[] { getCasingTexture(), TextureFactory.builder()
.addIcon(getInactiveOverlay())
.build();
}

IIconContainer glowContainer = aActive ? getActiveGlowOverlay() : getInactiveGlowOverlay();
ITexture glowOverlay = null;
if (glowContainer != null) {
textures++;
glowOverlay = TextureFactory.builder()
.addIcon(glowContainer)
.extFacing()
.build() };
.glow()
.build();
}
return new ITexture[] { getCasingTexture() };

ITexture[] retVal = new ITexture[textures];
retVal[0] = getCasingTexture();
if (overlay != null) retVal[1] = overlay;
if (glowOverlay != null) retVal[2] = glowOverlay;
return retVal;
}

protected IIconContainer getActiveOverlay() {
return null;
}

protected IIconContainer getActiveGlowOverlay() {
return null;
}

protected IIconContainer getInactiveOverlay() {
return null;
}

protected IIconContainer getInactiveGlowOverlay() {
return null;
}

protected ITexture getCasingTexture() {
return Textures.BlockIcons.getCasingTextureForId(getCasingTextureId());
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCAAmazonPackagerActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCAAmazonPackagerActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCAAmazonPackager;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCAAmazonPackagerGlow;
}

@Override
protected int getCasingTextureId() {
return TAE.getIndexFromPage(2, 9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,21 @@ protected IIconContainer getActiveOverlay() {
return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW;
}

@Override
protected IIconContainer getInactiveOverlay() {
return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_GLOW;
}

@Override
protected int getCasingTextureId() {
return CASING_TEXTURE_ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCDIndustrialArcFurnaceActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialArcFurnaceActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCDIndustrialArcFurnace;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialArcFurnaceGlow;
}

@Override
protected int getCasingTextureId() {
return mCasingTextureID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;

public class MTEIndustrialCentrifuge extends GTPPMultiBlockBase<MTEIndustrialCentrifuge>
implements ISurvivalConstructable {

private boolean mIsAnimated;
private static final CustomIcon frontFaceActive = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
private static final CustomIcon frontFace = new CustomIcon("iconsets/LARGECENTRIFUGE5");
private int mCasing;
private static IStructureDefinition<MTEIndustrialCentrifuge> STRUCTURE_DEFINITION = null;
// public static double recipesComplete = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCAIndustrialChiselActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialChiselActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCAIndustrialChisel;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialChiselGlow;
}

@Override
protected int getCasingTextureId() {
return 90;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCACokeOvenActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCACokeOvenActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCACokeOven;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCACokeOvenGlow;
}

@Override
protected int getCasingTextureId() {
return TAE.GTPP_INDEX(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCDIndustrialCuttingMachineActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialCuttingMachineActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCDIndustrialCuttingMachine;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialCuttingMachineGlow;
}

@Override
protected int getCasingTextureId() {
return TAE.GTPP_INDEX(29);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCAIndustrialDehydratorActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialDehydratorActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCAIndustrialDehydrator;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialDehydratorGlow;
}

@Override
protected int getCasingTextureId() {
return CASING_TEXTURE_ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCDIndustrialExtruderActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialExtruderActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCDIndustrialExtruder;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialExtruderGlow;
}

@Override
protected int getCasingTextureId() {
return TAE.GTPP_INDEX(33);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCAFluidHeaterActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCAFluidHeaterActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCAFluidHeater;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCAFluidHeaterGlow;
}

@Override
protected int getCasingTextureId() {
return TAE.getIndexFromPage(0, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCAIndustrialForgeHammerActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialForgeHammerActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCAIndustrialForgeHammer;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialForgeHammerGlow;
}

@Override
protected int getCasingTextureId() {
return TAE.getIndexFromPage(1, 11);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.Overlay_MatterFab_Active;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.Overlay_MatterFab_Active_Glow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.Overlay_MatterFab;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.Overlay_MatterFab_Glow;
}

@Override
protected int getCasingTextureId() {
if (structureTier == 2) return TAE.GTPP_INDEX(7);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCDIndustrialMixerActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialMixerActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCDIndustrialMixer;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialMixerGlow;
}

@Override
protected int getCasingTextureId() {
return CASING_TEXTURE_ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCAIndustrialMolecularTransformerActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialMolecularTransformerActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCAIndustrialMolecularTransformer;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCAIndustrialMolecularTransformerGlow;
}

@Override
protected int getCasingTextureId() {
return 44;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,21 @@ protected IIconContainer getActiveOverlay() {
return TexturesGtBlock.oMCDIndustrialPlatePressActive;
}

@Override
protected IIconContainer getActiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialPlatePressActiveGlow;
}

@Override
protected IIconContainer getInactiveOverlay() {
return TexturesGtBlock.oMCDIndustrialPlatePress;
}

@Override
protected IIconContainer getInactiveGlowOverlay() {
return TexturesGtBlock.oMCDIndustrialPlatePressGlow;
}

@Override
protected int getCasingTextureId() {
return 50;
Expand Down
Loading

0 comments on commit 569c3ee

Please sign in to comment.