This commit is contained in:
Caedis authored and GitHub committed 2026-09-04 14:09:25 +00:00
1 parent 673f832c2d
commit caec163702
1 file changed
+5 -7
@@ -571,13 +571,11 @@ public class DarkSteelController {
private void updateNightvision(EntityPlayer player) {
if (isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 210, 0, true));
} else if (!isNightVisionUpgradeOrEnchEquipped(player)
&& player.getActivePotionEffect(Potion.nightVision) != null) {
// Remove the effect when upgrade is not equipped (e.g. helmet removed), but do NOT
// reset nightVisionActive — during dimension transitions the inventory is temporarily
// empty, and resetting the flag would permanently disable night vision after portals.
player.removePotionEffect(Potion.nightVision.getId());
}
}
if (!isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
nightVisionActive = false;
removeNightvision = true;
}
if (removeNightvision) {
player.removePotionEffect(Potion.nightVision.getId());
removeNightvision = false;