From 778838e2b004cd39768e1fb01885ff45f29ed87b Mon Sep 17 00:00:00 2001 From: cpw Date: Fri, 4 May 2018 03:26:28 +0100 Subject: [PATCH] Fix light calculation to use actual visible level. Should now work on (#1295) surface at night as well as underground. Tweak duration to reduce flicker. --- .../livingArmour/upgrade/LivingArmourUpgradeNightSight.java | 2 +- src/main/java/WayofTime/bloodmagic/util/Constants.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeNightSight.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeNightSight.java index 27a39c9f..b9171625 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeNightSight.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeNightSight.java @@ -29,7 +29,7 @@ public class LivingArmourUpgradeNightSight extends LivingArmourUpgrade { @Override public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { - if (world.getLight(player.getPosition()) <= 9) { + if (world.getLight(player.getPosition(), false) <= 9) { isActive = true; if (player.isPotionActive(MobEffects.NIGHT_VISION)) { int dur = player.getActivePotionEffect(MobEffects.NIGHT_VISION).getDuration(); diff --git a/src/main/java/WayofTime/bloodmagic/util/Constants.java b/src/main/java/WayofTime/bloodmagic/util/Constants.java index 13b43026..fd678307 100644 --- a/src/main/java/WayofTime/bloodmagic/util/Constants.java +++ b/src/main/java/WayofTime/bloodmagic/util/Constants.java @@ -168,7 +168,7 @@ public class Constants { public static final int POTION_ARRAY_SIZE = 256; public static final float ALTERED_STEP_HEIGHT = 1.00314159f; - public static final int NIGHT_VISION_CONSTANT_BEGIN = 30002; + public static final int NIGHT_VISION_CONSTANT_BEGIN = 30020; public static final int NIGHT_VISION_CONSTANT_END = 30000; } }