Skip to content

Commit

Permalink
fix not using the effective view distance (which is per world and can…
Browse files Browse the repository at this point in the history
… differ from the main server config) (#139)
  • Loading branch information
DerToaster98 committed Aug 19, 2024
1 parent db55bea commit cad35d2
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ public void run() {
if (ticksElapsed < TracerRateTicks)
return;

long maxDistSquared = Bukkit.getServer().getViewDistance() * 16L;
maxDistSquared = maxDistSquared - 16;
maxDistSquared = maxDistSquared * maxDistSquared;
//long maxDistSquared = Bukkit.getServer().getViewDistance() * 16L;

for (World w : Bukkit.getWorlds()) {
if (w == null)
continue;

long maxDistSquared = w.getViewDistance() * 16L;
maxDistSquared = maxDistSquared - 16;
maxDistSquared = maxDistSquared * maxDistSquared;

for (TNTPrimed tnt : w.getEntitiesByClass(TNTPrimed.class)) {
processTNT(tnt, maxDistSquared, w);
}
Expand Down Expand Up @@ -149,7 +151,8 @@ public void entityExplodeEvent(@NotNull EntityExplodeEvent e) {
if (TracerRateTicks == 0)
return;

long maxDistSquared = Bukkit.getServer().getViewDistance() * 16L;
//long maxDistSquared = Bukkit.getServer().getViewDistance() * 16L;
long maxDistSquared = tnt.getWorld().getViewDistance() * 16L;
maxDistSquared = maxDistSquared - 16;
maxDistSquared = maxDistSquared * maxDistSquared;

Expand Down

0 comments on commit cad35d2

Please sign in to comment.