GuiContainerFluidHatch.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:ModularMachinery 作者:
@Optional.Method(modid = "mekanism")
private void drawMekGasContent() {
    if(tank.getTank() instanceof HybridGasTank) {
        GasStack gasContent = ((HybridGasTank) tank.getTank()).getGas();
        if(gasContent != null && gasContent.amount > 0) {
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            float percFilled = ((float) gasContent.amount) / ((float) tank.getTank().getCapacity());
            percFilled = MathHelper.clamp(percFilled, 0F, 1F);
            int pxFilled = MathHelper.ceil(percFilled * 61F);
            TextureAtlasSprite tas = gasContent.getGas().getSprite();
            if(tas == null) {
                tas = Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite();
            }
            this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
            drawTexturedModalRect(15, 10 + 61 - pxFilled, tas, 20, pxFilled);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号