aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java123
1 files changed, 54 insertions, 69 deletions
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index 6bced739c7..9176dcc720 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -2,13 +2,13 @@ package gtPlusPlus.core.common;
import static gtPlusPlus.core.lib.CORE.DEBUG;
-import cpw.mods.fml.common.event.*;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.Entity;
-
import gregtech.api.enums.ItemList;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.ChunkManager;
@@ -18,8 +18,15 @@ import gtPlusPlus.core.entity.InternalEntityRegistry;
import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
import gtPlusPlus.core.entity.monster.EntitySickBlaze;
import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
-import gtPlusPlus.core.handler.*;
-import gtPlusPlus.core.handler.events.*;
+import gtPlusPlus.core.handler.BookHandler;
+import gtPlusPlus.core.handler.BurnableFuelHandler;
+import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import gtPlusPlus.core.handler.COMPAT_IntermodStaging;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.handler.events.BlockEventHandler;
+import gtPlusPlus.core.handler.events.GeneralTooltipEventHandler;
+import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler;
+import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
@@ -33,12 +40,11 @@ import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner;
import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO;
import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC;
-import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import net.minecraft.entity.Entity;
import net.minecraftforge.common.ForgeChunkManager;
public class CommonProxy {
- public static Meta_GT_Proxy GtProxy;
private boolean mFluidsGenerated = false;
public CommonProxy() {
@@ -49,8 +55,6 @@ public class CommonProxy {
} else {
Logger.INFO("We're using GTNH's Gregtech " + Utils.getGregtechVersionAsString());
}
- Logger.INFO("Setting up our own GT_Proxy.");
- GtProxy = Meta_GT_Proxy.instance;
}
public void preInit(final FMLPreInitializationEvent e) {
@@ -58,38 +62,33 @@ public class CommonProxy {
LoadedMods.checkLoaded();
Logger.INFO("Making sure we're ready to party!");
-
- if (!DEBUG){
+ if (!DEBUG) {
Logger.WARNING("Development mode not enabled.");
- }
- else if (DEBUG){
+ } else if (DEBUG) {
Logger.INFO("Development mode enabled.");
- }
- else {
+ } else {
Logger.WARNING("Development mode not set.");
}
AddToCreativeTab.initialiseTabs();
-
- //Moved from Init after Debug Loading.
- //29/01/18 - Alkalus
- //Moved earlier into PreInit, so that Items exist before they're called upon in recipes.
- //20/03/18 - Alkalus
+
+ // Moved from Init after Debug Loading.
+ // 29/01/18 - Alkalus
+ // Moved earlier into PreInit, so that Items exist before they're called upon in
+ // recipes.
+ // 20/03/18 - Alkalus
ModItems.init();
ModBlocks.init();
CI.preInit();
-
-
-
+
COMPAT_IntermodStaging.preInit();
BookHandler.run();
- //Registration of entities and renderers
+ // Registration of entities and renderers
Logger.INFO("[Proxy] Calling Entity registrator.");
registerEntities();
Logger.INFO("[Proxy] Calling Tile Entity registrator.");
registerTileEntities();
-
-
+
Logger.INFO("[Proxy] Calling Render registrator.");
registerRenderThings();
@@ -97,28 +96,21 @@ public class CommonProxy {
Material.generateQueuedFluids();
mFluidsGenerated = true;
}
-
- //Must be done in pre-init.
- generateMobSpawners();
-
- //Internal GT Proxy
- GtProxy.preInit();
-
+
}
public void init(final FMLInitializationEvent e) {
- //Debug Loading
- if (CORE.DEBUG){
+ // Debug Loading
+ if (CORE.DEBUG) {
DEBUG_INIT.registerHandlers();
- }
+ }
ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner();
-
+
if (!mFluidsGenerated && ItemList.valueOf("Cell_Empty").hasBeenSet()) {
Material.generateQueuedFluids();
mFluidsGenerated = true;
- }
- else {
+ } else {
Logger.INFO("[ERROR] Did not generate fluids at all.");
Logger.WARNING("[ERROR] Did not generate fluids at all.");
Logger.ERROR("[ERROR] Did not generate fluids at all.");
@@ -129,22 +121,22 @@ public class CommonProxy {
* Register the Event Handlers.
*/
- //Prevents my Safes being destroyed.
+ // Prevents my Safes being destroyed.
Utils.registerEvent(new PickaxeBlockBreakEventHandler());
- //Block Handler for all events.
+ // Block Handler for all events.
Utils.registerEvent(new BlockEventHandler());
Utils.registerEvent(new GeneralTooltipEventHandler());
- //Handles Custom tooltips for EIO.
+ // Handles Custom tooltips for EIO.
Utils.registerEvent(new HandlerTooltip_EIO());
- //Handles Custom Tooltips for GC
+ // Handles Custom Tooltips for GC
Utils.registerEvent(new HandlerTooltip_GC());
-
- //Register Chunkloader
+
+ // Register Chunkloader
ForgeChunkManager.setForcedChunkLoadingCallback(GTplusplus.instance, ChunkManager.getInstance());
Utils.registerEvent(ChunkManager.getInstance());
- if (ConfigSwitches.disableZombieReinforcement){
- //Make Zombie reinforcements fuck off.
+ if (ConfigSwitches.disableZombieReinforcement) {
+ // Make Zombie reinforcements fuck off.
Utils.registerEvent(new ZombieBackupSpawnEventHandler());
}
@@ -152,55 +144,48 @@ public class CommonProxy {
* End of Subscribe Event registration.
*/
- //Compat Handling
+ // Compat Handling
COMPAT_HANDLER.registerMyModsOreDictEntries();
COMPAT_HANDLER.intermodOreDictionarySupport();
COMPAT_IntermodStaging.init();
-
- //Internal GT Proxy
- GtProxy.init();
}
public void postInit(final FMLPostInitializationEvent e) {
Logger.INFO("Cleaning up, doing postInit.");
PlayerCache.initCache();
- //Make Burnables burnable
- if (!CORE.burnables.isEmpty()){
+ // Make Burnables burnable
+ if (!CORE.burnables.isEmpty()) {
BurnableFuelHandler fuelHandler = new BurnableFuelHandler();
GameRegistry.registerFuelHandler(fuelHandler);
- Logger.INFO("[Fuel Handler] Registering "+fuelHandler.getClass().getName());
+ Logger.INFO("[Fuel Handler] Registering " + fuelHandler.getClass().getName());
}
- //Compat Handling
+ // Compat Handling
COMPAT_HANDLER.RemoveRecipesFromOtherMods();
COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
COMPAT_IntermodStaging.postInit();
COMPAT_HANDLER.runQueuedRecipes();
- //Internal GT Proxy
- GtProxy.postInit();
}
-
- public void serverStarting(final FMLServerStartingEvent e)
- {
+ public void serverStarting(final FMLServerStartingEvent e) {
COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes();
}
-
+
public void onLoadComplete(FMLLoadCompleteEvent event) {
COMPAT_IntermodStaging.onLoadComplete(event);
}
- public void registerNetworkStuff(){
+ public void registerNetworkStuff() {
GuiHandler.init();
}
- public void registerEntities(){
+ public void registerEntities() {
InternalEntityRegistry.registerEntities();
}
- public void registerTileEntities(){
+ public void registerTileEntities() {
ModTileEntities.init();
}
@@ -213,11 +198,11 @@ public class CommonProxy {
}
public void generateMysteriousParticles(final Entity entity) {
-
+
}
-
+
public void generateMobSpawners() {
- //Try register some test spawners
+ // Try register some test spawners
Utils.createNewMobSpawner(0, EntityGiantChickenBase.class);
Utils.createNewMobSpawner(1, EntitySickBlaze.class);
Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class);