Fix bug with MythicMobs changes #2340

This commit is contained in:
tastybento 2024-04-14 22:00:37 -07:00
parent 3de0ff236e
commit ffb955b22b
2 changed files with 6 additions and 0 deletions

View File

@ -286,6 +286,9 @@ public class BlueprintEntity {
* @return the mythicMobsRecord
*/
public MythicMobRecord getMythicMobsRecord() {
if (this.MMtype == null || this.MMLevel == null || this.MMpower == null || this.MMStance == null) {
return null;
}
return new MythicMobRecord(this.MMtype, this.getCustomName(), this.MMLevel, this.MMpower, this.MMStance);
}

View File

@ -55,6 +55,9 @@ public class MythicMobsHook extends Hook {
* @return true if spawn is successful
*/
public boolean spawnMythicMob(MythicMobRecord mmr, Location spawnLocation) {
if (!this.isPluginAvailable()) {
return false;
}
return MythicBukkit.inst().getMobManager().getMythicMob(mmr.type()).map(mob -> {
// A delay is required before spawning, I assume because the blocks are pasted using NMS
Bukkit.getScheduler().runTaskLater(getPlugin(), () -> {