mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-21 16:09:24 +00:00
Bosses should now load the chunk they're in on autospawn
This commit is contained in:
@@ -457,6 +457,8 @@ public class EcoBoss extends PluginDependent {
|
||||
* @param location The location.
|
||||
*/
|
||||
public void spawn(@NotNull final Location location) {
|
||||
location.getChunk().load();
|
||||
|
||||
LivingEntity entity = bossType.spawnBossEntity(location);
|
||||
this.livingBosses.put(entity.getUniqueId(), new LivingEcoBoss(
|
||||
this.getPlugin(),
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.willfp.ecobosses.bosses.listeners;
|
||||
|
||||
import com.willfp.eco.util.NumberUtils;
|
||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||
import com.willfp.ecobosses.bosses.EcoBoss;
|
||||
import com.willfp.ecobosses.bosses.EcoBosses;
|
||||
import com.willfp.ecobosses.bosses.LivingEcoBoss;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
@@ -37,13 +35,10 @@ public class AutoSpawnTimer implements Runnable {
|
||||
for (UUID uuid : boss.getLivingBosses().keySet()) {
|
||||
Entity entity = Bukkit.getEntity(uuid);
|
||||
|
||||
if (entity == null) {
|
||||
boss.removeLivingBoss(uuid);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entity != null) {
|
||||
worlds.add(entity.getWorld());
|
||||
}
|
||||
}
|
||||
|
||||
List<Location> locations = new ArrayList<>(boss.getAutoSpawnLocations());
|
||||
locations.removeIf(location -> worlds.contains(location.getWorld()));
|
||||
|
||||
Reference in New Issue
Block a user