Fixed possible ClassCastException with dye-able armor. (#5985)

This commit is contained in:
Paul Becker 2019-07-31 01:30:12 +02:00 committed by LexManos
parent 5d33697cb1
commit 995a8b8d35

View file

@ -11,9 +11,10 @@
boolean flag = this.func_188363_b(p_188361_9_);
- this.func_215333_a(this.func_177181_a(armoritem, flag));
- if (armoritem instanceof DyeableArmorItem) {
- int i = ((DyeableArmorItem)armoritem).func_200886_f(itemstack);
+ this.func_215333_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, null));
+ if (armoritem instanceof net.minecraft.item.IDyeableArmorItem) { // Allow this for anything, not only cloth
int i = ((DyeableArmorItem)armoritem).func_200886_f(itemstack);
+ int i = ((net.minecraft.item.IDyeableArmorItem)armoritem).func_200886_f(itemstack);
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;