You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/src/main/java/de/flo56958/MineTinker/Modifiers/Types/VoidNetting.java
+45-38Lines changed: 45 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -144,47 +144,54 @@ public void onDamage(EntityDamageEvent event) {
144
144
}
145
145
}
146
146
147
-
Locationloc = player.getLocation();
148
-
for (inti = 0; i < level * radiusPerLevel; i++) {
149
-
for (intd = -i; d <= i; d++) {
150
-
inty = loc.getWorld().getHighestBlockYAt(loc.getBlockX() + d, loc.getBlockZ() + i - Math.abs(d));
151
-
if (y > 1) {
152
-
loc = newLocation(loc.getWorld(), loc.getBlockX() + d, y + 2, loc.getBlockZ() + i - Math.abs(d));
153
-
break;
147
+
cooldownTracker.put(player.getUniqueId().toString(), time - Math.round(this.cooldownInSeconds * 0.95)); //Add small cooldown to improve server performance
148
+
149
+
Bukkit.getScheduler().runTaskAsynchronously(Main.getPlugin(), () -> { //run effect async as it does not need to stop all action on server if search takes to long
150
+
Locationloc = player.getLocation();
151
+
for (inti = 0; i < level * radiusPerLevel; i++) {
152
+
for (intd = -i; d <= i; d++) {
153
+
inty = loc.getWorld().getHighestBlockYAt(loc.getBlockX() + d, loc.getBlockZ() + i - Math.abs(d));
154
+
if (y > 1) {
155
+
loc = newLocation(loc.getWorld(), loc.getBlockX() + d, y + 2, loc.getBlockZ() + i - Math.abs(d));
0 commit comments