mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-10-25 20:22:23 +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;
|
||||
|
||||
Reference in new issue
Block a user