Fix leather armor overlay not rendering when armor is pure white. Closes #3184

This commit is contained in:
LexManos committed 2016-08-13 13:02:59 -07:00
1 parent 8195c36434
commit 20c662c1d0
2 files changed
+25 -6

No files matched your search

@@ -13,12 +13,11 @@
+ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, null));
- switch (itemarmor.func_82812_d())
- {
{
- case LEATHER:
int i = itemarmor.func_82814_b(itemstack);
+ {
+ if (i != 0xFFFFFF) // Allow this for anything, not only cloth
+ if (itemarmor.hasOverlay(itemstack)) // Allow this for anything, not only cloth
+ {
int i = itemarmor.func_82814_b(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
@@ -1,6 +1,26 @@
--- ../src-base/minecraft/net/minecraft/item/ItemArmor.java
+++ ../src-work/minecraft/net/minecraft/item/ItemArmor.java
@@ -236,6 +236,8 @@
@@ -222,6 +222,19 @@
return multimap;
}
+ /**
+ * Determines if this armor will be rendered with the secondary 'overlay' texture.
+ * If this is true, the first texture will be rendered using a tint of the color
+ * specified by getColor(ItemStack)
+ *
+ * @param stack The stack
+ * @return true/false
+ */
+ public boolean hasOverlay(ItemStack stack)
+ {
+ return this.field_77878_bZ == ItemArmor.ArmorMaterial.LEATHER || func_82814_b(stack) != 0xFFFFFFFF;
+ }
+
public static enum ArmorMaterial
{
LEATHER("leather", 5, new int[]{1, 2, 3, 1}, 15, SoundEvents.field_187728_s, 0.0F),
@@ -236,6 +249,8 @@
private final int field_78055_h;
private final SoundEvent field_185020_j;
private final float field_189417_k;
@@ -9,7 +29,7 @@
private ArmorMaterial(String p_i47117_3_, int p_i47117_4_, int[] p_i47117_5_, int p_i47117_6_, SoundEvent p_i47117_7_, float p_i47117_8_)
{
@@ -269,7 +271,15 @@
@@ -269,7 +284,15 @@
public Item func_151685_b()
{