diff options
| author | iouter <62897714+iouter@users.noreply.github.com> | 2022-01-07 12:36:06 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-07 12:36:06 +0800 |
| commit | 0834d4b8b45a881f36ed5b295ac0fb38df49fa9a (patch) | |
| tree | 6fb4a45cf17dd22748148417bc7bb0efb850cea3 /src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java | |
| parent | ea1439a4195c8f77c45625ea2593a232bf19984e (diff) | |
| parent | 9b2e050151ad93170e84321d067d1e9d4ded4ba5 (diff) | |
| download | GT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.tar.gz GT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.tar.bz2 GT5-Unofficial-0834d4b8b45a881f36ed5b295ac0fb38df49fa9a.zip | |
Merge branch 'GTNewHorizons:master' into master
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.java | 28 |
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 |
