From 7e9d2fb50973bf811dc0118091e5d2ac2130b4ec Mon Sep 17 00:00:00 2001 From: cpw Date: Sun, 19 Apr 2015 12:04:22 -0400 Subject: [PATCH] Reformat ItemArmor$ArmorMaterial.getBaseItem to use an if/then/else structure. The switch causes the generation of an internal class which may derp custom armor addition. Closes #1799 --- .../net/minecraft/item/ItemArmor.java.patch | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch index 8c21039da5..c660916d7c 100644 --- a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -19,20 +19,17 @@ private ArmorMaterial(int p_i1827_3_, int[] p_i1827_4_, int p_i1827_5_) { this.field_78048_f = p_i1827_3_; -@@ -283,7 +286,15 @@ +@@ -283,7 +286,12 @@ public Item func_151685_b() { - return this == CLOTH ? Items.field_151116_aA : (this == CHAIN ? Items.field_151042_j : (this == GOLD ? Items.field_151043_k : (this == IRON ? Items.field_151042_j : (this == DIAMOND ? Items.field_151045_i : null)))); -+ switch (this) -+ { -+ case CLOTH: return Items.field_151116_aA; -+ case CHAIN: return Items.field_151042_j; -+ case GOLD: return Items.field_151043_k; -+ case IRON: return Items.field_151042_j; -+ case DIAMOND: return Items.field_151045_i; -+ default: return customCraftingMaterial; -+ } ++ return this == CLOTH ? Items.field_151116_aA : ++ (this == CHAIN ? Items.field_151042_j : ++ (this == GOLD ? Items.field_151043_k : ++ (this == IRON ? Items.field_151042_j : ++ (this == DIAMOND ? Items.field_151045_i : ++ customCraftingMaterial)))); } } }