mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 06:52:58 +00:00
Added new brews.
This commit is contained in:
1 parent
b8e4bbab4e
commit
133f696c66
17 files changed
+197
-153
No files matched your search
@@ -11,31 +11,56 @@
|
||||
*/
|
||||
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.PotionAllure;
|
||||
import vazkii.botania.common.brew.potion.PotionBloodthirst;
|
||||
import vazkii.botania.common.brew.potion.PotionEmptiness;
|
||||
import vazkii.botania.common.brew.potion.PotionFeatherfeet;
|
||||
import vazkii.botania.common.brew.potion.PotionSoulCross;
|
||||
|
||||
public class ModPotions {
|
||||
|
||||
public static Potion soulCross;
|
||||
public static Potion featherfeet;
|
||||
public static Potion emptiness;
|
||||
public static Potion fulfilment;
|
||||
public static Potion livingReactor;
|
||||
public static Potion manashock;
|
||||
public static Potion gravitation;
|
||||
public static Potion cleansing;
|
||||
public static Potion bloodthrst;
|
||||
public static Potion allure;
|
||||
|
||||
public static void init() {
|
||||
/*if(Potion.potionTypes.length < 256)
|
||||
if(Potion.potionTypes.length < 256)
|
||||
extendPotionArray();
|
||||
|
||||
soulCross = new PotionSoulCross();
|
||||
featherfeet = new PotionFeatherfeet();
|
||||
emptiness = new PotionEmptiness();
|
||||
fulfilment = new PotionFulfilment();
|
||||
livingReactor = new PotionLivingReactor();
|
||||
manashock = new PotionManashock();
|
||||
gravitation = new PotionGravitation();
|
||||
cleansing = new PotionCleansing();*/
|
||||
bloodthrst = new PotionBloodthirst();
|
||||
allure = new PotionAllure();
|
||||
}
|
||||
|
||||
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:");
|
||||
System.err.println(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user