From b2c498a2a3afd75838c2d8cf69f1cb00a55a9dfa Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 29 Jun 2016 15:06:52 +1000 Subject: +Added Two Frames for Forestry +First attempt at adding an Alveary block for Forestry As always, Used authors code to implement it the cleanest way possible. (Sorry if you don't like it, but feel free to offer PR's with better solutions) --- .../gregtech/api/objects/GregtechFluid.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/Java/miscutil/gregtech/api/objects/GregtechFluid.java (limited to 'src/Java/miscutil/gregtech/api') diff --git a/src/Java/miscutil/gregtech/api/objects/GregtechFluid.java b/src/Java/miscutil/gregtech/api/objects/GregtechFluid.java new file mode 100644 index 0000000000..6352883995 --- /dev/null +++ b/src/Java/miscutil/gregtech/api/objects/GregtechFluid.java @@ -0,0 +1,27 @@ +package miscutil.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