Java 类net.minecraft.client.renderer.texture.LayeredTexture 实例源码

项目:Gravestone-mod-Extended    文件:CorpseRendererHelper.java   
private static void bindHorseTexture(int horseType) {
    switch (horseType) {
        case 0:
            String horseTexturePath = horse.getHorseTexture();
            ResourceLocation horseResourceLocation = (ResourceLocation) horsesTexturesMap.get(horseTexturePath);
            if (horseResourceLocation == null) {
                horseResourceLocation = new ResourceLocation(horseTexturePath);
                Minecraft.getMinecraft().getTextureManager().loadTexture(horseResourceLocation, new LayeredTexture(horse.getVariantTexturePaths()));
                horsesTexturesMap.put(horseTexturePath, horseResourceLocation);
            }
            Minecraft.getMinecraft().renderEngine.bindTexture(horseResourceLocation);
            break;
        case 1:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.DONKEY);
            break;
        case 2:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.MULE);
            break;
        case 3:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.ZOMBIE_HORSE);
            break;
        case 4:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.SKELETON_HORSE);
            break;
    }
}
项目:Gravestone-mod-Extended    文件:TileEntityMemorialRenderer.java   
private static ResourceLocation getTexture(EnumMemorials memorialType, ResourceLocation texture, boolean isMossy) {
    if (isMossy) {
        ResourceLocation mixedMossyTexture = mossyTextures.get(memorialType);
        if (mixedMossyTexture == null) {
            ResourceLocation mossyTexture = getMossyTexture(memorialType.getMemorialType());
            mixedMossyTexture = new ResourceLocation(texture.getResourceDomain() + ":mossy_" + texture.getResourcePath());
            Minecraft.getMinecraft().getTextureManager().loadTexture(mixedMossyTexture,
                    new LayeredTexture(texture.getResourceDomain() + ":" + texture.getResourcePath(),
                            mossyTexture.getResourceDomain() + ":" + mossyTexture.getResourcePath()));
            mossyTextures.put(memorialType, mixedMossyTexture);
            return mixedMossyTexture;
        } else {
            return mixedMossyTexture;
        }
    } else {
        return texture;
    }
}
项目:Gravestone-mod-Extended    文件:TileEntityMemorialRenderer.java   
private static ResourceLocation getPedestalTexture(EnumMemorials memorialType, boolean isMossy) {
    ResourceLocation texture = memorialType.getPedestalTexture();
    if (isMossy && texture != null) {
        ResourceLocation mixedMossyTexture = mossyPedestalTextures.get(memorialType.getMaterial());
        if (mixedMossyTexture == null) {
            ResourceLocation mossyTexture = getMossyPedestalTexture(memorialType.getMemorialType());
            mixedMossyTexture = new ResourceLocation(texture.getResourceDomain() + ":mossy_" + texture.getResourcePath());
            Minecraft.getMinecraft().getTextureManager().loadTexture(mixedMossyTexture,
                    new LayeredTexture(texture.getResourceDomain() + ":" + texture.getResourcePath(),
                            mossyTexture.getResourceDomain() + ":" + mossyTexture.getResourcePath()));
            mossyPedestalTextures.put(memorialType.getMaterial(), mixedMossyTexture);
            return mixedMossyTexture;
        } else {
            return mixedMossyTexture;
        }
    } else {
        return texture;
    }
}
项目:Gravestone-mod-Extended    文件:TileEntityMemorialRenderer.java   
private static ResourceLocation getArmorTexture(EnumMemorials memorialType, boolean isMossy) {
    ResourceLocation texture = getArmorTexture(memorialType);
    if (isMossy) {
        ResourceLocation mixedMossyTexture = mossyArmorTextures.get(memorialType.getMaterial());
        if (mixedMossyTexture == null) {
            ResourceLocation mossyTexture = Resources.MOSSY_ARMOR;
            mixedMossyTexture = new ResourceLocation(texture.getResourceDomain() + ":mossy_" + texture.getResourcePath());
            Minecraft.getMinecraft().getTextureManager().loadTexture(mixedMossyTexture,
                    new LayeredTexture(texture.getResourceDomain() + ":" + texture.getResourcePath(),
                            mossyTexture.getResourceDomain() + ":" + mossyTexture.getResourcePath()));
            mossyArmorTextures.put(memorialType.getMaterial(), mixedMossyTexture);
            return mixedMossyTexture;
        } else {
            return mixedMossyTexture;
        }
    } else {
        return texture;
    }
}
项目:ExpandedRailsMod    文件:RenderHorse.java   
@Nullable
private ResourceLocation getOrCreateLayeredResourceLoc(EntityHorse p_188328_1_)
{
    String s = p_188328_1_.getHorseTexture();

    if (!p_188328_1_.hasTexture())
    {
        return null;
    }
    else
    {
        ResourceLocation resourcelocation = (ResourceLocation)LAYERED_LOCATION_CACHE.get(s);

        if (resourcelocation == null)
        {
            resourcelocation = new ResourceLocation(s);
            Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(p_188328_1_.getVariantTexturePaths()));
            LAYERED_LOCATION_CACHE.put(s, resourcelocation);
        }

        return resourcelocation;
    }
}
项目:Gravestone-mod-Graves    文件:TileEntityGraveStoneRenderer.java   
private ResourceLocation getTexture(EnumGraves graveType, ResourceLocation texture, boolean isMossy) {
    if (isMossy) {
        ResourceLocation mixedMossyTexture = mossyTexturesMap.get(graveType);
        if (mixedMossyTexture == null) {
            ResourceLocation mossyTexture = getMossyTexture(graveType.getGraveType());
            mixedMossyTexture = new ResourceLocation(texture.getResourceDomain() + ":mossy_" + texture.getResourcePath());
            Minecraft.getMinecraft().getTextureManager().loadTexture(mixedMossyTexture,
                    new LayeredTexture(texture.getResourceDomain() + ":" + texture.getResourcePath(),
                            mossyTexture.getResourceDomain() + ":" + mossyTexture.getResourcePath()));
            mossyTexturesMap.put(graveType, mixedMossyTexture);
            return mixedMossyTexture;
        } else {
            return mixedMossyTexture;
        }
    } else {
        return texture;
    }
}
项目:Gravestone-mod-Extended    文件:RenderUndeadHorse.java   
@Nullable
@Override
protected ResourceLocation getEntityTexture(EntityUndeadHorse horse) {
    String s = horse.getHorseTexture();
    ResourceLocation resourcelocation = TEXTURES_MAP.get(s);

    if (resourcelocation == null) {
        resourcelocation = new ResourceLocation(s);
        Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(horse.getVariantTexturePaths()));
        TEXTURES_MAP.put(s, resourcelocation);
    }

    return resourcelocation;
}
项目:Resilience-Client-Source    文件:RenderHorse.java   
private ResourceLocation func_110848_b(EntityHorse par1EntityHorse)
{
    String var2 = par1EntityHorse.getHorseTexture();
    ResourceLocation var3 = (ResourceLocation)field_110852_a.get(var2);

    if (var3 == null)
    {
        var3 = new ResourceLocation(var2);
        Minecraft.getMinecraft().getTextureManager().loadTexture(var3, new LayeredTexture(par1EntityHorse.getVariantTexturePaths()));
        field_110852_a.put(var2, var3);
    }

    return var3;
}
项目:Cauldron    文件:RenderHorse.java   
private ResourceLocation func_110848_b(EntityHorse p_110848_1_)
{
    String s = p_110848_1_.getHorseTexture();
    ResourceLocation resourcelocation = (ResourceLocation)field_110852_a.get(s);

    if (resourcelocation == null)
    {
        resourcelocation = new ResourceLocation(s);
        Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(p_110848_1_.getVariantTexturePaths()));
        field_110852_a.put(s, resourcelocation);
    }

    return resourcelocation;
}
项目:Cauldron    文件:RenderHorse.java   
private ResourceLocation func_110848_b(EntityHorse p_110848_1_)
{
    String s = p_110848_1_.getHorseTexture();
    ResourceLocation resourcelocation = (ResourceLocation)field_110852_a.get(s);

    if (resourcelocation == null)
    {
        resourcelocation = new ResourceLocation(s);
        Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(p_110848_1_.getVariantTexturePaths()));
        field_110852_a.put(s, resourcelocation);
    }

    return resourcelocation;
}
项目:RuneCraftery    文件:RenderHorse.java   
private ResourceLocation func_110848_b(EntityHorse p_110848_1_) {
   String var2 = p_110848_1_.func_110264_co();
   ResourceLocation var3 = (ResourceLocation)field_110852_a.get(var2);
   if(var3 == null) {
      var3 = new ResourceLocation(var2);
      Minecraft.func_71410_x().func_110434_K().func_110579_a(var3, new LayeredTexture(p_110848_1_.func_110212_cp()));
      field_110852_a.put(var2, var3);
   }

   return var3;
}
项目:RuneCraftery    文件:RenderHorse.java   
private ResourceLocation func_110848_b(EntityHorse par1EntityHorse)
{
    String s = par1EntityHorse.getHorseTexture();
    ResourceLocation resourcelocation = (ResourceLocation)field_110852_a.get(s);

    if (resourcelocation == null)
    {
        resourcelocation = new ResourceLocation(s);
        Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(par1EntityHorse.getVariantTexturePaths()));
        field_110852_a.put(s, resourcelocation);
    }

    return resourcelocation;
}
项目:EnderZoo    文件:RenderFallenMount.java   
private ResourceLocation getArmoredTexture(EntityHorse horse) {
  String s = horseArmorTextures[horse.getHorseArmorType().ordinal()];
  ResourceLocation resourcelocation = textureCache.get(s);
  if(resourcelocation == null) {
    resourcelocation = new ResourceLocation("Layered:" + s);
    Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(textureName, s));
    textureCache.put(s, resourcelocation);
  }
  return resourcelocation;
}
项目:BetterNutritionMod    文件:RenderHorse.java   
private ResourceLocation func_110848_b(EntityHorse par1EntityHorse)
{
    String s = par1EntityHorse.getHorseTexture();
    ResourceLocation resourcelocation = (ResourceLocation)field_110852_a.get(s);

    if (resourcelocation == null)
    {
        resourcelocation = new ResourceLocation(s);
        Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(par1EntityHorse.getVariantTexturePaths()));
        field_110852_a.put(s, resourcelocation);
    }

    return resourcelocation;
}
项目:BaseClient    文件:ShadersTex.java   
public static void loadLayeredTexture(LayeredTexture tex, IResourceManager manager, List list)
{
    int i = 0;
    int j = 0;
    int k = 0;
    int[] aint = null;

    for (Object s : list)
    {
        if (s != null)
        {
            try
            {
                ResourceLocation resourcelocation = new ResourceLocation((String) s);
                InputStream inputstream = manager.getResource(resourcelocation).getInputStream();
                BufferedImage bufferedimage = ImageIO.read(inputstream);

                if (k == 0)
                {
                    i = bufferedimage.getWidth();
                    j = bufferedimage.getHeight();
                    k = i * j;
                    aint = createAIntImage(k, 0);
                }

                int[] aint1 = getIntArray(k * 3);
                bufferedimage.getRGB(0, 0, i, j, aint1, 0, i);
                loadNSMap(manager, resourcelocation, i, j, aint1);

                for (int l = 0; l < k; ++l)
                {
                    int i1 = aint1[l] >>> 24 & 255;
                    aint[k * 0 + l] = blendColor(aint1[k * 0 + l], aint[k * 0 + l], i1);
                    aint[k * 1 + l] = blendColor(aint1[k * 1 + l], aint[k * 1 + l], i1);
                    aint[k * 2 + l] = blendColor(aint1[k * 2 + l], aint[k * 2 + l], i1);
                }
            }
            catch (IOException ioexception)
            {
                ioexception.printStackTrace();
            }
        }
    }

    setupTexture(tex.getMultiTexID(), aint, i, j, false, false);
}
项目:Backmemed    文件:ShadersTex.java   
public static void loadLayeredTexture(LayeredTexture tex, IResourceManager manager, List list)
{
    int i = 0;
    int j = 0;
    int k = 0;
    int[] aint = null;

    for (Object s : list)
    {
        if (s != null)
        {
            try
            {
                ResourceLocation resourcelocation = new ResourceLocation((String) s);
                InputStream inputstream = manager.getResource(resourcelocation).getInputStream();
                BufferedImage bufferedimage = ImageIO.read(inputstream);

                if (k == 0)
                {
                    i = bufferedimage.getWidth();
                    j = bufferedimage.getHeight();
                    k = i * j;
                    aint = createAIntImage(k, 0);
                }

                int[] aint1 = getIntArray(k * 3);
                bufferedimage.getRGB(0, 0, i, j, aint1, 0, i);
                loadNSMap(manager, resourcelocation, i, j, aint1);

                for (int l = 0; l < k; ++l)
                {
                    int i1 = aint1[l] >>> 24 & 255;
                    aint[k * 0 + l] = blendColor(aint1[k * 0 + l], aint[k * 0 + l], i1);
                    aint[k * 1 + l] = blendColor(aint1[k * 1 + l], aint[k * 1 + l], i1);
                    aint[k * 2 + l] = blendColor(aint1[k * 2 + l], aint[k * 2 + l], i1);
                }
            }
            catch (IOException ioexception)
            {
                ioexception.printStackTrace();
            }
        }
    }

    setupTexture(tex.getMultiTexID(), aint, i, j, false, false);
}
项目:IvToolkit    文件:IvTextureCreatorMC.java   
public static BufferedImage getImage(IResourceManager resourceManager, ResourceLocation location, Logger logger) throws IOException
{
    ITextureObject textureObject = Minecraft.getMinecraft().getTextureManager().getTexture(location);

    if (textureObject instanceof ThreadDownloadImageData)
    {
        return ReflectionHelper.getPrivateValue(ThreadDownloadImageData.class, (ThreadDownloadImageData) textureObject, "bufferedImage", "field_110560_d");
    }
    else if (textureObject instanceof LayeredTexture)
    {
        BufferedImage bufferedimage = null;

        for (Object layeredTextureNameObj : ((LayeredTexture) textureObject).layeredTextureNames)
        {
            String layeredTextureName = (String) layeredTextureNameObj;

            if (layeredTextureName != null)
            {
                try (InputStream inputstream = resourceManager.getResource(new ResourceLocation(layeredTextureName)).getInputStream())
                {
                    BufferedImage bufferImageLayer = ImageIO.read(inputstream);

                    if (bufferedimage == null)
                    {
                        bufferedimage = new BufferedImage(bufferImageLayer.getWidth(), bufferImageLayer.getHeight(), 2);
                    }

                    bufferedimage.getGraphics().drawImage(bufferImageLayer, 0, 0, null);
                }
            }
        }

        return bufferedimage;
    }
    else if (textureObject instanceof PreBufferedTexture)
    {
        return ((PreBufferedTexture) textureObject).getBufferedImage();
    }
    else
    {
        IResource iresource = resourceManager.getResource(location);

        try (InputStream inputstream = iresource.getInputStream())
        {
            return ImageIO.read(inputstream);
        }
    }
}