aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-08-21 03:18:49 +0900
committerGitHub <noreply@github.com>2022-08-20 19:18:49 +0100
commit2663d6169157c329f079f42a6f4a8c17f52cbba5 (patch)
tree29a5fcf6750ea664aa928171d3c874ba0a4b2a0c /src/main
parent639d89e36b8065f0e72ce12fa48b3b8f32dbf077 (diff)
downloadGT5-Unofficial-2663d6169157c329f079f42a6f4a8c17f52cbba5.tar.gz
GT5-Unofficial-2663d6169157c329f079f42a6f4a8c17f52cbba5.tar.bz2
GT5-Unofficial-2663d6169157c329f079f42a6f4a8c17f52cbba5.zip
Fix bad effect removal on obfuscated environment (#288)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
index 3855d8371a..b78d80e0b2 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
@@ -11,6 +11,7 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.preloader.DevHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@@ -20,7 +21,7 @@ import net.minecraftforge.event.entity.player.PlayerWakeUpEvent;
public class PlayerSleepEventHandler {
- private static Field sEffectDuration = ReflectionUtils.getField(PotionEffect.class, "duration");
+ private static Field sEffectDuration = ReflectionUtils.getField(PotionEffect.class, DevHelper.isObfuscatedEnvironment() ? "field_76460_b" : "duration");
private static ArrayList<Potion> sPositiveEffects = new ArrayList<Potion>();
private static ArrayList<Potion> sNegativeEffects = new ArrayList<Potion>();