本文整理汇总了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();
}
}
示例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);
}
示例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;
}