This commit is contained in:
Brianna 2019-12-28 14:32:58 -05:00
parent b491a56112
commit ec408ef0ae
3 changed files with 21 additions and 1 deletions

View File

@ -105,7 +105,7 @@ public class ActiveBossHolder implements IActiveHolder {
// grab list of all valid entities by UUID that can be removed
Map<Integer, Entity> 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,

View File

@ -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"),

View File

@ -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);
}
}