Possibly fix SSB2 lag

This commit is contained in:
AverageGithub 2024-04-11 18:17:50 +02:00
parent 286f8f14f1
commit c1dc103219
2 changed files with 8 additions and 5 deletions

View File

@ -156,7 +156,6 @@ shadowJar {
relocate("net.kyori", "com.artillexstudios.axminions.libs.kyori") relocate("net.kyori", "com.artillexstudios.axminions.libs.kyori")
relocate("revxrsal.commands", "com.artillexstudios.axminions.libs.lamp") relocate("revxrsal.commands", "com.artillexstudios.axminions.libs.lamp")
relocate("org.jetbrains.annotations", "com.artillexstudios.axminions.libs.annotations") relocate("org.jetbrains.annotations", "com.artillexstudios.axminions.libs.annotations")
relocate("org.slf4j", "com.artillexstudios.axminions.libs.slf4j")
relocate("org.intellij.lang.annotations", "com.artillexstudios.axminions.libs.intellij.annotations") relocate("org.intellij.lang.annotations", "com.artillexstudios.axminions.libs.intellij.annotations")
} }

View File

@ -2,8 +2,10 @@ package com.artillexstudios.axminions.listeners
import com.artillexstudios.axminions.minions.Minions import com.artillexstudios.axminions.minions.Minions
import com.bgsoftware.superiorskyblock.api.events.IslandDisbandEvent import com.bgsoftware.superiorskyblock.api.events.IslandDisbandEvent
import org.bukkit.World.Environment
import org.bukkit.event.EventHandler import org.bukkit.event.EventHandler
import org.bukkit.event.Listener import org.bukkit.event.Listener
import org.bukkit.World
class SuperiorSkyBlock2Listener : Listener { class SuperiorSkyBlock2Listener : Listener {
@ -11,7 +13,8 @@ class SuperiorSkyBlock2Listener : Listener {
fun onIslandDisbandEvent(event: IslandDisbandEvent) { fun onIslandDisbandEvent(event: IslandDisbandEvent) {
val minions = Minions.getMinions() val minions = Minions.getMinions()
event.island.allChunks.forEach { chunk -> Environment.entries.forEach { entry ->
event.island.getAllChunksAsync(entry, true) {}.forEach { chunk ->
minions.forEach { minion -> minions.forEach { minion ->
if (minion.getLocation().chunk == chunk) { if (minion.getLocation().chunk == chunk) {
minion.remove() minion.remove()
@ -19,4 +22,5 @@ class SuperiorSkyBlock2Listener : Listener {
} }
} }
} }
}
} }