mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 06:52:58 +00:00
Cleanup, implement some easter egg models I missed
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user