2015-04-23 16:14:22 +00:00
|
|
|
package gregtech.api.objects;
|
|
|
|
|
|
|
|
import gregtech.api.GregTech_API;
|
|
|
|
import net.minecraftforge.fluids.Fluid;
|
|
|
|
|
2015-10-22 02:06:25 +00:00
|
|
|
import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
|
|
|
|
|
2015-04-23 16:14:22 +00:00
|
|
|
public class GT_Fluid extends Fluid implements Runnable {
|
2015-10-22 02:06:25 +00:00
|
|
|
public final String mTextureName;
|
|
|
|
private final short[] mRGBa;
|
|
|
|
|
|
|
|
public GT_Fluid(String aName, String aTextureName, short[] aRGBa) {
|
|
|
|
super(aName);
|
|
|
|
mRGBa = aRGBa;
|
|
|
|
mTextureName = aTextureName;
|
|
|
|
GregTech_API.sGTBlockIconload.add(this);
|
|
|
|
}
|
|
|
|
|
2015-04-23 16:14:22 +00:00
|
|
|
@Override
|
2015-10-22 02:06:25 +00:00
|
|
|
public int getColor() {
|
2015-04-23 16:14:22 +00:00
|
|
|
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]));
|
|
|
|
}
|
2015-10-22 02:06:25 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
setIcons(GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "fluids/fluid." + mTextureName));
|
|
|
|
}
|
2015-04-23 16:14:22 +00:00
|
|
|
}
|