1.9: Fixed registering armor materials through EnumHelper exploding

1.9 ArmorMaterial now requires a SoundEvent for the equip sound.
This commit is contained in:
Vasco Lavos 2016-03-15 17:52:58 +00:00
parent ae72fa7ceb
commit 05801a74af

View file

@ -15,6 +15,7 @@ import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.EnumSkyBlock;
@ -35,7 +36,7 @@ public class EnumHelper
private static Class[][] commonTypes =
{
{EnumAction.class},
{ArmorMaterial.class, String.class, int.class, int[].class, int.class},
{ArmorMaterial.class, String.class, int.class, int[].class, int.class, SoundEvent.class},
{EnumArt.class, String.class, int.class, int.class, int.class, int.class},
{EnumCreatureAttribute.class},
{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class},
@ -53,9 +54,9 @@ public class EnumHelper
{
return addEnum(EnumAction.class, name);
}
public static ArmorMaterial addArmorMaterial(String name, String textureName, int durability, int[] reductionAmounts, int enchantability)
public static ArmorMaterial addArmorMaterial(String name, String textureName, int durability, int[] reductionAmounts, int enchantability, SoundEvent soundOnEquip)
{
return addEnum(ArmorMaterial.class, name, textureName, durability, reductionAmounts, enchantability);
return addEnum(ArmorMaterial.class, name, textureName, durability, reductionAmounts, enchantability, soundOnEquip);
}
public static EnumArt addArt(String name, String tile, int sizeX, int sizeY, int offsetX, int offsetY)
{
@ -281,4 +282,4 @@ public class EnumHelper
setup();
}
}
}
}