diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java index d7fea15..4ae0a3b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java @@ -105,7 +105,7 @@ public class ActiveBossHolder implements IActiveHolder { // grab list of all valid entities by UUID that can be removed Map toRemove = this.livingEntityMap.entrySet().stream() - .collect(Collectors.toMap(e -> e.getKey(), e -> ServerUtils.get().getEntity(e.getValue()))) + .collect(Collectors.toMap(Map.Entry::getKey, e -> ServerUtils.get().getEntity(e.getValue()))) .entrySet().stream() .filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded( e.getValue().getLocation().getBlockX() >> 4, diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java index 4be5b41..c6cadf3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java @@ -76,6 +76,7 @@ public enum EntityFinder { TURTLE("Turtle", new TurtleHandler(), "turtle"), PHANTOM("Phantom", new PhantomHandler(), "phantom"), CAT("Cat", new CatHandler(), "cat"), + BEE("Bee", new BeeHandler(), "bee"), FOX("Fox", new FoxHandler(), "fox"), PANDA("Panda", new PandaHandler(), "panda"), PILLAGER("Pillager", new PillagerHandler(), "pillager"), diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/BeeHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/BeeHandler.java new file mode 100644 index 0000000..bb03494 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/BeeHandler.java @@ -0,0 +1,19 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.core.compatibility.ServerVersion; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class BeeHandler implements ICustomEntityHandler { + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_15)) { + throw new NullPointerException("This feature is only implemented in version 1.15 and above of Minecraft."); + } + + return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.BEE); + } +}