Cleanup, implement some easter egg models I missed

This commit is contained in:
Vincent Lee committed 2016-01-15 14:14:10 -06:00
1 parent 2c15b6150c
commit 406f89a968
26 files changed
+119 -107

No files matched your search

@@ -31,9 +31,6 @@ public class ModPotions {
public static Potion clear;
public static void init() {
// if(Potion.potionTypes.length < 256)
// extendPotionArray(); todo 1.8 this should be unnecessary thanks to potion registry
soulCross = new PotionSoulCross();
featherfeet = new PotionFeatherfeet();
emptiness = new PotionEmptiness();
@@ -42,27 +39,4 @@ public class ModPotions {
clear = new PotionClear();
}
private static void extendPotionArray() {
Potion[] potionTypes = null;
for (Field f : Potion.class.getDeclaredFields()) {
f.setAccessible(true);
try {
if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
potionTypes = (Potion[])f.get(null);
final Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
}
} catch (Exception e) {
System.err.println("Severe error, please report this to the mod author:");
e.printStackTrace();
}
}
}
}