package tamaized.aov.registry;

import net.minecraft.potion.Potion;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import tamaized.aov.AoV;
import tamaized.aov.common.potion.PotionAid;
import tamaized.aov.common.potion.PotionBalance;
import tamaized.aov.common.potion.PotionColdChill;
import tamaized.aov.common.potion.PotionEwer;
import tamaized.aov.common.potion.PotionNaturesBounty;
import tamaized.aov.common.potion.PotionSlowFall;
import tamaized.aov.common.potion.PotionSpear;
import tamaized.aov.common.potion.PotionSpire;
import tamaized.aov.common.potion.PotionStalwartPact;

import java.util.ArrayList;
import java.util.List;

@Mod.EventBusSubscriber(modid = AoV.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class AoVPotions {

	public static Potion aid;
	public static Potion shieldOfFaith;
	public static Potion zeal;
	public static Potion stalwartPact;
	public static Potion slowFall;
	public static Potion spear;
	public static Potion ewer;
	public static Potion spire;
	public static Potion balance;
	public static Potion naturesBounty;
	public static Potion coldChill;
	private static List<Potion> potionList;

	static {
		potionList = new ArrayList<>();

		potionList.add(aid = new PotionAid("aid"));
		potionList.add(shieldOfFaith = new PotionAid("faith"));
		potionList.add(zeal = new PotionAid("zeal"));
		potionList.add(stalwartPact = new PotionStalwartPact("stalwart"));

		potionList.add(slowFall = new PotionSlowFall("slowfall"));

		potionList.add(spear = new PotionSpear("spear"));
		potionList.add(ewer = new PotionEwer("ewer"));
		potionList.add(spire = new PotionSpire("spire"));
		potionList.add(balance = new PotionBalance("balance"));

		potionList.add(naturesBounty = new PotionNaturesBounty("naturesbounty"));
		potionList.add(coldChill = new PotionColdChill("coldchill"));
	}

	@SubscribeEvent
	public static void registerPotions(RegistryEvent.Register<Potion> event) {
		for (Potion p : potionList)
			event.getRegistry().register(p);
	}

}

@@ -205,16 +205,67 @@
 on.Mod;%0A
+import net.minecraftforge.registries.ObjectHolder;%0A
 import t
@@ -730,59 +730,32 @@
 t;%0A%0A
-import java.util.ArrayList;%0Aimport java.util.List;%0A
+@ObjectHolder(AoV.MODID)
 %0A@Mo
@@ -1210,112 +1210,142 @@
 ll;%0A
-%09private static List%3C
+%0A%09@SubscribeEvent%0A%09public static void register
 Potion
-%3E potionList;%0A%0A%09static %7B%0A%09%09potionList = new ArrayList%3C%3E();%0A%0A%09%09potionList.add(
+s(RegistryEvent.Register%3CPotion%3E event) %7B%0A%09%09event.getRegistry().registerAll(%0A%0A%09%09%09%09
 aid 
@@ -1366,36 +1366,23 @@
 d(%22aid%22)
-);%0A%09%09potionList.add(
+,%0A%0A%09%09%09%09
 shieldOf
@@ -1408,35 +1408,30 @@
 id(%22
+shieldof
 faith%22)
-);%0A%09%09potionList.add(
+,%0A%0A%09%09%09%09
 zeal
@@ -1454,36 +1454,23 @@
 (%22zeal%22)
-);%0A%09%09potionList.add(
+,%0A%0A%09%09%09%09
 stalwart
@@ -1508,39 +1508,29 @@
 stalwart
-%22));
+pact%22),
 %0A%0A%09%09
-potionList.add(
+%09%09
 slowFall
@@ -1562,37 +1562,23 @@
 owfall%22)
-);
+,
 %0A%0A%09%09
-potionList.add(
+%09%09
 spear = 
@@ -1601,36 +1601,23 @@
 %22spear%22)
-);%0A%09%09potionList.add(
+,%0A%0A%09%09%09%09
 ewer = n
@@ -1637,36 +1637,23 @@
 (%22ewer%22)
-);%0A%09%09potionList.add(
+,%0A%0A%09%09%09%09
 spire = 
@@ -1676,36 +1676,23 @@
 %22spire%22)
-);%0A%09%09potionList.add(
+,%0A%0A%09%09%09%09
 balance 
@@ -1725,29 +1725,15 @@
 ce%22)
-);
+,
 %0A%0A%09%09
-potionList.add(
+%09%09
 natu
@@ -1788,28 +1788,15 @@
 ty%22)
-);%0A%09%09potionList.add(
+,%0A%0A%09%09%09%09
 cold
@@ -1839,171 +1839,12 @@
 ll%22)
-);%0A%09%7D%0A%0A%09@SubscribeEvent%0A%09public static void registerPotions(RegistryEvent.Register%3CPotion%3E event) %7B%0A%09%09for (Potion p : potionList)%0A%09%09%09event.getRegistry().register(p
+%0A%0A%09%09
 );%0A%09

update potion register to be sane