Merge pull request #26 from tomevoll/mc1.9

Fixes crash on values()
This commit is contained in:
Raoul
2016-04-05 21:20:06 +02:00

View File

@@ -21,7 +21,7 @@ public class ItemBlockController extends ItemBlockBase {
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) {
EnumControllerType type = EnumControllerType.values()[stack.getMetadata()];
EnumControllerType type = stack.getMetadata() == EnumControllerType.CREATIVE.getId() ? EnumControllerType.CREATIVE : EnumControllerType.NORMAL;
int energyStored = 0;
int capacity = TileController.ENERGY_CAPACITY;
@@ -50,7 +50,7 @@ public class ItemBlockController extends ItemBlockBase {
}
public static ItemStack initNBT(ItemStack stack) {
EnumControllerType type = EnumControllerType.values()[stack.getMetadata()];
EnumControllerType type = stack.getMetadata() == EnumControllerType.CREATIVE.getId() ? EnumControllerType.CREATIVE : EnumControllerType.NORMAL;
NBTTagCompound tag = stack.getTagCompound();
if(tag == null) tag = new NBTTagCompound();