Skip to content

Commit

Permalink
Fix bug with MythicMobs changes #2340
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Apr 14, 2024
1 parent 2fe85ec commit b756d06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ public void setDomestication(Integer domestication) {
* @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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public String getFailureCause() {
* @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(), () -> {
Expand Down

0 comments on commit b756d06

Please sign in to comment.