package com.lothrazar.cyclicmagic;

import org.apache.logging.log4j.Logger;
import com.lothrazar.cyclicmagic.net.*;
import com.lothrazar.cyclicmagic.proxy.CommonProxy;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;

/**
 * Split out into a standalone mod from my old abandoned one
 * https://github.com/PrinceOfAmber/SamsPowerups
 * 
 * @author Sam Bassett (Lothrazar)
 */
@Mod(modid = Const.MODID, useMetadata = true)
public class ModMain {

	@Instance(value = Const.MODID)
	public static ModMain instance;
	@SidedProxy(clientSide = "com.lothrazar." + Const.MODID + ".proxy.ClientProxy", serverSide = "com.lothrazar." + Const.MODID + ".proxy.CommonProxy")
	public static CommonProxy proxy;
	public static Logger logger;
	public static ModConfig cfg;
	public static SimpleNetworkWrapper network;

	@EventHandler
	public void onPreInit(FMLPreInitializationEvent event) {
		logger = event.getModLog();

		cfg = new ModConfig(new Configuration(event.getSuggestedConfigurationFile()));

		network = NetworkRegistry.INSTANCE.newSimpleChannel(Const.MODID);

		int packetID = 11;
		network.registerMessage(MessageKeyCast.class, MessageKeyCast.class, packetID++, Side.SERVER);
		network.registerMessage(MessageKeyLeft.class, MessageKeyLeft.class, packetID++, Side.SERVER);
		network.registerMessage(MessageKeyRight.class, MessageKeyRight.class, packetID++, Side.SERVER);
		network.registerMessage(MessageToggle.class, MessageToggle.class, packetID++, Side.SERVER);
		//TODO: message is never used - it tells client when/where to spawn particles
		network.registerMessage(MessageParticle.class, MessageParticle.class, packetID++, Side.CLIENT);

		MinecraftForge.EVENT_BUS.register(new EventRegistry());
	}

	@EventHandler
	public void onInit(FMLInitializationEvent event) {
		ItemRegistry.register();
		BlockRegistry.register();
		ProjectileRegistry.register();
		PotionRegistry.register();
		SpellRegistry.register();

		proxy.register();
	}
}

@@ -2505,10 +2505,737 @@
 r();%0A%09%7D%0A
+%09%0A%09%0A%09/*%0A%09 ideas/plans/bugfixes%0A%09 %0A%09 fix some particles trying to render only server side and failing%0A%09 %0A%09 why is mouse invisible?? -%3E add gui background%0A%09 %0A%09     TORCH: good speed for projectiles%0A%09-%3E still drops torches%0A%09%0A%09%0A%09STAIRS: stay up or stay down, they dont change bbetween%0A%09%0A%09%0A%09purple brick_ go through more than one block?%0A%09%0A%09work just in the air%0A%09%0A%09Scaffold X block doesnt work in midair%0A%09%0A%09?? maybe night vision%0A%09%0A%09Regeneration / health boost /absorption%0A%09%0A%09%0A%09they take ? durability in creative mode but shouldnt%0A%09%0A%09potion.frost icon and name missing%0A%09potion.frost missing trail of snow, does not leave behind%0A%09%0A%09make default reparis faster (and only serverside )%0A%09%0A%09wand spell info put also in tooltips%0A%09%0A%09 %0A%09 * */%0A
 %7D%0A

add comments/task list