This commit is contained in:
Lizbeth Rika committed 2015-01-18 17:16:58 +00:00
1 parent 0fcb96c50d
commit 9508b8889b
174 files changed
+808 -972

No files matched your search

@@ -11,18 +11,7 @@
*/
package vazkii.botania.common.brew;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import net.minecraft.potion.Potion;
import vazkii.botania.common.brew.potion.PotionCleansing;
import vazkii.botania.common.brew.potion.PotionEmptiness;
import vazkii.botania.common.brew.potion.PotionFeatherfeet;
import vazkii.botania.common.brew.potion.PotionFulfilment;
import vazkii.botania.common.brew.potion.PotionGravitation;
import vazkii.botania.common.brew.potion.PotionLivingReactor;
import vazkii.botania.common.brew.potion.PotionManashock;
import vazkii.botania.common.brew.potion.PotionSoulCross;
public class ModPotions {
@@ -38,7 +27,7 @@ public class ModPotions {
public static void init() {
/*if(Potion.potionTypes.length < 256)
extendPotionArray();
soulCross = new PotionSoulCross();
featherfeet = new PotionFeatherfeet();
emptiness = new PotionEmptiness();
@@ -49,29 +38,4 @@ public class ModPotions {
cleansing = new PotionCleansing();*/
}
// This is the method that everyone and their mom uses right?
// Source: http://www.minecraftforge.net/wiki/Potion_Tutorial
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);
Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
}
} catch (Exception e) {
System.err.println("Botania done goofed:");
System.err.println(e);
}
}
}
}