本文整理汇总了Java中net.minecraft.client.renderer.texture.LayeredTexture类的典型用法代码示例。如果您正苦于以下问题:Java LayeredTexture类的具体用法?Java LayeredTexture怎么用?Java LayeredTexture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LayeredTexture类属于net.minecraft.client.renderer.texture包,在下文中一共展示了LayeredTexture类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindHorseTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
}
示例2: getTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
}
示例3: getPedestalTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
}
示例4: getArmorTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
}
示例5: getOrCreateLayeredResourceLoc
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
@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;
}
}
示例6: getTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
}
示例7: getEntityTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
@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;
}
示例8: func_110848_b
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
示例9: func_110848_b
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
示例10: func_110848_b
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
示例11: func_110848_b
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
示例12: getArmoredTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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;
}
示例13: loadLayeredTexture
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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);
}
示例14: getImage
import net.minecraft.client.renderer.texture.LayeredTexture; //导入依赖的package包/类
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);
}
}
}