Skip to content

Commit

Permalink
More correct handling of DARKNESS effects and BLINDNESS
Browse files Browse the repository at this point in the history
  • Loading branch information
D3it7i committed Jun 22, 2023
1 parent 345fac2 commit 46578f4
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,19 @@ public void run() {

PotionEffect pf = p.getPotionEffect(type);
if (pf == null) {
p.setViewDistance(p.getWorld().getViewDistance());
p.setSimulationDistance(p.getWorld().getSimulationDistance());
p.setSendViewDistance(-1);
cancel();
return;
}

if (pf.getDuration() <= 30) {
p.setViewDistance(p.getWorld().getViewDistance());
p.setSimulationDistance(p.getWorld().getSimulationDistance());
p.setSendViewDistance(-1);
cancel();
return;
}

if (!changed) {
p.setViewDistance(2);
p.setSimulationDistance(2);
p.setSendViewDistance(2);
changed = true;
}
}
Expand Down

0 comments on commit 46578f4

Please sign in to comment.