diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-04 23:42:57 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-04 23:42:57 +0000 |
commit | 2ed346ae95241029f999ec4caa387fca102896c0 (patch) | |
tree | c7f10053c53d634ea4c45074afccc941c8c651d2 /src/Java/gtPlusPlus/plugin/fixes | |
parent | 0e8070f3eb5149c7223049f93b4df86adb63ea57 (diff) | |
download | GT5-Unofficial-2ed346ae95241029f999ec4caa387fca102896c0.tar.gz GT5-Unofficial-2ed346ae95241029f999ec4caa387fca102896c0.tar.bz2 GT5-Unofficial-2ed346ae95241029f999ec4caa387fca102896c0.zip |
$ More minor ASM Fixes/Cleanup.
% Cleaned up some logging.
Diffstat (limited to 'src/Java/gtPlusPlus/plugin/fixes')
-rw-r--r-- | src/Java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java | 2 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/Java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java b/src/Java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java index 8e7b73ccdf..f6af6e6e5f 100644 --- a/src/Java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java +++ b/src/Java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java @@ -10,7 +10,7 @@ public class Core_VanillaFixes implements IPlugin { static { mInstance = new Core_VanillaFixes(); - mBedFixInstance = new VanillaBedHeightFix(); + mBedFixInstance = new VanillaBedHeightFix(mInstance); mInstance.log("Preparing "+mInstance.getPluginName()+" for use."); } diff --git a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java index 4a0c8d3d6c..25be6679ed 100644 --- a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java +++ b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java @@ -5,6 +5,7 @@ import java.lang.reflect.Method; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -16,15 +17,21 @@ import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; public class VanillaBedHeightFix implements IBugFix { private final Method mSleepInBedAt; + private final IPlugin mParent; - public VanillaBedHeightFix() { - if (DevHelper.isValidHelperObject()) { - Method m = ReflectionUtils.getMethod(EntityPlayer.class, "sleepInBedAt", int.class, int.class, int.class); - if (m == null) { + public VanillaBedHeightFix(IPlugin minstance) { + mParent = minstance; + if (DevHelper.isValidHelperObject()) { + Method m; + if (DevHelper.IsObfuscatedEnvironment()) { 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); } if (m != null) { mSleepInBedAt = m; + mParent.log("Registering Bed Heigh Fix."); Utils.registerEvent(this); } else { mSleepInBedAt = null; |