diff options
Diffstat (limited to 'src/main/java/gtPlusPlus')
24 files changed, 44 insertions, 1646 deletions
diff --git a/src/main/java/gtPlusPlus/api/objects/Logger.java b/src/main/java/gtPlusPlus/api/objects/Logger.java index c97c787cd3..2214e50e78 100644 --- a/src/main/java/gtPlusPlus/api/objects/Logger.java +++ b/src/main/java/gtPlusPlus/api/objects/Logger.java @@ -4,9 +4,9 @@ import org.apache.logging.log4j.LogManager; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.relauncher.FMLRelaunchLog; +import gregtech.asm.GTCorePlugin; import gtPlusPlus.core.config.ASMConfiguration; import gtPlusPlus.core.config.Configuration; -import gtPlusPlus.preloader.PreloaderCore; public class Logger { @@ -37,8 +37,7 @@ public class Logger { // Non-Dev Comments public static void MACHINE_INFO(String s, Object... args) { if (enabled) { - boolean localPlayer = PreloaderCore.DEV_ENVIRONMENT; - if (Configuration.debug.MachineInfo || localPlayer) { + if (Configuration.debug.MachineInfo || GTCorePlugin.isDevEnv()) { final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2); modLogger.info("Machine Info: " + s + " | " + name1, args); } @@ -48,7 +47,7 @@ public class Logger { // Developer Comments public static void WARNING(final String s) { if (enabled) { - if (PreloaderCore.DEBUG_MODE) { + if (ASMConfiguration.debug.debugMode) { modLogger.warn(s); } } @@ -57,7 +56,7 @@ public class Logger { // Errors public static void ERROR(final String s) { if (enabled) { - if (PreloaderCore.DEBUG_MODE) { + if (ASMConfiguration.debug.debugMode) { modLogger.fatal(s); } } @@ -95,7 +94,7 @@ public class Logger { */ public static void DEBUG_BEES(final String s) { if (enabled) { - if (PreloaderCore.DEV_ENVIRONMENT || PreloaderCore.DEBUG_MODE) { + if (GTCorePlugin.isDevEnv() || ASMConfiguration.debug.debugMode) { modLogger.info("[Debug][Bees] " + s); } } @@ -106,7 +105,7 @@ public class Logger { */ public static void MATERIALS(final String s) { if (enabled) { - if (PreloaderCore.DEV_ENVIRONMENT || PreloaderCore.DEBUG_MODE) { + if (GTCorePlugin.isDevEnv() || ASMConfiguration.debug.debugMode) { modLogger.info("[Materials] " + s); } } @@ -117,7 +116,7 @@ public class Logger { */ public static void DEBUG_MATERIALS(final String s) { if (enabled) { - if (PreloaderCore.DEV_ENVIRONMENT || PreloaderCore.DEBUG_MODE) { + if (GTCorePlugin.isDevEnv() || ASMConfiguration.debug.debugMode) { modLogger.info("[Debug][Materials] " + s); } } @@ -128,7 +127,7 @@ public class Logger { */ public static void REFLECTION(final String s) { if (enabled) { - if (PreloaderCore.DEV_ENVIRONMENT || PreloaderCore.DEBUG_MODE) { + if (GTCorePlugin.isDevEnv() || ASMConfiguration.debug.debugMode) { modLogger.info("[Reflection] " + s); } } @@ -139,7 +138,7 @@ public class Logger { */ public static void WORLD(final String s) { if (enabled) { - if (PreloaderCore.DEV_ENVIRONMENT || PreloaderCore.DEBUG_MODE) { + if (GTCorePlugin.isDevEnv() || ASMConfiguration.debug.debugMode) { modLogger.info("[WorldGen] " + s); } } @@ -148,7 +147,7 @@ public class Logger { public static void RECIPE(String string) { if (enabled) { if ( - /* CORE_Preloader.DEV_ENVIRONMENT || */ PreloaderCore.DEBUG_MODE) { + /* GTCorePlugin.isDevEnv() || */ ASMConfiguration.debug.debugMode) { modLogger.info("[Recipe] " + string); } } diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java index 50b4578085..4346fb9e31 100644 --- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java @@ -23,6 +23,7 @@ import galaxyspace.core.entity.mob.EntityEvolvedColdBlaze; import gregtech.api.enums.Mods; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.config.ASMConfiguration; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.entity.InternalEntityRegistry; import gtPlusPlus.core.handler.BookHandler; @@ -41,7 +42,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.tileentities.ModTileEntities; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.preloader.PreloaderCore; import gtPlusPlus.xmod.ic2.CustomInternalName; public class CommonProxy { @@ -53,7 +53,7 @@ public class CommonProxy { public void preInit(final FMLPreInitializationEvent e) { Logger.INFO("Doing some house cleaning."); - if (PreloaderCore.DEBUG_MODE) { + if (ASMConfiguration.debug.debugMode) { Logger.INFO("Development mode enabled."); } else { Logger.WARNING("Development mode not enabled."); diff --git a/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java b/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java index d79a746642..a348998ef0 100644 --- a/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java +++ b/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java @@ -25,25 +25,16 @@ public class ASMConfiguration { @Config.DefaultBoolean(false) public boolean debugMode; - @Config.Comment("Enable/Disable COFH OreDictionaryArbiter Patch (Useful for Development)") - @Config.DefaultBoolean(true) - public boolean enableCofhPatch; - - @Config.Comment("Enable/Disable Forge OreDictionary Patch (Useful for Development)") - @Config.DefaultBoolean(false) - public boolean enableOreDictPatch; } @Config.Comment("General section") public static class General { // General Features - @Config.Comment("Prevents the game crashing from having invalid keybinds. https://github.com/alkcorp/GTplusplus/issues/544") - @Config.DefaultBoolean(true) - public boolean enabledLwjglKeybindingFix; + @Config.Comment("Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s.") + @Config.DefaultInt(0) + @Config.RangeInt(min = 0, max = Short.MAX_VALUE) + public int enableWatchdogBGM; - @Config.Comment("Fixes small oversights in Thaumcraft 4.") - @Config.DefaultBoolean(true) - public boolean enableTcAspectSafety; } } diff --git a/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java b/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java index 8f549364c1..7976cf0bf6 100644 --- a/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java +++ b/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java @@ -5,9 +5,9 @@ import java.lang.reflect.Field; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiTextField; +import gregtech.asm.GTCorePlugin; import gtPlusPlus.core.gui.machine.GUIVolumetricFlaskSetter; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.preloader.PreloaderCore; public class GuiValueField extends GuiTextField { @@ -36,9 +36,9 @@ public class GuiValueField extends GuiTextField { public int getLineScrollOffset() { Field lineScrollOffset = ReflectionUtils - .getField(GuiTextField.class, !PreloaderCore.DEV_ENVIRONMENT ? "field_146225_q" : "lineScrollOffset"); + .getField(GuiTextField.class, GTCorePlugin.isDevEnv() ? "lineScrollOffset" : "field_146225_q"); if (lineScrollOffset != null) { - return (int) ReflectionUtils.getFieldValue(lineScrollOffset, this); + return ReflectionUtils.getFieldValue(lineScrollOffset, this); } return 0; } diff --git a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java index 89ddb241ed..c24587fb06 100644 --- a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java +++ b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java @@ -16,9 +16,9 @@ import net.minecraft.world.World; import baubles.api.BaubleType; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.asm.GTCorePlugin; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.preloader.PreloaderCore; public class FireProtectionBauble extends BaseBauble { @@ -26,7 +26,7 @@ public class FireProtectionBauble extends BaseBauble { static { isImmuneToFire = ReflectionUtils - .getField(Entity.class, !PreloaderCore.DEV_ENVIRONMENT ? "func_70045_F" : "isImmuneToFire"); + .getField(Entity.class, !GTCorePlugin.isDevEnv() ? "func_70045_F" : "isImmuneToFire"); } public static boolean fireImmune(Entity aEntity) { diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java index c64686a151..7b66ffefa1 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -36,6 +36,7 @@ import gregtech.api.util.GTUtility; import gregtech.common.items.MetaGeneratedTool01; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; +import gtPlusPlus.core.config.ASMConfiguration; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique; import gtPlusPlus.core.item.chemistry.AgriculturalChem; @@ -45,7 +46,6 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.preloader.PreloaderCore; import gtPlusPlus.xmod.gregtech.api.items.GTMetaTool; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import gtPlusPlus.xmod.gregtech.loaders.RecipeGenDustGeneration; @@ -306,7 +306,7 @@ public class ItemUtils { } public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, final int amount) { - if (PreloaderCore.DEBUG_MODE) { + if (ASMConfiguration.debug.debugMode) { Logger.modLogger.warn("Looking up: " + oredictName + " - from : ", new Exception()); } diff --git a/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java b/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java index 01e5a087c1..d2052afb55 100644 --- a/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java +++ b/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java @@ -18,6 +18,7 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Mods; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.config.ASMConfiguration; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.lib.GTPPCore.Everglades; import gtPlusPlus.core.material.MaterialGenerator; @@ -28,7 +29,6 @@ import gtPlusPlus.everglades.dimension.DimensionEverglades; import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Base; import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Ore_Layer; import gtPlusPlus.everglades.gen.gt.WorldGen_Ores; -import gtPlusPlus.preloader.PreloaderCore; @Mod( modid = Mods.Names.G_T_PLUS_PLUS_EVERGLADES, @@ -134,7 +134,7 @@ public class GTPPEverglades implements ActionListener { WorldGen_GT_Base.oreveinPercentage = 64; WorldGen_GT_Base.oreveinAttempts = 16; WorldGen_GT_Base.oreveinMaxPlacementAttempts = 4; - if (PreloaderCore.DEBUG_MODE || GTPPCore.DEVENV) { + if (ASMConfiguration.debug.debugMode || GTPPCore.DEVENV) { WorldGen_GT_Base.debugWorldGen = true; } DarkWorldContentLoader.run(); diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java index edd41535e7..386fac65ee 100644 --- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java +++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java @@ -4,10 +4,10 @@ import java.util.Timer; import java.util.TimerTask; import gtPlusPlus.api.interfaces.IPlugin; +import gtPlusPlus.core.config.ASMConfiguration; import gtPlusPlus.core.util.Utils; import gtPlusPlus.plugin.fixes.interfaces.IBugFix; import gtPlusPlus.plugin.fixes.vanilla.music.MusicTocker; -import gtPlusPlus.preloader.PreloaderCore; public class VanillaBackgroundMusicFix implements IBugFix { @@ -17,11 +17,11 @@ public class VanillaBackgroundMusicFix implements IBugFix { public VanillaBackgroundMusicFix(IPlugin minstance) { mParent = minstance; - if (PreloaderCore.enableWatchdogBGM > 0 && Utils.isClient()) { + if (ASMConfiguration.general.enableWatchdogBGM > 0 && Utils.isClient()) { mParent.log("[BGM] Registering BGM delay Fix."); enabled = true; mFixInstance = new MusicTocker(mParent); - } else if (PreloaderCore.enableWatchdogBGM > 0 && Utils.isServer()) { + } else if (ASMConfiguration.general.enableWatchdogBGM > 0 && Utils.isServer()) { mParent.log("[BGM] Tried registering BGM delay Fix on Server, disabling."); enabled = false; } else { @@ -36,7 +36,7 @@ public class VanillaBackgroundMusicFix implements IBugFix { } public void manage() { - if (PreloaderCore.enableWatchdogBGM > 0 && Utils.isClient()) { + if (ASMConfiguration.general.enableWatchdogBGM > 0 && Utils.isClient()) { TimerTask task = new ManageTask(this.mFixInstance); Timer timer = new Timer("BGM-WatchDog"); long delay = 1000 * 60; @@ -54,7 +54,7 @@ public class VanillaBackgroundMusicFix implements IBugFix { @Override public void run() { - if (PreloaderCore.enableWatchdogBGM > 0 && Utils.isClient()) { + if (ASMConfiguration.general.enableWatchdogBGM > 0 && Utils.isClient()) { if (!A.mVanillaManager) { A.run(); } diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java index aa81a0378c..8395f7b3f7 100644 --- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java +++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java @@ -9,11 +9,11 @@ import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gregtech.asm.GTCorePlugin; import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.plugin.fixes.interfaces.IBugFix; -import gtPlusPlus.preloader.PreloaderCore; // TODO move this as a mixin in hodgepodge public class VanillaBedHeightFix implements IBugFix { @@ -23,17 +23,12 @@ public class VanillaBedHeightFix implements IBugFix { public VanillaBedHeightFix(IPlugin minstance) { mParent = minstance; - Method m; - if (!PreloaderCore.DEV_ENVIRONMENT) { - m = ReflectionUtils.getMethod(EntityPlayer.class, "func_71018_a", int.class, int.class, int.class); - } else { - m = ReflectionUtils.getMethod( - net.minecraft.entity.player.EntityPlayer.class, - "sleepInBedAt", - int.class, - int.class, - int.class); - } + Method m = ReflectionUtils.getMethod( + EntityPlayer.class, + GTCorePlugin.isDevEnv() ? "sleepInBedAt" : "func_71018_a", + int.class, + int.class, + int.class); if (m != null) { mSleepInBedAt = m; mParent.log("Registering Bed Height Fix."); diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java index b0e0474bdd..46dec56124 100644 --- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java +++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java @@ -14,8 +14,8 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.objects.XSTR; import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.config.ASMConfiguration; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.preloader.PreloaderCore; @SideOnly(Side.CLIENT) public class MusicTocker extends MusicTicker implements Runnable { @@ -37,7 +37,7 @@ public class MusicTocker extends MusicTicker implements Runnable { } private static int getDelay() { - return PreloaderCore.enableWatchdogBGM; + return ASMConfiguration.general.enableWatchdogBGM; } private boolean inject() { diff --git a/src/main/java/gtPlusPlus/preloader/PreloaderCore.java b/src/main/java/gtPlusPlus/preloader/PreloaderCore.java deleted file mode 100644 index cabee48bc9..0000000000 --- a/src/main/java/gtPlusPlus/preloader/PreloaderCore.java +++ /dev/null @@ -1,33 +0,0 @@ -package gtPlusPlus.preloader; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import cpw.mods.fml.common.versioning.ArtifactVersion; - -public class PreloaderCore { - - public static final String NAME = "GT++ Preloader"; - public static final String MODID = "GT++_Preloader"; - public static final String VERSION = "0.5-Beta"; - public static final List<ArtifactVersion> DEPENDENCIES; - public static final String JAVA_VERSION = System.getProperty("java.version"); - - public static File MC_DIR; - public static boolean DEV_ENVIRONMENT = false; - public static boolean DEBUG_MODE = false; - public static boolean enableOldGTcircuits = false; - public static int enableWatchdogBGM = 0; - - public static void setMinecraftDirectory(File aDir) { - MC_DIR = aDir; - } - - static { - ArrayList<ArtifactVersion> deps = new ArrayList<>(); - // deps.add("required-before:gregtech;"); - DEPENDENCIES = Collections.unmodifiableList(deps); - } -} diff --git a/src/main/java/gtPlusPlus/preloader/PreloaderGTOreDict.java b/src/main/java/gtPlusPlus/preloader/PreloaderGTOreDict.java deleted file mode 100644 index 9a84bcb4b4..0000000000 --- a/src/main/java/gtPlusPlus/preloader/PreloaderGTOreDict.java +++ /dev/null @@ -1,97 +0,0 @@ -package gtPlusPlus.preloader; - -import static gregtech.api.enums.Mods.GregTech; - -import net.minecraft.item.ItemStack; - -import org.apache.logging.log4j.Level; - -import cpw.mods.fml.relauncher.FMLRelaunchLog; -import gregtech.common.items.MetaGeneratedItem01; -import gregtech.common.items.MetaGeneratedItem03; -import gtPlusPlus.core.config.Configuration; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class PreloaderGTOreDict { - - public static boolean shouldPreventRegistration(final String string, final ItemStack bannedItem) { - - if (bannedItem == null) { - return false; - } else if (!PreloaderCore.enableOldGTcircuits) { - return false; - } - - try { - if (PreloaderCore.enableOldGTcircuits) { - if ((bannedItem != null) && ItemUtils.getModId(bannedItem) - .toLowerCase() - .equals(GregTech.ID)) { - final int damageValue = bannedItem.getItemDamage() - 32000; - if (bannedItem.getItem() instanceof MetaGeneratedItem01) { // 700-720 - if ((damageValue >= 700) && (damageValue <= 720)) { - return true; - } - } else if (bannedItem.getItem() instanceof MetaGeneratedItem03) { - if ((damageValue == 6) || (damageValue == 7) - || (damageValue == 11) - || (damageValue == 12) - || (damageValue == 14) - || (damageValue == 16) - || (damageValue == 20) - || (damageValue == 21) - || (damageValue == 22)) { - return true; - } else if ((damageValue >= 30) && (damageValue <= 57)) { - return true; - } else if ((damageValue >= 69) && (damageValue <= 73)) { - return true; - } else if ((damageValue >= 78) && (damageValue <= 96)) { - return true; - } - } - } - } - - } catch (final Throwable e) { - if (Configuration.debug.showHiddenNEIItems) { - FMLRelaunchLog.log( - "[GT++ ASM] OreDictTransformer", - Level.INFO, - "A mod tried to register an invalid item with the OreDictionary."); - if (bannedItem != null) { - FMLRelaunchLog.log( - "[GT++ ASM] OreDictTransformer", - Level.INFO, - "Please report this issue to the authors of %s", - ItemUtils.getModId(bannedItem)); - try { - if (bannedItem.getItemDamage() <= Short.MAX_VALUE - 1) { - FMLRelaunchLog.log( - "[GT++ ASM] OreDictTransformer", - Level.INFO, - "Item was not null, but still invalidly registering: %s", - bannedItem.getDisplayName() != null ? bannedItem.getDisplayName() - : "INVALID ITEM FOUND"); - } else { - FMLRelaunchLog.log( - "[GT++ ASM] OreDictTransformer", - Level.INFO, - "Item was not null, but still invalidly registering: %s", - "Found Wildcard item that is being registered too early."); - } - } catch (Exception h) { - h.printStackTrace(); - } - } - } - // FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "%s", e.getMessage()); - } - return false; - } - - // Simplification of Life. - private static boolean isInstanceOf(final Class<?> clazz, final Object obj) { - return clazz.isInstance(obj); - } -} diff --git a/src/main/java/gtPlusPlus/preloader/PreloaderLogger.java b/src/main/java/gtPlusPlus/preloader/PreloaderLogger.java deleted file mode 100644 index e5f193a3fd..0000000000 --- a/src/main/java/gtPlusPlus/preloader/PreloaderLogger.java +++ /dev/null @@ -1,50 +0,0 @@ -package gtPlusPlus.preloader; - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -public class PreloaderLogger { - - private PreloaderLogger() {} - - // Logging Functions - public static final Logger MODLOGGER = LogManager.getLogger("GT++ ASM"); - - public static Logger getLogger() { - return MODLOGGER; - } - - // Non-Dev Comments - - public static void INFO(final String s, final String s2) { - INFO(s); - INFO(s2); - } - - public static void INFO(final String s) { - MODLOGGER.info(s); - } - - // Developer Comments - public static void WARNING(final String s) { - MODLOGGER.warn(s); - } - - // Errors - public static void ERROR(final String s) { - MODLOGGER.fatal(s); - } - - public static void LOG(String string, Level info, String string2) { - if (info.equals(Level.INFO)) { - INFO("[" + string + "] " + string2); - } - if (info.equals(Level.WARN)) { - WARNING("[" + string + "] " + string2); - } - if (info.equals(Level.ERROR)) { - ERROR("[" + string + "] " + string2); - } - } -} diff --git a/src/main/java/gtPlusPlus/preloader/asm/PreloaderDummyContainer.java b/src/main/java/gtPlusPlus/preloader/asm/PreloaderDummyContainer.java deleted file mode 100644 index 8e0684e53f..0000000000 --- a/src/main/java/gtPlusPlus/preloader/asm/PreloaderDummyContainer.java +++ /dev/null @@ -1,70 +0,0 @@ -package gtPlusPlus.preloader.asm; - -import static gregtech.api.enums.Mods.GTPlusPlus; -import static gregtech.api.enums.Mods.GregTech; - -import java.io.File; -import java.util.Collections; - -import net.minecraftforge.common.config.Configuration; - -import com.google.common.eventbus.EventBus; -import com.google.common.eventbus.Subscribe; - -import cpw.mods.fml.common.DummyModContainer; -import cpw.mods.fml.common.LoadController; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import gtPlusPlus.preloader.PreloaderCore; -import gtPlusPlus.preloader.PreloaderLogger; - -public class PreloaderDummyContainer extends DummyModContainer { - - public PreloaderDummyContainer() { - super(new ModMetadata()); - ModMetadata meta = getMetadata(); - meta.modId = PreloaderCore.MODID; - meta.name = PreloaderCore.NAME; - meta.version = PreloaderCore.VERSION; - meta.credits = "Roll Credits ..."; - meta.authorList = Collections.singletonList("Alkalus"); - meta.screenshots = new String[0]; - meta.parent = GTPlusPlus.ID; - } - - @Override - public boolean registerBus(EventBus bus, LoadController controller) { - bus.register(this); - return true; - } - - @Subscribe - public void preInit(FMLPreInitializationEvent event) { - PreloaderLogger.INFO("Loading " + PreloaderCore.MODID + " V" + PreloaderCore.VERSION); - // Handle GT++ Config - handleConfigFile(event); - } - - public static void handleConfigFile(final FMLPreInitializationEvent event) { - final Configuration config = new Configuration( - new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); - config.load(); - - // BGM Watchdog - PreloaderCore.enableWatchdogBGM = config.getInt( - "enableWatchdogBGM", - "features", - 0, - 0, - Short.MAX_VALUE, - "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s."); - - // Circuits - PreloaderCore.enableOldGTcircuits = config.getBoolean( - "enableOldGTcircuits", - GregTech.ID, - false, - "Restores circuits and their recipes from Pre-5.09.28 times."); - } - -} diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java deleted file mode 100644 index 0b41846928..0000000000 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_COFH_OreDictionaryArbiter.java +++ /dev/null @@ -1,187 +0,0 @@ -package gtPlusPlus.preloader.asm.transformers; - -import static org.objectweb.asm.Opcodes.ACC_PUBLIC; -import static org.objectweb.asm.Opcodes.ACC_STATIC; -import static org.objectweb.asm.Opcodes.ALOAD; -import static org.objectweb.asm.Opcodes.ASM5; -import static org.objectweb.asm.Opcodes.INVOKESTATIC; -import static org.objectweb.asm.Opcodes.RETURN; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -import org.apache.logging.log4j.Level; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; - -import com.google.common.base.Strings; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; - -import cofh.core.util.oredict.OreDictionaryArbiter; -import cofh.lib.util.ItemWrapper; -import cpw.mods.fml.relauncher.FMLRelaunchLog; -import gnu.trove.map.TMap; -import gnu.trove.map.hash.THashMap; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class ClassTransformer_COFH_OreDictionaryArbiter { - - // The qualified name of the class we plan to transform. - private static final String className = "cofh.core.util.oredict.OreDictionaryArbiter"; - // cofh/ |
