aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/GTplusplus.java
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-12-20 23:39:49 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-12-20 23:39:49 +1000
commit5715a32d2901922503fd850f3a68503fb77467c3 (patch)
tree7e12520fbc23844e99493d55af4410a785538e35 /src/Java/gtPlusPlus/GTplusplus.java
parent2a4795f65d98ff60a177d7d6a5552fd687d9f6e8 (diff)
downloadGT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.gz
GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.bz2
GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.zip
- Disabled some logging.
% Minor Project Clean-up, added missing Override annotations to 100+ methods & removed pointless casts. % Moved Logging to it's own class. $ Fixed Multi-block handling of Pollution. $ Fixed the GT 5.09 material enabler system. (From My Side, it's still borked on GTs). + Added a Dynamic Proxy invocation for IMaterialHandler. + Added an AutoMap data type, which is a Auto-incremental ID'd Hashmap wrapper.
Diffstat (limited to 'src/Java/gtPlusPlus/GTplusplus.java')
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java76
1 files changed, 42 insertions, 34 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index 22727fa130..6480a764a6 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -1,6 +1,5 @@
package gtPlusPlus;
-import static gtPlusPlus.core.lib.CORE.DEBUG;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustomCapes;
import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableUpdateChecker;
@@ -18,9 +17,9 @@ import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
import gtPlusPlus.api.analytics.SegmentAnalytics;
import gtPlusPlus.api.analytics.SegmentHelper;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.commands.CommandMath;
import gtPlusPlus.core.common.CommonProxy;
@@ -39,6 +38,7 @@ import gtPlusPlus.core.util.player.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
+import gtPlusPlus.xmod.gregtech.loaders.GT_Material_Loader;
import net.minecraft.item.Item;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.oredict.OreDictionary;
@@ -50,9 +50,12 @@ public class GTplusplus implements ActionListener {
//Mod Instance
@Mod.Instance(CORE.MODID)
public static GTplusplus instance;
+
+ //Material Loader
+ public static GT_Material_Loader mGregMatLoader;
//GT_Proxy instance
- protected static Meta_GT_Proxy gregtechproxy;
+ protected static Meta_GT_Proxy mGregProxy;
//GT++ Proxy Instances
@SidedProxy(clientSide = "gtPlusPlus.core.proxy.ClientProxy", serverSide = "gtPlusPlus.core.proxy.ServerProxy")
@@ -61,18 +64,18 @@ public class GTplusplus implements ActionListener {
// Loads Textures
@SideOnly(value = Side.CLIENT)
public static void loadTextures() {
- Utils.LOG_INFO("Loading some textures on the client.");
+ Logger.INFO("Loading some textures on the client.");
// Tools
- Utils.LOG_WARNING("Processing texture: " + TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile().getResourcePath());
+ Logger.WARNING("Processing texture: " + TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile().getResourcePath());
// Blocks
- Utils.LOG_WARNING("Processing texture: " + TexturesGtBlock.Casing_Machine_Dimensional.getTextureFile().getResourcePath());
+ Logger.WARNING("Processing texture: " + TexturesGtBlock.Casing_Machine_Dimensional.getTextureFile().getResourcePath());
}
// Pre-Init
@Mod.EventHandler
public void preInit(final FMLPreInitializationEvent event) {
- Utils.LOG_INFO("Loading " + CORE.name + " V" + CORE.VERSION);
+ Logger.INFO("Loading " + CORE.name + " V" + CORE.VERSION);
if(!Utils.isServer()){
@@ -82,6 +85,7 @@ public class GTplusplus implements ActionListener {
//Give this a go mate.
initAnalytics();
setupMaterialBlacklist();
+ setupMaterialWhitelist();
//HTTP Requests
CORE.MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase();
@@ -93,13 +97,13 @@ public class GTplusplus implements ActionListener {
//Check for Dev
CORE.DEVENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
if (enableUpdateChecker){
- Utils.LOG_INFO("Latest is " + CORE.MASTER_VERSION + ". Updated? " + Utils.isModUpToDate());
+ Logger.INFO("Latest is " + CORE.MASTER_VERSION + ". Updated? " + Utils.isModUpToDate());
}
//Utils.LOG_INFO("User's Country: " + CORE.USER_COUNTRY);
// FirstCall();
Utils.registerEvent(new LoginEventHandler());
- Utils.LOG_INFO("Login Handler Initialized");
+ Logger.INFO("Login Handler Initialized");
@@ -113,7 +117,7 @@ public class GTplusplus implements ActionListener {
proxy.registerNetworkStuff();
//Set Variables for Fluorite Block handling
- Utils.LOG_INFO("Setting some Variables for the block break event handler.");
+ Logger.INFO("Setting some Variables for the block break event handler.");
BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone");
BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone");
BlockEventHandler.fluoriteOre = ItemUtils.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockOreFluorite));
@@ -124,19 +128,12 @@ public class GTplusplus implements ActionListener {
@Mod.EventHandler
public void postInit(final FMLPostInitializationEvent event) {
proxy.postInit(event);
-
- if (DEBUG) {
- this.dumpGtRecipeMap(Gregtech_Recipe_Map.sChemicalDehydratorRecipes);
- this.dumpGtRecipeMap(Gregtech_Recipe_Map.sCokeOvenRecipes);
- this.dumpGtRecipeMap(Gregtech_Recipe_Map.sMatterFab2Recipes);
- this.dumpGtRecipeMap(Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes);
- }
BookHandler.runLater();
- Utils.LOG_INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- Utils.LOG_INFO("| Recipes succesfully Loaded: " + RegistrationHandler.recipesSuccess + " | Failed: "
+ Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+ Logger.INFO("| Recipes succesfully Loaded: " + RegistrationHandler.recipesSuccess + " | Failed: "
+ RegistrationHandler.recipesFailed + " |");
- Utils.LOG_INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- Utils.LOG_INFO("Finally, we are finished. Have some cripsy bacon as a reward.");
+ Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+ Logger.INFO("Finally, we are finished. Have some cripsy bacon as a reward.");
}
@EventHandler
@@ -153,11 +150,9 @@ public class GTplusplus implements ActionListener {
public void serverStopping(final FMLServerStoppingEvent event) {
//Flush all data to Server at the end of the day.
if (SegmentAnalytics.sAnalyticsMasterList.size() > 0){
- int i=0;
for (SegmentAnalytics sa : SegmentAnalytics.sAnalyticsMasterList.values()){
sa.flushDataFinal();
SegmentAnalytics.LOG("Cleaned up Analytics Data for player "+sa.mLocalName+".");
- i++;
}
}
@@ -170,16 +165,16 @@ public class GTplusplus implements ActionListener {
protected void dumpGtRecipeMap(final GT_Recipe_Map r) {
final Collection<GT_Recipe> x = r.mRecipeList;
- Utils.LOG_INFO("Dumping " + r.mUnlocalizedName + " Recipes for Debug.");
+ Logger.INFO("Dumping " + r.mUnlocalizedName + " Recipes for Debug.");
for (final GT_Recipe newBo : x) {
- Utils.LOG_INFO("========================");
- Utils.LOG_INFO("Dumping Input: " + ItemUtils.getArrayStackNames(newBo.mInputs));
- Utils.LOG_INFO("Dumping Inputs " + ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs));
- Utils.LOG_INFO("Dumping Duration: " + newBo.mDuration);
- Utils.LOG_INFO("Dumping EU/t: " + newBo.mEUt);
- Utils.LOG_INFO("Dumping Output: " + ItemUtils.getArrayStackNames(newBo.mOutputs));
- Utils.LOG_INFO("Dumping Output: " + ItemUtils.getFluidArrayStackNames(newBo.mFluidOutputs));
- Utils.LOG_INFO("========================");
+ Logger.INFO("========================");
+ Logger.INFO("Dumping Input: " + ItemUtils.getArrayStackNames(newBo.mInputs));
+ Logger.INFO("Dumping Inputs " + ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs));
+ Logger.INFO("Dumping Duration: " + newBo.mDuration);
+ Logger.INFO("Dumping EU/t: " + newBo.mEUt);
+ Logger.INFO("Dumping Output: " + ItemUtils.getArrayStackNames(newBo.mOutputs));
+ Logger.INFO("Dumping Output: " + ItemUtils.getFluidArrayStackNames(newBo.mFluidOutputs));
+ Logger.INFO("========================");
}
}
@@ -188,8 +183,7 @@ public class GTplusplus implements ActionListener {
SegmentAnalytics.isEnabled = CORE.ConfigSwitches.enableUpdateChecker;
if (!Utils.isServer() && PlayerUtils.isPlayerAlkalus()){
SegmentAnalytics.isEnabled = true;
- }
-
+ }
new SegmentHelper();
}
@@ -222,4 +216,18 @@ public class GTplusplus implements ActionListener {
return false;
}
+
+ private void setupMaterialWhitelist() {
+
+ mGregMatLoader = new GT_Material_Loader();
+
+ //Non GTNH Materials
+ if (!CORE.GTNH){
+ //Mithril - Random Dungeon Loot
+ mGregMatLoader.enableMaterial(Materials.Mithril);
+ }
+
+ //Force - Alloying
+ mGregMatLoader.enableMaterial(Materials.Force);
+ }
} \ No newline at end of file