Changed hardcoded 1 to EnumControllerType.CREATIVE.getId()

This commit is contained in:
Tom Erik
2016-04-05 21:01:02 +02:00
parent 1b9ed89093
commit 2a88127fd1

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 = stack.getMetadata() == 1 ? EnumControllerType.CREATIVE : EnumControllerType.NORMAL;
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 = stack.getMetadata() == 1 ? EnumControllerType.CREATIVE : EnumControllerType.NORMAL;
EnumControllerType type = stack.getMetadata() == EnumControllerType.CREATIVE.getId() ? EnumControllerType.CREATIVE : EnumControllerType.NORMAL;
NBTTagCompound tag = stack.getTagCompound();
if(tag == null) tag = new NBTTagCompound();