当前位置: 首页>>代码示例>>Java>>正文


Java TextureMap.getTextureExtry方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.texture.TextureMap.getTextureExtry方法的典型用法代码示例。如果您正苦于以下问题:Java TextureMap.getTextureExtry方法的具体用法?Java TextureMap.getTextureExtry怎么用?Java TextureMap.getTextureExtry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.texture.TextureMap的用法示例。


在下文中一共展示了TextureMap.getTextureExtry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawGuiContainerBackgroundLayer

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
	this.drawDefaultBackground();
	if (te != null) {
		FluidStack fstack = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).drain(1000, false);
		Minecraft.getMinecraft().renderEngine.bindTexture(texture);
		drawTexturedModalRect(guiLeft + 62, guiTop + 17, 176, 32, 52, 16);
		if (fstack == null) {
			drawTexturedModalRect(guiLeft + 80, guiTop + 17, xSize, 0, 16, 16);
		} else {
			TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
			TextureAtlasSprite sprite = map.getTextureExtry(fstack.getFluid().getStill().toString());
			Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
			for (int i = 0; i < 4; i++) drawTexturedModalRect(guiLeft + 62 + (16 * i), guiTop + 17, sprite, 16, 16);
		}
	}
	Minecraft.getMinecraft().renderEngine.bindTexture(texture);
	drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
	if (te != null) {

		int[] data = ((ContainerBarrel) inventorySlots).data_a;
		if (data[2] > 0) {
			double progress = (double) data[0] / (double) data[2];
			if (progress > 1) progress = 1;
			int dy = (int) Math.ceil(31 * progress);
			drawTexturedModalRect(guiLeft + 29, guiTop + 27 + 31 - dy, 0, ySize + 31 - dy, 11, dy);
		}
		float absorption = 1;
		if (data[3] > 0) absorption = (float) data[1] / (float) data[3];
		GlStateManager.pushMatrix();
		{
			GlStateManager.color(2 * (1f - absorption), 2 * absorption, 0f);
			drawTexturedModalRect(guiLeft + 134, guiTop + 20, xSize, 16, 16, 16);
			GlStateManager.color(1f, 1f, 1f);
		}
		GlStateManager.popMatrix();
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:39,代码来源:GuiBarrel.java

示例2: renderTiledFluid

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
static void renderTiledFluid(int x, int y, int width, int height, float depth, FluidStack fluidStack) {
    TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
    TextureAtlasSprite fluidSprite = map.getTextureExtry(fluidStack.getFluid().getStill().toString());
    if (fluidSprite == null) {
        fluidSprite = map.getTextureExtry(TextureMap.LOCATION_MISSING_TEXTURE.toString());
        if (fluidSprite == null)
            return;
    }
    setColorRGBA(fluidStack.getFluid().getColor(fluidStack));
    renderTiledTextureAtlas(x, y, width, height, depth, fluidSprite);
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:12,代码来源:GuiUtils.java

示例3: getStillFluidSprite

import net.minecraft.client.renderer.texture.TextureMap; //导入方法依赖的package包/类
private static TextureAtlasSprite getStillFluidSprite(Minecraft minecraft, Fluid fluid) {
    TextureMap textureMapBlocks = minecraft.getTextureMapBlocks();
    ResourceLocation fluidStill = fluid.getStill();
    TextureAtlasSprite fluidStillSprite = null;
    if (fluidStill != null) {
        fluidStillSprite = textureMapBlocks.getTextureExtry(fluidStill.toString());
    }
    if (fluidStillSprite == null) {
        fluidStillSprite = textureMapBlocks.getMissingSprite();
    }
    return fluidStillSprite;
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:13,代码来源:FluidStackRenderer.java


注:本文中的net.minecraft.client.renderer.texture.TextureMap.getTextureExtry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。