aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus')
-rw-r--r--src/main/java/gtPlusPlus/GTplusplus.java64
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IPlugin.java41
-rw-r--r--src/main/java/gtPlusPlus/api/objects/Logger.java5
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java15
-rw-r--r--src/main/java/gtPlusPlus/core/config/ASMConfiguration.java11
-rw-r--r--src/main/java/gtPlusPlus/core/handler/PacketHandler.java11
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java4
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java396
-rw-r--r--src/main/java/gtPlusPlus/everglades/GTPPEverglades.java11
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/AgrichemCore.java56
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java2
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java2
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java8
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java15
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java4
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java6
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java64
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java35
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaFixesCore.java101
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java131
-rw-r--r--src/main/java/gtPlusPlus/plugin/manager/CoreManager.java95
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java42
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java25
23 files changed, 92 insertions, 1052 deletions
diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java
index 893446ea72..5de4fef23b 100644
--- a/src/main/java/gtPlusPlus/GTplusplus.java
+++ b/src/main/java/gtPlusPlus/GTplusplus.java
@@ -4,12 +4,13 @@ import static gregtech.api.enums.Mods.GTPlusPlus;
import static gregtech.api.enums.Mods.Names;
import static gregtech.api.enums.Mods.Thaumcraft;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.util.HashMap;
import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.launchwrapper.Launch;
import com.gtnewhorizon.gtnhlib.config.ConfigException;
@@ -25,7 +26,6 @@ import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
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.event.FMLServerStoppingEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -44,7 +44,9 @@ import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
import gtPlusPlus.core.lib.GTPPCore;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.data.LocaleUtils;
-import gtPlusPlus.plugin.manager.CoreManager;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
+import gtPlusPlus.plugin.fixes.vanilla.VanillaBedHeightFix;
import gtPlusPlus.xmod.gregtech.common.MetaGTProxy;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
@@ -76,7 +78,7 @@ import gtPlusPlus.xmod.thaumcraft.commands.CommandDumpAspects;
+ " after:TGregworks;"
+ " after:StevesCarts;"
+ " required-after:gtnhlib@[0.0.10,);")
-public class GTplusplus implements ActionListener {
+public class GTplusplus {
public enum INIT_PHASE {
@@ -149,8 +151,6 @@ public class GTplusplus implements ActionListener {
@EventHandler
public void preInit(final FMLPreInitializationEvent event) {
INIT_PHASE.PRE_INIT.setPhaseActive(true);
- // Load all class objects within the plugin package.
- CoreManager.veryEarlyInit();
PacketHandler.init();
// Give this a go mate.
@@ -162,7 +162,9 @@ public class GTplusplus implements ActionListener {
proxy.preInit(event);
Logger.INFO("Setting up our own GTProxy.");
MetaGTProxy.preInit();
- CoreManager.preInit();
+ AgrichemFluids.preInit();
+ fixVanillaOreDict();
+ new VanillaBedHeightFix();
}
@EventHandler
@@ -171,7 +173,6 @@ public class GTplusplus implements ActionListener {
proxy.init(event);
proxy.registerNetworkStuff();
MetaGTProxy.init();
- CoreManager.init();
// Used by foreign players to generate .lang files for translation.
if (Configuration.debug.dumpItemAndBlockData) {
LocaleUtils.generateFakeLocaleFile();
@@ -184,7 +185,6 @@ public class GTplusplus implements ActionListener {
proxy.postInit(event);
BookHandler.runLater();
MetaGTProxy.postInit();
- CoreManager.postInit();
Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
Logger.INFO(
@@ -218,18 +218,9 @@ public class GTplusplus implements ActionListener {
if (Thaumcraft.isModLoaded()) {
event.registerServerCommand(new CommandDumpAspects());
}
- CoreManager.serverStart();
INIT_PHASE.STARTED.setPhaseActive(true);
}
- @EventHandler
- public synchronized void serverStopping(final FMLServerStoppingEvent event) {
- CoreManager.serverStop();
- }
-
- @Override
- public void actionPerformed(final ActionEvent arg0) {}
-
/**
* This {@link EventHandler} is called after the {@link FMLPostInitializationEvent} stages of all loaded mods
* executes successfully. {@link #onLoadComplete(FMLLoadCompleteEvent)} exists to inject recipe generation after
@@ -383,4 +374,39 @@ public class GTplusplus implements ActionListener {
mapping.remap(block);
Logger.INFO("Remapping block " + mapping.name + " to " + GTPlusPlus.ID + ":" + block.getUnlocalizedName());
}
+
+ private static void fixVanillaOreDict() {
+ registerToOreDict(ItemUtils.getSimpleStack(Items.blaze_rod), "rodBlaze");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.nether_wart), "cropNetherWart");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.reeds), "sugarcane");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.paper), "paper");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.ender_pearl), "enderpearl");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.bone), "bone");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.gunpowder), "gunpowder");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.string), "string");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.nether_star), "netherStar");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.leather), "leather");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.feather), "feather");
+ registerToOreDict(ItemUtils.getSimpleStack(Items.egg), "egg");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.end_stone), "endstone");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.vine), "vine");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.cactus), "blockCactus");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.grass), "grass");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.obsidian), "obsidian");
+ registerToOreDict(ItemUtils.getSimpleStack(Blocks.crafting_table), "workbench");
+ }
+
+ private static void registerToOreDict(ItemStack aStack, String aString) {
+ if (aStack.getItem() == Items.blaze_rod) {
+ Logger
+ .INFO("Registering " + aStack.getDisplayName() + " to OreDictionary under the tag '" + aString + "'.");
+ } else {
+ Logger.INFO(
+ "Registering " + aStack.getDisplayName()
+ + " to OreDictionary under the tag '"
+ + aString
+ + "'. (Added to Forge in 1.8.9)");
+ }
+ ItemUtils.addItemToOreDictionary(aStack, aString);
+ }
}
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java b/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java
deleted file mode 100644
index d70a19925e..0000000000
--- a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package gtPlusPlus.api.interfaces;
-
-import gtPlusPlus.api.objects.Logger;
-
-public interface IPlugin {
-
- /**
- * @return A {@link String} object which returns the {@link IPlugin}'s name.
- */
- public String getPluginName();
-
- /**
- * @return A {@link String} object which returns the {@link IPlugin}'s short name. This String should only contain 4
- * Characters.
- */
- public String getPluginAbbreviation();
-
- /**
- * @param message - A {@link String} object which holds a message to be logged to console.
- */
- default void log(String message) {
- Logger.INFO("[" + getPluginAbbreviation() + "] " + message);
- }
-
- /**
- * @param message - A {@link String} object which holds a warning/error message to be logged to console.
- */
- default void logDebug(String message) {
- Logger.WARNING("[" + getPluginAbbreviation() + "] " + message);
- }
-
- public boolean preInit();
-
- public boolean init();
-
- public boolean postInit();
-
- public boolean serverStart();
-
- public boolean serverStop();
-}
diff --git a/src/main/java/gtPlusPlus/api/objects/Logger.java b/src/main/java/gtPlusPlus/api/objects/Logger.java
index 2214e50e78..6650668894 100644
--- a/src/main/java/gtPlusPlus/api/objects/Logger.java
+++ b/src/main/java/gtPlusPlus/api/objects/Logger.java
@@ -23,7 +23,7 @@ public class Logger {
private static final boolean enabled = !ASMConfiguration.debug.disableAllLogging;
- public static final org.apache.logging.log4j.Logger getLogger() {
+ public static org.apache.logging.log4j.Logger getLogger() {
return modLogger;
}
@@ -38,8 +38,7 @@ public class Logger {
public static void MACHINE_INFO(String s, Object... args) {
if (enabled) {
if (Configuration.debug.MachineInfo || GTCorePlugin.isDevEnv()) {
- final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2);
- modLogger.info("Machine Info: " + s + " | " + name1, args);
+ modLogger.info("Machine Info: " + s + " ", args);
}
}
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
index 6852c93f05..867f247b6e 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
@@ -6,7 +6,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
-import gregtech.api.interfaces.IRecipeMutableAccess;
+import gregtech.mixin.interfaces.accessors.IRecipeMutableAccess;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -25,14 +25,11 @@ public class ShapedRecipe implements IRecipeMutableAccess {
}
public ShapedRecipe(Object[] aInputs, ItemStack aOutput) {
- String aGridWhole = "";
- String aGrid[] = new String[3];
+ StringBuilder aGridWhole = new StringBuilder();
+ String[] aGrid = new String[3];
char[] aChar = new char[9];
String[] aLoggingInfo = new String[9];
-
- if (mBlackList == null) {
- mBlackList = new ItemStack[] {};
- }
+ mBlackList = new ItemStack[] {};
// Just to be safe
try {
@@ -68,7 +65,7 @@ public class ShapedRecipe implements IRecipeMutableAccess {
Object[] mVarags2 = null;
Logger.RECIPE("Generating Shaped Crafting Recipe for " + aOutput.getDisplayName());
- if (aInputs.length < 9 || aInputs.length > 9) {
+ if (aInputs.length != 9) {
Logger.RECIPE(
"[Fix] Recipe for " + aOutput.getDisplayName()
+ " has incorrect number of inputs. Size: "
@@ -118,7 +115,7 @@ public class ShapedRecipe implements IRecipeMutableAccess {
for (Pair<Character, Object> h : aRecipePairs) {
if (h.getKey() != null) {
- aGridWhole += String.valueOf(h.getKey());
+ aGridWhole.append(String.valueOf(h.getKey()));
Logger.RECIPE("Adding '" + String.valueOf(h.getKey()) + "' to aGridWhole.");
}
}
diff --git a/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java b/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java
index a348998ef0..63d65b32c9 100644
--- a/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java
+++ b/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java
@@ -11,7 +11,6 @@ import gregtech.api.enums.Mods;
public class ASMConfiguration {
public static Debug debug = new Debug();
- public static General general = new General();
// Debug
@Config.Comment("Debug section")
@@ -27,14 +26,4 @@ public class ASMConfiguration {
}
- @Config.Comment("General section")
- public static class General {
- // General Features
-
- @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;
-
- }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
index 9c5d6b25d2..504afc55d8 100644
--- a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
@@ -9,12 +9,9 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.network.handler.AbstractClientMessageHandler;
-import gtPlusPlus.core.network.packet.AbstractPacket;
import gtPlusPlus.core.network.packet.PacketVolumetricFlaskGui;
import gtPlusPlus.core.network.packet.PacketVolumetricFlaskGui2;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
public class PacketHandler {
@@ -37,14 +34,6 @@ public class PacketHandler {
private static void registerMessage(Class handlerClass, Class messageClass, Side side) {
INSTANCE.registerMessage(handlerClass, messageClass, packetId++, side);
- if (AbstractPacket.class.isInstance(messageClass.getClass())) {
- AbstractPacket aPacket = ReflectionUtils.createNewInstanceFromConstructor(
- ReflectionUtils.getConstructor(messageClass, new Class[] {}),
- new Object[] {});
- if (aPacket != null) {
- Logger.INFO("Registered Packet: " + aPacket.getPacketName());
- }
- }
}
/**
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
index 33649b4ff2..41755d6abc 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
@@ -11,7 +11,7 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gregtech.mixin.interfaces.PotionExt;
+import gregtech.mixin.interfaces.accessors.PotionAccessor;
import gtPlusPlus.core.util.math.MathUtils;
public class PlayerSleepEventHandler {
@@ -43,7 +43,7 @@ public class PlayerSleepEventHandler {
final List<Integer> potionToRemove = new ArrayList<>();
for (PotionEffect potionEffect : player.getActivePotionEffects()) {
final Potion potion = Potion.potionTypes[potionEffect.getPotionID()];
- if (potion instanceof PotionExt && ((PotionExt) potion).gt5u$isBadEffect()) {
+ if (potion instanceof PotionAccessor && ((PotionAccessor) potion).gt5u$isBadEffect()) {
potionToRemove.add(potion.id);
}
}
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 40b32fed86..5dd9f9f426 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -1,56 +1,19 @@
package gtPlusPlus.core.util.reflect;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.util.LinkedHashMap;
+import java.util.HashMap;
import java.util.Map;
-import org.apache.commons.lang3.ArrayUtils;
-
-import com.google.common.reflect.ClassPath;
import com.gtnewhorizon.gtnhlib.reflect.Fields;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.data.StringUtils;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class ReflectionUtils {
- public static Map<String, CachedMethod> mCachedMethods = new LinkedHashMap<>();
- public static Map<String, CachedField> mCachedFields = new LinkedHashMap<>();
- public static Map<String, CachedConstructor> mCachedConstructors = new LinkedHashMap<>();
- public static Map<Field, Fields.ClassFields.Field> mCachedFieldAccessors = new LinkedHashMap<>();
-
- private static class CachedConstructor {
-
- private final Constructor<?> METHOD;
-
- public CachedConstructor(Constructor<?> aCons) {
- METHOD = aCons;
- }
-
- public Constructor<?> get() {
- return METHOD;
- }
- }
-
- private static class CachedMethod {
-
- private final Method METHOD;
-
- public CachedMethod(Method aMethod, boolean isStatic) {
- METHOD = aMethod;
- }
-
- public Method get() {
- return METHOD;
- }
-
- }
+ public static Map<String, CachedField> mCachedFields = new HashMap<>();
+ public static Map<Field, Fields.ClassFields.Field> mCachedFieldAccessors = new HashMap<>();
private static class CachedField {
@@ -73,22 +36,6 @@ public class ReflectionUtils {
.getUntypedField(Fields.LookupType.DECLARED_IN_HIERARCHY, field.getName()));
}
- private static boolean cacheMethod(Class<?> aClass, Method aMethod) {
- if (aMethod == null) {
- return false;
- }
- boolean isStatic = Modifier.isStatic(aMethod.getModifiers());
- CachedMethod y = mCachedMethods
- .get(aClass.getName() + "." + aMethod.getName() + "." + ArrayUtils.toString(aMethod.getParameterTypes()));
- if (y == null) {
- mCachedMethods.put(
- aClass.getName() + "." + aMethod.getName() + "." + ArrayUtils.toString(aMethod.getParameterTypes()),
- new CachedMethod(aMethod, isStatic));
- return true;
- }
- return false;
- }
-
private static boolean cacheField(Class<?> aClass, Field aField) {
if (aField == null) {
return false;
@@ -102,85 +49,6 @@ public class ReflectionUtils {
return false;
}
- private static void cacheConstructor(Class<?> aClass, Constructor<?> aConstructor) {
- if (aConstructor == null) {
- return;
- }
- mCachedConstructors.computeIfAbsent(
- aClass.getName() + "." + ArrayUtils.toString(aConstructor.getParameterTypes()),
- k -> new CachedConstructor(aConstructor));
- }
-
- /**
- * Returns a cached {@link Constructor} object.
- *
- * @param aClass - Class containing the Constructor.
- * @param aTypes - Varags Class Types for objects constructor.
- * @return - Valid, non-final, {@link Method} object, or {@link null}.
- */
- public static Constructor<?> getConstructor(Class<?> aClass, Class<?>... aTypes) {
- if (aClass == null || aTypes == null) {
- return null;
- }
-
- String aMethodKey = ArrayUtils.toString(aTypes);
- // Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
- CachedConstructor y = mCachedConstructors.get(aClass.getName() + "." + aMethodKey);
- if (y == null) {
- Constructor<?> u = getConstructor_Internal(aClass, aTypes);
- if (u != null) {
- Logger.REFLECTION("Caching Constructor: " + aClass.getName() + "." + aMethodKey);
- cacheConstructor(aClass, u);
- return u;
- } else {
- return null;
- }
- } else {
- return y.get();
- }
- }
-
- /**
- * Returns a cached {@link Method} object. Wraps {@link #getMethod(Class, String, Class...)}.
- *
- * @param aObject - Object containing the Method.
- * @param aMethodName - Method's name in {@link String} form.
- * @param aTypes - Class Array of Types for {@link Method}'s constructor.
- * @return - Valid, non-final, {@link Method} object, or {@link null}.
- */
- public static Method getMethod(Object aObject, String aMethodName, Class[] aTypes) {
- return getMethod(aObject.getClass(), aMethodName, aTypes);
- }
-
- /**
- * Returns a cached {@link Method} object.
- *
- * @param aClass - Class containing the Method.
- * @param aMethodName - Method's name in {@link String} form.
- * @param aTypes - Varags Class Types for {@link Method}'s constructor.
- * @return - Valid, non-final, {@link Method} object, or {@link null}.
- */
- public static Method getMethod(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
- if (aClass == null || aMethodName == null || aMethodName.length() <= 0) {
- return null;
- }
- String aMethodKey = ArrayUtils.toString(aTypes);
- // Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
- CachedMethod y = mCachedMethods.get(aClass.getName() + "." + aMethodName + "." + aMethodKey);
- if (y == null) {
- Method u = getMethod_Internal(aClass, aMethodName, aTypes);
- if (u != null) {
- Logger.REFLECTION("Caching Method: " + aMethodName + "." + aMethodKey);
- cacheMethod(aClass, u);
- return u;
- } else {
- return null;
- }
- } else {
- return y.get();
- }
- }
-
/**
* Returns a cached {@link Field} object.
*
@@ -237,79 +105,6 @@ public class ReflectionUtils {
}
}
- public static void makeMethodAccessible(final Method field) {
- if (!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(
- field.getDeclaringClass()
- .getModifiers())) {
- field.setAccessible(true);
- }
- }
-
- /**
- * Get the method name for a depth in call stack. <br />
- * Utility function
- *
- * @param depth depth in the call stack (0 means current method, 1 means call method, ...)
- * @return Method name
- */
- public static String getMethodName(final int depth) {
- final StackTraceElement[] ste = new Throwable().getStackTrace();
- // System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName());
- if (ste.length < depth) {
- return "No valid stack.";
- }
- return ste[depth + 1].getMethodName();
- }
-
- /**
- *
- * @param aPackageName - The full {@link Package} name in {@link String} form.
- * @return - {@link Boolean} object. True if loaded > 0 classes.
- */
- public static boolean dynamicallyLoadClassesInPackage(String aPackageName) {
- ClassLoader classLoader = ReflectionUtils.class.getClassLoader();
- int loaded = 0;
- try {
- ClassPath path = ClassPath.from(classLoader);
- for (ClassPath.ClassInfo info : path.getTopLevelClassesRecursive(aPackageName)) {
- Class<?> clazz = Class.forName(info.getName(), true, classLoader);
- if (clazz != null) {
- loaded++;
- Logger.INFO("Found " + clazz.getCanonicalName() + ". [" + loaded + "]");
- }
- }
- } catch (ClassNotFoundException | IOException e) {
-
- }
-
- return loaded > 0;
- }
-
- public static boolean setField(final Object object, final String fieldName, final Object fieldValue) {
- Class<?> clazz;
- if (object instanceof Class) {
- clazz = (Class<?>) object;
- } else {
- clazz = object.getClass();
- }
- while (clazz != null) {
- try {
- final Field field = getField(clazz, fieldName);
- if (field != null) {
- setFieldValue_Internal(object, field, fieldValue);
- return true;
- }
- } catch (final NoSuchFieldException e) {
- Logger.REFLECTION("setField(" + object + ", " + fieldName + ") failed.");
- clazz = clazz.getSuperclass();
- } catch (final Exception e) {
- Logger.REFLECTION("setField(" + object + ", " + fieldName + ") failed.");
- throw new IllegalStateException(e);
- }
- }
- return false;
- }
-
public static boolean setField(final Object object, final Field field, final Object fieldValue) {
if (field == null) return false;
Class<?> clazz;
@@ -336,51 +131,6 @@ public class ReflectionUtils {
return false;
}
- /**
- * Allows to change the state of an immutable instance. Huh?!?
- */
- public static void setFinalFieldValue(Class<?> clazz, String fieldName, Object newValue) {
- Field nameField = getField(clazz, fieldName);
- try {
- setFieldValue_Internal(clazz, nameField, newValue);
- } catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- public static void setByte(Object clazz, String fieldName, byte newValue) {
- Field nameField = getField(clazz.getClass(), fieldName);
- cacheAccessor(nameField).setValue(null, newValue);
- }
-
- public static boolean invokeVoid(Object objectInstance, String methodName, Class[] parameters, Object[] values) {
- if (objectInstance == null || methodName == null || parameters == null || values == null) {
- return false;
- }
- Class<?> mLocalClass = (objectInstance instanceof Class ? (Class<?>) objectInstance
- : objectInstance.getClass());
- Logger.REFLECTION(
- "Trying to invoke " + methodName + " on an instance of " + mLocalClass.getCanonicalName() + ".");
- try {
- Method mInvokingMethod = mLocalClass.getDeclaredMethod(methodName, parameters);
- if (mInvokingMethod != null) {
- Logger.REFLECTION(methodName + " was not null.");
- mInvokingMethod.invoke(objectInstance, values);
- Logger.REFLECTION("Successfully invoked " + methodName + ".");
- return true;
- } else {
- Logger.REFLECTION(methodName + " is null.");
- }
- } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- Logger.REFLECTION(
- "Failed to Dynamically invoke " + methodName + " on an object of type: " + mLocalClass.getName());
- }
-
- Logger.REFLECTION("Invoke failed or did something wrong.");
- return false;
- }
-
/*
* Below Code block is used for determining generic types associated with type<E>
*/
@@ -407,108 +157,6 @@ public class ReflectionUtils {
}
}
- private static Method getMethod_Internal(Class<?> aClass, String aMethodName, Class<?>... aTypes) {
- Method m = null;
- try {
- Logger.REFLECTION("Method: Internal Lookup: " + aMethodName);
- m = aClass.getDeclaredMethod(aMethodName, aTypes);
- if (m != null) {
- m.setAccessible(true);
- }
- } catch (Throwable t) {
- Logger.REFLECTION("Method: Internal Lookup Failed: " + aMethodName);
- try {
- m = getMethodRecursively(aClass, aMethodName);
- } catch (NoSuchMethodException e) {
- Logger.REFLECTION("Unable to find method '" + aMethodName + "'");
- e.printStackTrace();
- dumpClassInfo(aClass);
- }
- }
- return m;
- }
-
- private static Constructor<?> getConstructor_Internal(Class<?> aClass, Class<?>... aTypes) {
- Constructor<?> c = null;
- try {
- Logger.REFLECTION("Constructor: Internal Lookup: " + aClass.getName());
- c = aClass.getDeclaredConstructor(aTypes);
- if (c != null) {
- c.setAccessible(true);
- }
- } catch (Throwable t) {
- Logger.REFLECTION("Constructor: Internal Lookup Failed: " + aClass.getName());
- try {
- c = getConstructorRecursively(aClass, aTypes);
- } catch (Exception e) {
- Logger.REFLECTION("Unable to find method '" + aClass.getName() + "'");
- e.printStackTrace();
- dumpClassInfo(aClass);
- }
- }
- return c;
- }
-
- private static Constructor<?> getConstructorRecursively(Class<?> aClass, Class<?>... aTypes) throws Exception {
- try {
- Logger.REFLECTION("Constructor: Recursion Lookup: " + aClass.getName());
- Constructor<?> c = aClass.getConstructor(aTypes);
- if (c != null) {
- c.setAccessible(true);
- }
- return c;
- } catch (final NoSuchMethodException | IllegalArgumentException e) {
- final Class<?> superClass = aClass.getSuperclass();
- if (superClass == null || superClass == Object.class) {
- throw e;
- }
- return getConstructor_Internal(superClass, aTypes);
- }
- }
-
- private static Method getMethodRecursively(final Class<?> clazz, final String aMethodName)
- throws NoSuchMethodException {
- try {
- Logger.REFLECTION("Method: Recursion Lookup: " + aMethodName);
- Method k = clazz.getDeclaredMethod(aMethodName);
- makeMethodAccessible(k);
- return k;
- } catch (final NoSuchMethodException e) {
- final Class<?> superClass = clazz.getSuperclass();
- if (superClass == null || superClass == Object.class) {
- throw e;
- }
- return getMethod_Internal(superClass, aMethodName);
- }
- }
-
- private static void dumpClassInfo(Class<?> aClass) {
- Logger.INFO(
- "We ran into an error processing reflection in " + aClass.getName() + ", dumping all data for debugging.");
- // Get the methods
- Method[] methods = aClass.getDeclaredMethods();
- Field[] fields = aClass.getDeclaredFields();
- Constructor[] consts = aClass.getDeclaredConstructors();
-
- Logger.INFO("Dumping all Methods.");
- for (Method method : methods) {
- System.out
- .println(method.getName() + " | " + StringUtils.getDataStringFromArray(method.getParameterTypes()));
- }
- Logger.INFO("Dumping all Fields.");
- for (Field f : fields) {
- System.out.println(f.getName());
- }
- Logger.INFO("Dumping all Constructors.");
- for (Constructor<?> c : consts) {
- System.out.println(
- c.getName() + " | "
- + c.getParameterCount()
- + " | "
- + StringUtils.getDataStringFromArray(c.getParameterTypes()));
- }
- }
-
/**
*
* Set the value of a field reflectively.
@@ -517,19 +165,6 @@ public class ReflectionUtils {
cacheAccessor(field).setValue(owner, value);
}
- public static boolean doesFieldExist(Class<?> clazz, String string) {
- if (clazz != null) {
- if (ReflectionUtils.getField(clazz, string) != null) {
- return true;
- }
- }
- return false;
- }
-
- public static <T> T getFieldValue(Field field) {
- return getFieldValue(field, null);
- }
-
public static <T> T getFieldValue(Field field, Object instance) {
try {
return (T) field.get(instance);
@@ -537,29 +172,4 @@ public class ReflectionUtils {
return null;
}
- public static <T> T createNewInstanceFromConstructor(Constructor aConstructor, Object[] aArgs) {
- T aInstance;
- try {
- aInstance = (T) aConstructor.newInstance(aArgs);
- return aInstance;
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static Enum getEnum(Class<Enum> sgtbees, String name) {
- if (sgtbees.isEnum()) {
- Object[] aValues = sgtbees.getEnumConstants();
- for (Object o : aValues) {
- if (o.toString()
- .toLowerCase()
- .equals(name.toLowerCase())) {
- return (Enum) o;
- }
- }
- }
- return null;
- }
}
diff --git a/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java b/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java
index d2052afb55..55bb39bd3e 100644
--- a/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java
+++ b/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java
@@ -2,9 +2,6 @@ package gtPlusPlus.everglades;
import static gregtech.api.enums.Mods.GTPlusPlusEverglades;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
import net.minecraft.block.Block;
import net.minecraftforge.common.DimensionManager;
@@ -35,7 +32,7 @@ import gtPlusPlus.everglades.gen.gt.WorldGen_Ores;
name = Everglades.NAME,
version = Everglades.VERSION,
dependencies = "required-after:Forge; after:dreamcraft; after:IC2; required-after:gregtech; required-after:miscutils;")
-public class GTPPEverglades implements ActionListener {
+public class GTPPEverglades {
// Mod Instance
@Mod.Instance(Mods.Names.G_T_PLUS_PLUS_EVERGLADES)
@@ -171,10 +168,4 @@ public class GTPPEverglades implements ActionListener {
public static synchronized void setEvergladesBiome(BiomeEverglades darkWorld_Biome) {
Everglades_Biome = darkWorld_Biome;
}
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/AgrichemCore.java b/src/main/java/gtPlusPlus/plugin/agrichem/AgrichemCore.java
deleted file mode 100644
index 6e5cc47e3a..0000000000
--- a/src/main/java/gtPlusPlus/plugin/agrichem/AgrichemCore.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package gtPlusPlus.plugin.agrichem;
-
-import gtPlusPlus.api.interfaces.IPlugin;
-import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
-import gtPlusPlus.plugin.manager.CoreManager;
-
-// Called by Core_Manager#veryEarlyInit
-@SuppressWarnings("unused")
-public class AgrichemCore implements IPlugin {
-
- static final AgrichemCore mInstance;
-
- static {
- mInstance = new AgrichemCore();
- CoreManager.registerPlugin(mInstance);
- mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
- }
-
- @Override
- public boolean preInit() {
- AgrichemFluids.init();
- return true;
- }
-
- @Override
- public boolean init() {
- mInstance.log("Setting Items");
- return true;
- }
-
- @Override
- public boolean postInit() {
- mInstance.log("Generating Recipes");
- return true;
- }
-
- @Override
- public boolean serverStart() {
- return true;
- }
-
- @Override
- public boolean serverStop() {
- return true;
- }
-
- @Override
- public String getPluginName() {
- return "GT++ Agrichemistry Module";
- }
-
- @Override
- public String getPluginAbbreviation() {
- return "FARM";
- }
-}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java b/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
index bd72654f0a..aa5b22f8fe 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
@@ -22,7 +22,7 @@ public class AgrichemFluids {
public static Fluid mAcetone;
public static Fluid mButanol;
- public static void init() {
+ public static void preInit() {
if (!FluidRegistry.isFluidRegistered("aceticacid")) {
mAceticAcid = FluidUtils
.generateFluidNoPrefix("aceticacid", "Acetic Acid", 200, new short[] { 97, 168, 96, 100 }, true);
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
index b7784580fd..379aed4dcf 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
@@ -23,7 +23,7 @@ import gtPlusPlus.core.util.minecraft.OreDictUtils;
public class ItemAgrichemBase extends Item {
- protected final IIcon base[];
+ protected final IIcon[] base;
/*
* 0 - Algae Biomass 1 - Green Algae Biomass 2 - Brown Algae Biomass 3 - Golden-Brown Algae Biomass 4 - Red Algae
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
index ac38b78936..213ee6b47e 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
@@ -2,7 +2,6 @@ package gtPlusPlus.plugin.agrichem.item.algae;
import static gregtech.api.enums.Mods.GTPlusPlus;
-import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -188,11 +187,9 @@ public class ItemAlgaeBase extends Item implements IAlgalItem {
NBTTagCompound aTag;
if (!aStack.hasTagCompound() || aStack.getTagCompound()
.hasNoTags()) {
- aTag = new NBTTagCompound();
AlgaeGeneticData aGenes;
if (aStack.getItemDamage() < 3 || aStack.getItemDamage() > 5) {
aGenes = new AlgaeGeneticData();
- aTag = aGenes.writeToNBT();
} else {
byte aTemp, aLifespan;
float aFert, aSpeed;
@@ -212,10 +209,9 @@ public class ItemAlgaeBase extends Item implements IAlgalItem {
aFert,
aSpeed,
aLifespan,
- 0,
- new ArrayList<>());
- aTag = aGenes.writeToNBT();
+ 0);
}
+ aTag = aGenes.writeToNBT();
} else {
aTag = aStack.getTagCompound();
}
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
index ef36d73686..462d1271be 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
@@ -1,7 +1,5 @@
package gtPlusPlus.plugin.agrichem.logic;
-import java.util.ArrayList;
-
import net.minecraft.nbt.NBTTagCompound;
public class AlgaeGeneticData {
@@ -24,15 +22,12 @@ public class AlgaeGeneticData {
private final float mProductionSpeed;
- private final ArrayList<AlgaeGrowthRequirement> mSpecialRequirements;
-
public AlgaeGeneticData() {
- this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0, new ArrayList<>());
+ this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0);
}
public AlgaeGeneticData(boolean isDominant, boolean requiresLight, boolean isSalt, boolean isFresh,
- byte aTempTolerance, float aFertility, float aSpeed, byte aLifespan, int aGeneration,
- ArrayList<AlgaeGrowthRequirement> aRequirements) {
+ byte aTempTolerance, float aFertility, float aSpeed, byte aLifespan, int aGeneration) {
mIsDominant = isDominant;
mRequiresLight = requiresLight;
mSaltWater = isSalt;
@@ -42,7 +37,6 @@ public class AlgaeGeneticData {
mProductionSpeed = aSpeed;
mLifespan = aLifespan;
mGeneration = aGeneration;
- mSpecialRequirements = aRequirements;
}
public AlgaeGeneticData(NBTTagCompound aNBT) {
@@ -67,7 +61,6 @@ public class AlgaeGeneticData {
mLifespan = aNBT.getByte("mLifespan");
mGeneration = aNBT.getInteger("mGeneration");
}
- mSpecialRequirements = new ArrayList<>();
}
/**
@@ -109,10 +102,6 @@ public class AlgaeGeneticData {
return this.mGeneration;
}
- public final ArrayList<AlgaeGrowthRequirement> getSpecialRequirements() {
- return this.mSpecialRequirements;
- }
-
public NBTTagCompound writeToNBT() {
NBTTagCompound aGenes = new NBTTagCompound();
aGenes.setBoolean("mIsDominant", this.mIsDominant);
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java
deleted file mode 100644
index 07b89e5b5e..0000000000
--- a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package gtPlusPlus.plugin.agrichem.logic;
-
-public class AlgaeGrowthRequirement {
-}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java b/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java
deleted file mode 100644
index b35ad2c063..0000000000
--- a/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package gtPlusPlus.plugin.fixes.interfaces;
-
-public interface IBugFix {
-
- boolean isFixValid();
-}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java
deleted file mode 100644
index 386fac65ee..0000000000
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package gtPlusPlus.plugin.fixes.vanilla;
-
-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;
-
-public class VanillaBackgroundMusicFix implements IBugFix {
-
- private final IPlugin mParent;
- private final boolean enabled;
- private MusicTocker mFixInstance;
-
- public VanillaBackgroundMusicFix(IPlugin minstance) {
- mParent = minstance;
- if (ASMConfiguration.general.enableWatchdogBGM > 0 && Utils.isClient()) {
- mParent.log("[BGM] Registering BGM delay Fix.");
- enabled = true;
- mFixInstance = new MusicTocker(mParent);
- } else if (ASMConfiguration.general.enableWatchdogBGM > 0 && Utils.isServer()) {
- mParent.log("[BGM] Tried registering BGM delay Fix on Server, disabling.");
- enabled = false;
- } else {
- mParent.log("[BGM] Not registering BGM delay Fix.");
- enabled = false;
- }
- }
-
- @Override
- public boolean isFixValid() {
- return enabled;
- }
-
- public void manage() {
- if (ASMConfiguration.general.enableWatchdogBGM > 0 && Utils.isClient()) {
- TimerTask task = new ManageTask(this.mFixInstance);
- Timer timer = new Timer("BGM-WatchDog");
- long delay = 1000 * 60;
- timer.scheduleAtFixedRate(task, delay, 5000);
- }
- }
-
- private static class ManageTask extends TimerTask {
-
- private final MusicTocker A;
-
- public ManageTask(MusicTocker a) {
- A = a;
- }
-
- @Override
- public void run() {
- 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 8395f7b3f7..0d1151abaa 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
@@ -10,39 +10,31 @@ 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;
// TODO move this as a mixin in hodgepodge
-public class VanillaBedHeightFix implements IBugFix {
+public class VanillaBedHeightFix {
private final Method mSleepInBedAt;
- private final IPlugin mParent;
- public VanillaBedHeightFix(IPlugin minstance) {
- mParent = minstance;
- Method m = ReflectionUtils.getMethod(
- EntityPlayer.class,
- GTCorePlugin.isDevEnv() ? "sleepInBedAt" : "func_71018_a",
- int.class,
- int.class,
- int.class);
+ public VanillaBedHeightFix() {
+ Method m = null;
+ try {
+ m = EntityPlayer.class.getDeclaredMethod(
+ GTCorePlugin.isDevEnv() ? "sleepInBedAt" : "func_71018_a",
+ int.class,
+ int.class,
+ int.class);
+ } catch (NoSuchMethodException ignored) {}
if (m != null) {
mSleepInBedAt = m;
- mParent.log("Registering Bed Height Fix.");
+ Logger.INFO("Registering Bed Height Fix.");
MinecraftForge.EVENT_BUS.register(this);
} else {
mSleepInBedAt = null;
}
}
- @Override
- public boolean isFixValid() {
- return mSleepInBedAt != null;
- }
-
/**
* Fix created by deNULL -
* https://github.com/deNULL/BugPatch/blob/master/src/main/java/ru/denull/BugPatch/mod/ClientEvents.java#L45
@@ -52,7 +44,7 @@ public class VanillaBedHeightFix implements IBugFix {
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void playerSleepInBed(PlayerSleepInBedEvent evt) {
Logger.WARNING("Sleep Event Detected. Player is sleeping at Y: " + evt.y);
- if (evt.y <= 0 && isFixValid()) {
+ if (evt.y <= 0) {
int correctY = 256 + evt.y;
if (correctY <= 0) {
Logger.WARNING(
@@ -73,9 +65,6 @@ public class VanillaBedHeightFix implements IBugFix {
Logger.WARNING("Encountered an error trying to sleep.");
}
}
- } else if (!isFixValid()) {
- Logger.WARNING(
- "Method sleepInBedAt was not found in EntityPlayer (wrong MC and/or Forge version?), unable to fix");
}
}
}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaFixesCore.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaFixesCore.java
deleted file mode 100644
index b6cfb9d3ba..0000000000
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaFixesCore.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package gtPlusPlus.plugin.fixes.vanilla;
-
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.api.interfaces.IPlugin;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.plugin.manager.CoreManager;
-
-// Called by Core_Manager#veryEarlyInit
-@SuppressWarnings("unused")
-public class VanillaFixesCore implements IPlugin {
-
- static final VanillaFixesCore mInstance;
- static final VanillaBedHeightFix mBedFixInstance;
- static final VanillaBackgroundMusicFix mMusicFixInstance;
-
- static {
- mInstance = new VanillaFixesCore();
- mBedFixInstance = new VanillaBedHeightFix(mInstance);
- mMusicFixInstance = new VanillaBackgroundMusicFix(mInstance);
- mInstance.log("Preparing " + mInstance.getPluginName() + " for use.");
- }
-
- VanillaFixesCore() {
- CoreManager.registerPlugin(this);
- }
-
- @Override
- public boolean preInit() {
- return fixVanillaOD();
- }
-
- @Override
- public boolean init() {
- return true;
- }
-
- @Override
- public boolean postInit() {
- return true;
- }
-
- @Override
- public boolean serverStart() {
- mMusicFixInstance.manage();
- return true;
- }
-
- @Override
- public boolean serverStop() {
- return true;
- }
-
- @Override
- public String getPluginName() {
- return "GT++ Vanilla Fixes Module";
- }
-
- @Override
- public String getPluginAbbreviation() {
- return "VFIX";
- }
-
- private boolean fixVanillaOD() {
- registerToOreDict(ItemUtils.getSimpleStack(Items.blaze_rod), "rodBlaze");
- registerToOreDict(ItemUtils.getSimpleStack(Items.nether_wart), "cropNetherWart");
- registerToOreDict(ItemUtils.getSimpleStack(Items.reeds), "sugarcane");
- registerToOreDict(ItemUtils.getSimpleStack(Items.paper), "paper");
- registerToOreDict(ItemUtils.getSimpleStack(Items.ender_pearl), "enderpearl");
- registerToOreDict(ItemUtils.getSimpleStack(Items.bone), "bone");
- registerToOreDict(ItemUtils.getSimpleStack(Items.gunpowder), "gunpowder");
- registerToOreDict(ItemUtils.getSimpleStack(Items.string), "string");
- registerToOreDict(ItemUtils.getSimpleStack(Items.nether_star), "netherStar");
- registerToOreDict(ItemUtils.getSimpleStack(Items.leather), "leather");
- registerToOreDict(ItemUtils.getSimpleStack(Items.feather), "feather");
- registerToOreDict(ItemUtils.getSimpleStack(Items.egg), "egg");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.end_stone), "endstone");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.vine), "vine");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.cactus), "blockCactus");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.grass), "grass");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.obsidian), "obsidian");
- registerToOreDict(ItemUtils.getSimpleStack(Blocks.crafting_table), "workbench");
- return true;
- }
-
- private void registerToOreDict(ItemStack aStack, String aString) {
- if (aStack.getItem() == Items.blaze_rod) {
- mInstance
- .log("Registering " + aStack.getDisplayName() + " to OreDictionary under the tag '" + aString + "'.");
- } else {
- mInstance.log(
- "Registering " + aStack.getDisplayName()
- + " to OreDictionary under the tag '"
- + aString
- + "'. (Added to Forge in 1.8.9)");
- }
- ItemUtils.addItemToOreDictionary(aStack, aString);
- }
-}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
deleted file mode 100644
index 46dec56124..0000000000
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package gtPlusPlus.plugin.fixes.vanilla.music;
-
-import java.lang.reflect.Field;
-import java.util.Random;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.audio.ISound;
-import net.minecraft.client.audio.MusicTicker;
-import net.minecraft.client.audio.PositionedSoundRecord;
-import net.minecraft.util.MathHelper;
-
-import cpw.mods.fml.relauncher.Side;
-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;
-
-@SideOnly(Side.CLIENT)
-public class MusicTocker extends MusicTicker implements Runnable {
-
- private final Random mRandom = new XSTR();
- private final Minecraft mMinecraft;
- private final IPlugin mPlugin;
- private ISound mSound;
- private int mTimeUntilNextTrack = 100;
-
- public boolean mVanillaManager = false;
-
- public MusicTocker(IPlugin aPlugin) {
- super(Minecraft.getMinecraft());
- mPlugin = aPlugin;
- mMinecraft = Minecraft.getMinecraft();
- mPlugin.log("[BGM] Created BGM Watchdog with a delay of " + getDelay() + " ticks.");
- inject();
- }
-
- private static int getDelay() {
- return ASMConfiguration.general.enableWatchdogBGM;
- }
-
- private boolean inject() {
- mPlugin.log("[BGM] Inject new Watchdog into Minecraft instance.");
- ReflectionUtils.setField(Minecraft.getMinecraft(), "mcMusicTicker", this);
- mPlugin.log("[BGM] Verifying...");
- Field f = ReflectionUtils.getField(Minecraft.class, "mcMusicTicker");
- try {
- Object m = f.get(mMinecraft);
- if (m != null) {
- if (m instanceof MusicTocker || m.getClass()
- .isAssignableFrom(getClass())) {
- mPlugin.log("[BGM] Success.");
- return true;
- } else if (m instanceof MusicTicker || m.getClass()
- .isAssignableFrom(MusicTicker.class)) {
- mPlugin.log("[BGM] Found Vanilla MusicTicker, but may be instance of MusicTocker.");
- return true;
- }
- }
- } catch (IllegalArgumentException | IllegalAccessException e) {}
-
- mPlugin.log("[BGM] Failed.");
- return false;
- }
-
- private void updateInternalNumber() {
- if (ReflectionUtils.doesFieldExist(getClass(), "field_147676_d")) {
- ReflectionUtils.setField(this, "field_147676_d", mTimeUntilNextTrack);
- }
- }
-
- private void updateInternalSound(ISound aSound) {
- if (ReflectionUtils.doesFieldExist(getClass(), "field_147678_c")) {
- ReflectionUtils.setField(this, "field_147678_c", aSound);
- }
- }
-
- /**
- * Updates the JList with a new model.
- */
- @Override
- public void update() {
- run();
- mVanillaManager = true;
- }
-
- @Override
- public void run() {
- MusicType musictype = this.mMinecraft.func_147109_W();
-
- if (this.mSound != null) {
- if (!musictype.getMusicTickerLocation()
- .equals(this.mSound.getPositionedSoundLocation())) {
- this.mMinecraft.getSoundHandler()
- .stopSound(this.mSound);
- this.mTimeUntilNextTrack = MathHelper.getRandomIntegerInRange(this.mRandom, 0, getDelay() / 2);
- updateInternalNumber();
- Logger.INFO("[BGM] Adjusted BGM delay 1");
- }
- if (!this.mMinecraft.getSoundHandler()
- .isSoundPlaying(this.mSound)) {
- this.mSound = null;
- updateInternalSound(null);
- this.mTimeUntilNextTrack = Math.min(
- MathHelper.getRandomIntegerInRange(this.mRandom, getDelay(), getDelay() * 2),
- this.mTimeUntilNextTrack);
- updateInternalNumber();
- Logger.INFO("[BGM] Adjusted BGM delay 2");
- }
- } else if (this.mSound == null && this.mTimeUntilNextTrack-- <= 0) {
- this.mSound = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation());
- updateInternalSound(mSound);
- this.mMinecraft.getSoundHandler()
- .playSound(this.mSound);
- this.mTimeUntilNextTrack = getDelay();
- updateInternalNumber();
- Logger.INFO("[BGM] Adjusted BGM 3");
- }
-
- /*
- * try { // Get Value stored in underlying object. Integer aRealDelay = (Integer)
- * ReflectionUtils.getField(getClass(), "field_147676_d").get(this); if (aRealDelay == null) { return; } else {
- * if (aRealDelay > getDelay() || aRealDelay <= 0) { this.mTimeUntilNextTrack = getDelay();
- * updateInternalNumber(); } else { this.mTimeUntilNextTrack -= 5 * 20; updateInternalNumber(); } aRealDelay =
- * (Integer) ReflectionUtils.getField(getClass(), "field_147676_d").get(this);
- * Logger.INFO("[BGM] Adjusted BGM - "+aRealDelay); } } catch (IllegalArgumentException | IllegalAccessException
- * e) { }
- */
- }
-}
diff --git a/src/main/java/gtPlusPlus/plugin/manager/CoreManager.java b/src/main/java/gtPlusPlus/plugin/manager/CoreManager.java
deleted file mode 100644
index f618be2d9f..0000000000
--- a/src/main/java/gtPlusPlus/plugin/manager/CoreManager.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package gtPlusPlus.plugin.manager;
-
-import java.util.ArrayList;
-
-import gtPlusPlus.api.interfaces.IPlugin;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
-public class CoreManager {
-
- public static ArrayList<IPlugin> mPlugins = new ArrayList<>();
-
- /**
- * @param plugin - Dynamically registers the plugin for loading.
- */
- public static void registerPlugin(IPlugin plugin) {
- Logger.INFO("[Plugin] " + "Registered " + plugin.getPluginName() + ".");
- mPlugins.add(plugin);
- }
-
- /**
- * Dynamically loads all class objects within the "gtPlusPlus.plugin" package.
- */
- public static void veryEarlyInit() {
- if (ReflectionUtils.dynamicallyLoadClassesInPackage("gtPlusPlus.plugin")) {
- Logger.INFO("[Plugin] Plugin System loaded.");
- }
- }
-
- public static boolean preInit() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.preInit()) {
- Logger.INFO("[Plugin] Completed Pre-Init Phase for " + h.getPluginName() + ".");
- } else {
- Logger.INFO("[Plugin] Failed during Pre-Init Phase for " + h.getPluginName() + ".");
- }
- }
- return true;
- } catch (Throwable ignored) {}
- return false;
- }
-
- public static boolean init() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.init()) {
- Logger.INFO("[Plugin] Completed Init Phase for " + h.getPluginName() + ".");
- } else {
- Logger.INFO("[Plugin] Failed during Init Phase for " + h.getPluginName() + ".");
- }
- }
- return true;
- } catch (Throwable ignored) {}
- return false;
- }
-
- public static boolean postInit() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.postInit()) {
- Logger.INFO("[Plugin] Completed Post-Init Phase for " + h.getPluginName() + ".");
- } else {
- Logger.INFO("[Plugin] Failed during Post-Init Phase for " + h.getPluginName() + ".");
- }
- }
- return true;
- } catch (Throwable ignored) {}
- return false;
- }
-
- public static void serverStart() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.serverStart()) {
- Logger.INFO("[Plugin] Completed Server Start Phase for " + h.getPluginName() + ".");
- } else {
- Logger.INFO("[Plugin] Failed during Server Start Phase for " + h.getPluginName() + ".");
- }
- }
- } catch (Throwable ignored) {}
- }
-
- public static void serverStop() {
- try {
- for (IPlugin h : mPlugins) {
- if (h.serverStop()) {
- Logger.INFO("[Plugin] Completed Server Stop Phase for " + h.getPluginName() + ".");
- } else {
- Logger.INFO("[Plugin] Failed during Server Stop Phase for " + h.getPluginName() + ".");
- }
- }
- } catch (Throwable ignored) {}
- }
-}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
index fedd28f342..9f82936035 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
@@ -143,7 +143,7 @@ public enum GregtechOrePrefixes {
*/
public int mMaterialGenerationBits = 0;
- private GregtechOrePrefixes(final String aRegularLocalName, final String aLocalizedMaterialPre,
+ GregtechOrePrefixes(final String aRegularLocalName, final String aLocalizedMaterialPre,
final String aLocalizedMaterialPost, final boolean aIsUnificatable, final boolean aIsMaterialBased,
final boolean aIsSelfReferencing, final boolean aIsContainer, final boolean aDontUnificateActively,
final boolean aIsUsedForBlocks, final boolean aAllowNormalRecycling, final boolean aGenerateDefaultItem,
@@ -277,18 +277,6 @@ public enum GregtechOrePrefixes {
return "";
}
- public static GregtechOrePrefixes getPrefix(final String aPrefixName) {
- return getPrefix(aPrefixName, null);
- }
-
- public static GregtechOrePrefixes getPrefix(final String aPrefixName, final GregtechOrePrefixes aReplacement) {
- final Object tObject = GTUtility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false);
- if ((tObject != null) && (tObject instanceof GregtechOrePrefixes)) {
- return (GregtechOrePrefixes) tObject;
- }
- return aReplacement;
- }
-
public static Materials getMaterial(final String aOre) {
return Materials.get(stripPrefix(aOre));
}
@@ -302,7 +290,7 @@ public enum GregtechOrePrefixes {
}
public static boolean isInstanceOf(final String aName, final GregtechOrePrefixes aPrefix) {
- return aName == null ? false : aName.startsWith(aPrefix.toString());
+ return aName != null && aName.startsWith(aPrefix.toString());
}
public boolean add(final ItemStack aStack) {
@@ -717,7 +705,7 @@ public enum GregtechOrePrefixes {
*/
public final Fluid mStandardMoltenFluid = null;
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
+ GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
final int aToolDurability, final int aToolQuality, final boolean aUnificatable) {
this.mUnificatable = aUnificatable;
this.mMaterialInto = this;
@@ -735,7 +723,7 @@ public enum GregtechOrePrefixes {
}
}
- private GT_Materials(final GT_Materials aMaterialInto, final boolean aReRegisterIntoThis) {
+ GT_Materials(final GT_Materials aMaterialInto, final boolean aReRegisterIntoThis) {
this.mUnificatable = false;
this.mDefaultLocalName = aMaterialInto.mDefaultLocalName;
this.mMaterialInto = aMaterialInto.mMaterialInto;
@@ -767,7 +755,7 @@ public enum GregtechOrePrefixes {
* @param aBlastFurnaceRequired If this requires a Blast Furnace.
* @param aColor Vanilla MC Wool Color which comes the closest to this.
*/
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
+ GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
@@ -799,7 +787,7 @@ public enum GregtechOrePrefixes {
}
}
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
+ GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
@@ -833,7 +821,7 @@ public enum GregtechOrePrefixes {
/**
* @param aElement The Element Enum represented by this Material
*/
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
+ GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
@@ -872,7 +860,7 @@ public enum GregtechOrePrefixes {
this.mAspects.addAll(aAspects);
}
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
+ GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
@@ -905,7 +893,7 @@ public enum GregtechOrePrefixes {
null);
}
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
+ GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
@@ -970,18 +958,6 @@ public enum GregtechOrePrefixes {
}
}
- public static GT_Materials get(final String aMaterialName) {
- final Object tObject = GTUtility.getFieldContent(GT_Materials.class, aMaterialName, false, false);
- if ((tObject != null) && (tObject instanceof GT_Materials)) {
- return (GT_Materials) tObject;
- }
- return _NULL;
- }
-
- public static GT_Materials getRealMaterial(final String aMaterialName) {
- return get(aMaterialName).mMaterialInto;
- }
-
/**
* Called in preInit with the Config to set Values.
*
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java
index d94c764e53..9b51724b35 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java
@@ -23,8 +23,8 @@ import gtPlusPlus.api.recipe.GTPPRecipeMaps;
import gtPlusPlus.core.lib.GTPPCore;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import tectech.util.TTUtility;
public class MTERTGenerator extends MTEBasicGenerator {
@@ -45,13 +45,11 @@ public class MTERTGenerator extends MTEBasicGenerator {
// Generates fuel value based on MC days
public static int convertDaysToTicks(float days) {
- int value = 0;
- value = MathUtils.roundToClosestInt(20 * 86400 * days);
- return value;
+ return MathUtils.roundToClosestInt(20 * 86400 * days);
}
public static long getTotalEUGenerated(int ticks, int voltage) {
- return ticks * voltage;
+ return (long) ticks * voltage;
}
@Override
@@ -84,18 +82,7 @@ public class MTERTGenerator extends MTEBasicGenerator {
this.mDaysRemaining = aNBT.getInteger("mDaysRemaining");
this.mDayTick = aNBT.getInteger("mDayTick");
this.mNewTier = aNBT.getByte("mNewTier");
-
- try {
- ReflectionUtils.setByte(this, "mTier", this.mNewTier);
- } catch (Exception e) {
- if (this.getBaseMetaTileEntity() != null) {
- IGregTechTileEntity thisTile = this.getBaseMetaTileEntity();
- if (thisTile.isAllowedToWork() || thisTile.isActive()) {
- thisTile.setActive(false);
- }
- }
- }
-
+ TTUtility.setTier(this.mNewTier, this);
final NBTTagList list = aNBT.getTagList("mRecipeItem", 10);
final NBTTagCompound data = list.getCompoundTagAt(0);
ItemStack lastUsedFuel = ItemStack.loadItemStackFromNBT(data);
@@ -111,7 +98,7 @@ public class MTERTGenerator extends MTEBasicGenerator {
if (aBaseMetaTileEntity.isServerSide()) {
if (this.mDayTick < 24000) {
this.mDayTick++;
- } else if (this.mDayTick >= 24000) {
+ } else {
this.mDayTick = 0;
this.mDaysRemaining = this.removeDayOfTime();
}
@@ -327,7 +314,7 @@ public class MTERTGenerator extends MTEBasicGenerator {
} else {
mTier2 = 0;
}
- ReflectionUtils.setByte(this, "mTier", mTier2);
+ TTUtility.setTier(mTier2, this);
this.mNewTier = mTier2;
} catch (Exception e) {
Logger.WARNING("Failed setting mTier.");