aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java38
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.pngbin0 -> 949 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.png.mcmeta5
4 files changed, 43 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index 618fc83c55..7aa982411f 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -583,6 +583,7 @@ public class Textures {
OVERLAY_FUSION3_GLOW,
OVERLAY_SCREEN,
OVERLAY_SCREEN_GLOW,
+ OVERLAY_RAINBOWSCREEN_GLOW,
OVERLAY_QTANK,
OVERLAY_QTANK_GLOW,
OVERLAY_QCHEST,
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java
index b3ee08f179..aac668eaa4 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java
@@ -13,6 +13,7 @@ import static gregtech.api.enums.GT_Values.VN;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DTPF_OFF;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DTPF_ON;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_RAINBOWSCREEN_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
@@ -66,10 +67,12 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.MaterialsUEVplus;
import gregtech.api.enums.SoundResource;
import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.interfaces.IIconContainer;
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.GregTechTileClientEvents;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
@@ -93,6 +96,8 @@ public class GT_MetaTileEntity_PlasmaForge extends
// Multiplier for the efficiency decay rate
private static final double efficiency_decay_rate = 100;
private static final double maximum_discount = 0.5d;
+ private static final int CONVERGENCE_BITMAP = 0b1;
+ private static final int DISCOUNT_BITMAP = 0b10;
// Valid fuels which the discount will get applied to.
private static final FluidStack[] valid_fuels = { MaterialsUEVplus.ExcitedDTCC.getFluid(1L),
@@ -696,13 +701,17 @@ public class GT_MetaTileEntity_PlasmaForge extends
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection aFacing,
int colorIndex, boolean aActive, boolean redstoneLevel) {
+ IIconContainer glow = OVERLAY_FUSION1_GLOW;
+ if (convergence && discount == maximum_discount) {
+ glow = OVERLAY_RAINBOWSCREEN_GLOW;
+ }
if (side == aFacing) {
if (aActive) return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING], TextureFactory.builder()
.addIcon(OVERLAY_DTPF_ON)
.extFacing()
.build(),
TextureFactory.builder()
- .addIcon(OVERLAY_FUSION1_GLOW)
+ .addIcon(glow)
.extFacing()
.glow()
.build() };
@@ -795,6 +804,8 @@ public class GT_MetaTileEntity_PlasmaForge extends
&& overclockCalculator != null
&& overclockCalculator.getCalculationStatus()) {
calculateCatalystIncrease(tRecipe, i, false);
+ getBaseMetaTileEntity()
+ .sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData());
}
tRecipe.mFluidInputs[i].amount = (int) Math.round(tRecipe.mFluidInputs[i].amount * discount);
adjusted = true;
@@ -809,6 +820,7 @@ public class GT_MetaTileEntity_PlasmaForge extends
&& overclockCalculator.getCalculationStatus()) {
recalculateDiscount();
calculateCatalystIncrease(tRecipe, 0, true);
+ getBaseMetaTileEntity().sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData());
}
return tRecipe;
}
@@ -1083,6 +1095,8 @@ public class GT_MetaTileEntity_PlasmaForge extends
if (convergence && (controllerStack == null
|| !controllerStack.isItemEqual(ItemList.Transdimensional_Alignment_Matrix.get(1)))) {
convergence = false;
+ getBaseMetaTileEntity()
+ .sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData());
}
}
}
@@ -1106,6 +1120,28 @@ public class GT_MetaTileEntity_PlasmaForge extends
return SoundResource.GT_MACHINES_PLASMAFORGE_LOOP.resourceLocation;
}
+ @Override
+ public byte getUpdateData() {
+ byte data = 0;
+ if (discount == maximum_discount) {
+ data += DISCOUNT_BITMAP;
+ }
+ if (convergence) {
+ data += CONVERGENCE_BITMAP;
+ }
+ return data;
+ }
+
+ @Override
+ public void receiveClientEvent(byte aEventID, byte aValue) {
+ if (aEventID == GregTechTileClientEvents.CHANGE_CUSTOM_DATA) {
+ convergence = (aValue & CONVERGENCE_BITMAP) == CONVERGENCE_BITMAP;
+ if ((aValue & DISCOUNT_BITMAP) == DISCOUNT_BITMAP) {
+ discount = maximum_discount;
+ }
+ }
+ }
+
private static final int CATALYST_WINDOW_ID = 10;
@Override
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.png
new file mode 100644
index 0000000000..4209925520
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.png.mcmeta
new file mode 100644
index 0000000000..5e86a7cd5f
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_RAINBOWSCREEN_GLOW.png.mcmeta
@@ -0,0 +1,5 @@
+{
+ "animation":{
+ "frametime":8
+ }
+} \ No newline at end of file