aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-12-15 16:11:54 +0100
committerGitHub <noreply@github.com>2021-12-15 16:11:54 +0100
commit128c74faa99dfef8d056c1d82c6e4388b9d470e8 (patch)
tree2c84162154ba681232f86dffd4106db530236814 /src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
parent47ce336f288a45aa3244c8ae1177499fa5080942 (diff)
parentff4b8c7068c2ea7d654e9beda00646d23e62b314 (diff)
downloadGT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.gz
GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.bz2
GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.zip
Merge pull request #65 from GTNewHorizons/unified-build-script2
Move sources and resources
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
new file mode 100644
index 0000000000..9cc0e3a315
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.xmod.gregtech.api.objects;
+
+import gregtech.api.GregTech_API;
+
+import gtPlusPlus.core.lib.CORE;
+import net.minecraftforge.fluids.Fluid;
+
+public class GregtechFluid extends Fluid implements Runnable {
+ public final String mTextureName;
+ private final short[] mRGBa;
+
+ public GregtechFluid(final String aName, final String aTextureName, final short[] aRGBa) {
+ super(aName);
+ this.mRGBa = aRGBa;
+ this.mTextureName = aTextureName;
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public int getColor() {
+ return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16) | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8) | Math.max(0, Math.min(255, this.mRGBa[2]));
+ }
+
+ @Override
+ public void run() {
+ this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + this.mTextureName));
+ }
+} \ No newline at end of file