Minor code cleanup in ModPotions

This commit is contained in:
Cheeserolls 2015-05-27 23:15:49 +01:00
parent 2871b7b2c4
commit b5efea309b

View file

@ -17,20 +17,18 @@ import biomesoplenty.common.util.BOPReflectionHelper;
public class ModPotions public class ModPotions
{ {
private static int lastId; private static int nextId;
public static void init() public static void init()
{ {
lastId = Potion.potionTypes.length; nextId = Potion.potionTypes.length;
// Need to expand the potions array to hold all our potions // Need to expand the potions array to hold all our potions
// Irritatingly this has to be done before creating the potion instances, so it can't just be done dynamically // Irritatingly this has to be done before creating the potion instances, so it can't just be done dynamically
// ...anyway, increase the number below for every new potion you add // ...anyway, increase the number below for every new potion you add
int numberOfPotionsToAdd = 2; int numberOfPotionsToAdd = 2;
expandPotionsArray(numberOfPotionsToAdd); expandPotionsArray(numberOfPotionsToAdd);
// public static final Potion moveSpeed = (new Potion(1, new ResourceLocation("speed"), false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2);
// create the BOP potions // create the BOP potions
paralysis = (new PotionParalysis(getNextId(), new ResourceLocation("paralysis"), true, 16767262)).setPotionName("potion.paralysis"); paralysis = (new PotionParalysis(getNextId(), new ResourceLocation("paralysis"), true, 16767262)).setPotionName("potion.paralysis");
possession = (new PotionPossession(getNextId(), new ResourceLocation("possession"), true, 1280)).setPotionName("potion.possession"); possession = (new PotionPossession(getNextId(), new ResourceLocation("possession"), true, 1280)).setPotionName("potion.possession");
@ -53,7 +51,7 @@ public class ModPotions
private static int getNextId() private static int getNextId()
{ {
return lastId++; return nextId++;
} }