mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-01-06 23:37:33 +01:00
1.15
This commit is contained in:
parent
b491a56112
commit
ec408ef0ae
@ -105,7 +105,7 @@ public class ActiveBossHolder implements IActiveHolder {
|
|||||||
|
|
||||||
// grab list of all valid entities by UUID that can be removed
|
// grab list of all valid entities by UUID that can be removed
|
||||||
Map<Integer, Entity> toRemove = this.livingEntityMap.entrySet().stream()
|
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()
|
.entrySet().stream()
|
||||||
.filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded(
|
.filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded(
|
||||||
e.getValue().getLocation().getBlockX() >> 4,
|
e.getValue().getLocation().getBlockX() >> 4,
|
||||||
|
@ -76,6 +76,7 @@ public enum EntityFinder {
|
|||||||
TURTLE("Turtle", new TurtleHandler(), "turtle"),
|
TURTLE("Turtle", new TurtleHandler(), "turtle"),
|
||||||
PHANTOM("Phantom", new PhantomHandler(), "phantom"),
|
PHANTOM("Phantom", new PhantomHandler(), "phantom"),
|
||||||
CAT("Cat", new CatHandler(), "cat"),
|
CAT("Cat", new CatHandler(), "cat"),
|
||||||
|
BEE("Bee", new BeeHandler(), "bee"),
|
||||||
FOX("Fox", new FoxHandler(), "fox"),
|
FOX("Fox", new FoxHandler(), "fox"),
|
||||||
PANDA("Panda", new PandaHandler(), "panda"),
|
PANDA("Panda", new PandaHandler(), "panda"),
|
||||||
PILLAGER("Pillager", new PillagerHandler(), "pillager"),
|
PILLAGER("Pillager", new PillagerHandler(), "pillager"),
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user