9
0
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:
Auxilor
2021-06-29 18:29:08 +01:00
parent 22f59c7c5c
commit 890b034d4a
2 changed files with 4 additions and 7 deletions

View File

@@ -457,6 +457,8 @@ public class EcoBoss extends PluginDependent {
* @param location The location. * @param location The location.
*/ */
public void spawn(@NotNull final Location location) { public void spawn(@NotNull final Location location) {
location.getChunk().load();
LivingEntity entity = bossType.spawnBossEntity(location); LivingEntity entity = bossType.spawnBossEntity(location);
this.livingBosses.put(entity.getUniqueId(), new LivingEcoBoss( this.livingBosses.put(entity.getUniqueId(), new LivingEcoBoss(
this.getPlugin(), this.getPlugin(),

View File

@@ -1,10 +1,8 @@
package com.willfp.ecobosses.bosses.listeners; package com.willfp.ecobosses.bosses.listeners;
import com.willfp.eco.util.NumberUtils; import com.willfp.eco.util.NumberUtils;
import com.willfp.ecobosses.EcoBossesPlugin;
import com.willfp.ecobosses.bosses.EcoBoss; import com.willfp.ecobosses.bosses.EcoBoss;
import com.willfp.ecobosses.bosses.EcoBosses; import com.willfp.ecobosses.bosses.EcoBosses;
import com.willfp.ecobosses.bosses.LivingEcoBoss;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
@@ -37,12 +35,9 @@ public class AutoSpawnTimer implements Runnable {
for (UUID uuid : boss.getLivingBosses().keySet()) { for (UUID uuid : boss.getLivingBosses().keySet()) {
Entity entity = Bukkit.getEntity(uuid); Entity entity = Bukkit.getEntity(uuid);
if (entity == null) { if (entity != null) {
boss.removeLivingBoss(uuid); worlds.add(entity.getWorld());
continue;
} }
worlds.add(entity.getWorld());
} }
List<Location> locations = new ArrayList<>(boss.getAutoSpawnLocations()); List<Location> locations = new ArrayList<>(boss.getAutoSpawnLocations());