From 072f6322fb789703f163030edf4b60bf5a0201af Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 27 Aug 2016 01:34:08 +1000 Subject: + Attempted to add custom IC2 generators. % Refactored the xmod package to be a parent, beside core. No longer is it a child, it needs room to grow. --- .../xmod/gregtech/api/objects/GregtechFluid.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/Java/miscutil/xmod/gregtech/api/objects/GregtechFluid.java (limited to 'src/Java/miscutil/xmod/gregtech/api/objects/GregtechFluid.java') diff --git a/src/Java/miscutil/xmod/gregtech/api/objects/GregtechFluid.java b/src/Java/miscutil/xmod/gregtech/api/objects/GregtechFluid.java new file mode 100644 index 0000000000..2a9ce9965a --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/api/objects/GregtechFluid.java @@ -0,0 +1,27 @@ +package miscutil.xmod.gregtech.api.objects; + +import gregtech.api.GregTech_API; +import miscutil.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(String aName, String aTextureName, short[] aRGBa) { + super(aName); + mRGBa = aRGBa; + mTextureName = aTextureName; + GregTech_API.sGTBlockIconload.add(this); + } + + @Override + public int getColor() { + return (Math.max(0, Math.min(255, mRGBa[0])) << 16) | (Math.max(0, Math.min(255, mRGBa[1])) << 8) | Math.max(0, Math.min(255, mRGBa[2])); + } + + @Override + public void run() { + setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + mTextureName)); + } +} \ No newline at end of file -- cgit