diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-04 20:54:10 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-04 20:54:10 +1000 |
commit | 0ca4f1177cd2e5ee6bd2be38f6d0f2a60e143e33 (patch) | |
tree | bd3811c0c0daa578e73b3d5a13b5dec203801e45 /src/Java/gtPlusPlus/core/util | |
parent | 9878a7c661309e57a65316013d309f9d87fea8a8 (diff) | |
download | GT5-Unofficial-0ca4f1177cd2e5ee6bd2be38f6d0f2a60e143e33.tar.gz GT5-Unofficial-0ca4f1177cd2e5ee6bd2be38f6d0f2a60e143e33.tar.bz2 GT5-Unofficial-0ca4f1177cd2e5ee6bd2be38f6d0f2a60e143e33.zip |
$ Fixed a client crashing bug where aspects didn't register properly due to the changes I made in AspectStack handling.
% Changed how logging is done for cable reflection tasks.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/Utils.java | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java index 090d05e3b1..bee5de98ea 100644 --- a/src/Java/gtPlusPlus/core/util/Utils.java +++ b/src/Java/gtPlusPlus/core/util/Utils.java @@ -44,6 +44,9 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; + +import org.apache.commons.lang3.EnumUtils; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.registry.EntityRegistry; @@ -90,32 +93,52 @@ public class Utils { if (aspect.toUpperCase() == "COGNITIO"){ //Adds in Compat for older GT Versions which Misspell aspects. try { - returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITIO"), size); + if (EnumUtils.isValidEnum(TC_Aspects.class, "COGNITIO")){ + Utils.LOG_WARNING("TC Aspect found - "+aspect); + returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITIO"), size); + } + else { + Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); + returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size); + } } catch (NoSuchFieldError r){ - Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); - returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size); - + Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus"); } } else if (aspect.toUpperCase() == "EXANIMUS"){ - //Adds in Compat for older GT Versions which Misspell aspects. + //Adds in Compat for older GT Versions which Misspell aspects. try { - returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXANIMUS"), size); + if (EnumUtils.isValidEnum(TC_Aspects.class, "EXANIMUS")){ + Utils.LOG_WARNING("TC Aspect found - "+aspect); + returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXANIMUS"), size); + } + else { + Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); + returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXAMINIS"), size); + } } catch (NoSuchFieldError r){ - Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); - returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXAMINIS"), size); + Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus"); } + + } else if (aspect.toUpperCase() == "PRAECANTATIO"){ - //Adds in Compat for older GT Versions which Misspell aspects. + //Adds in Compat for older GT Versions which Misspell aspects. try { - returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTATIO"), size); + if (EnumUtils.isValidEnum(TC_Aspects.class, "PRAECANTATIO")){ + Utils.LOG_WARNING("TC Aspect found - "+aspect); + returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTATIO"), size); + } + else { + Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); + returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTIO"), size); + } } catch (NoSuchFieldError r){ - Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); - returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTIO"), size); - } + Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus"); + } } else { + Utils.LOG_WARNING("TC Aspect found - "+aspect); returnValue = new TC_AspectStack(TC_Aspects.valueOf(aspect), size); } |