aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkekzdealer <kekzdealer@gmail.com>2020-05-19 00:05:52 +0200
committerkekzdealer <kekzdealer@gmail.com>2020-05-19 00:05:52 +0200
commit1efc48cde1f27dabd6be1ca4220b8f81fa4b366e (patch)
tree334679512afbf09e48b05ecfa8f6c70bde400b07
parent45a4e15cf03ae580a8bf05febed2b471dd960e10 (diff)
downloadGT5-Unofficial-1efc48cde1f27dabd6be1ca4220b8f81fa4b366e.tar.gz
GT5-Unofficial-1efc48cde1f27dabd6be1ca4220b8f81fa4b366e.tar.bz2
GT5-Unofficial-1efc48cde1f27dabd6be1ca4220b8f81fa4b366e.zip
capacitors pulse red on maintenance
-rw-r--r--src/main/java/client/renderer/TESR_SECapacitor.java11
-rw-r--r--src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java2
-rw-r--r--src/main/resources/assets/kekztech/textures/blocks/SpaceElevatorCapacitor_side_renderbase.pngbin0 -> 171 bytes
3 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/client/renderer/TESR_SECapacitor.java b/src/main/java/client/renderer/TESR_SECapacitor.java
index 4a14ffa28b..16c820917d 100644
--- a/src/main/java/client/renderer/TESR_SECapacitor.java
+++ b/src/main/java/client/renderer/TESR_SECapacitor.java
@@ -9,14 +9,12 @@ import net.minecraft.util.ResourceLocation;
public class TESR_SECapacitor extends TileEntitySpecialRenderer {
- private static final ResourceLocation capSide = new ResourceLocation(KekzCore.MODID, "textures/blocks/SpaceElevatorCapacitor_side_fullbase.png");
+ private static final ResourceLocation capSide = new ResourceLocation(KekzCore.MODID, "textures/blocks/SpaceElevatorCapacitor_side_renderbase.png");
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) {
final Tessellator tessellator = Tessellator.instance;
final TE_SpaceElevatorCapacitor teCap = (TE_SpaceElevatorCapacitor) te;
- // Scale saturation, rounding up
- final int sat = (int) Math.ceil(teCap.getChargeLevel() * 255);
// Setup vertices
final double fbr_x = x + 1;
final double fbr_z = z + 1;
@@ -41,9 +39,12 @@ public class TESR_SECapacitor extends TileEntitySpecialRenderer {
tessellator.startDrawingQuads();
// Render the caps as red if there are maintenance issues
if(teCap.isDamaged()) {
- tessellator.setColorRGBA(255, 0, 0, 255);
+ final float wave = (float) Math.abs(Math.sin((te.getWorldObj().getTotalWorldTime() + partialTick) / 20.0D));
+ final int redSat = 64 + (int) Math.ceil(191 * wave);
+ tessellator.setColorRGBA(redSat, 0, 0, 255);
} else {
- tessellator.setColorRGBA(sat, sat, sat, 255);
+ final int sat = (int) Math.ceil(teCap.getChargeLevel() * 255);
+ tessellator.setColorRGBA(0, 0, sat, 255);
}
tessellator.setBrightness(255);
// (DOWN and UP faces are not rendered as they will not ever be visible in the Space Elevator structure)
diff --git a/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java b/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java
index 758a7e576f..a8de775f98 100644
--- a/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java
+++ b/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java
@@ -5,7 +5,7 @@ import net.minecraft.tileentity.TileEntity;
public class TE_SpaceElevatorCapacitor extends TileEntity {
private float chargeLevel = 0.0F;
- private boolean isDamaged = false;
+ private boolean isDamaged = true;
/**
* Called by {@link GTMTE_SpaceElevator} while charging
diff --git a/src/main/resources/assets/kekztech/textures/blocks/SpaceElevatorCapacitor_side_renderbase.png b/src/main/resources/assets/kekztech/textures/blocks/SpaceElevatorCapacitor_side_renderbase.png
new file mode 100644
index 0000000000..32aee141d9
--- /dev/null
+++ b/src/main/resources/assets/kekztech/textures/blocks/SpaceElevatorCapacitor_side_renderbase.png
Binary files differ