public static TextureAtlasSprite getFluidTexture(Fluid fluid) { if (fluid == null) { fluid = FluidRegistry.LAVA; } return getTexture(fluid.getStill()); }
public static TextureAtlasSprite getTexture(ResourceLocation location) { return getTexture(location.toString()); }
public static TextureAtlasSprite getFluidTexture(FluidStack fluid) { if (fluid == null || fluid.getFluid().getStill(fluid) == null) { fluid = new FluidStack(FluidRegistry.LAVA, 1); } return getTexture(fluid.getFluid().getStill(fluid)); }
@Override public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { if (icon == null) { icon = RenderHelper.getTexture(iconName); } if (icon != null) { GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); GlStateManager.enableRescaleNormal(); GlStateManager.scale(0.5F, 0.5F, 0.5F); this.bindEntityTexture(entity); this.renderIcon(icon); GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); } }
public static void drawFluid(int x, int y, FluidStack fluid, int width, int height) { if (fluid == null) { return; } GL11.glPushMatrix(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.setBlockTextureSheet(); int color = fluid.getFluid().getColor(fluid); RenderHelper.setGLColorFromInt(color); drawTiledTexture(x, y, RenderHelper.getTexture(fluid.getFluid().getStill(fluid)), width, height); GL11.glPopMatrix(); }
/** * Simple method used to draw a fluid of arbitrary size. */ public void drawFluid(int x, int y, FluidStack fluid, int width, int height) { if (fluid == null) { return; } GL11.glPushMatrix(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.setBlockTextureSheet(); int color = fluid.getFluid().getColor(fluid); RenderHelper.setGLColorFromInt(color); drawTiledTexture(x, y, RenderHelper.getTexture(fluid.getFluid().getStill(fluid)), width, height); GL11.glPopMatrix(); }