mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-01-08 08:17:43 +01:00
1.14 mobs
This commit is contained in:
parent
ce3d75492d
commit
e9d0dbeb62
@ -138,6 +138,9 @@ public class BossSpawnListener implements Listener {
|
|||||||
|
|
||||||
if (messages != null && !activeBossHolder.isCustomSpawnMessage())
|
if (messages != null && !activeBossHolder.isCustomSpawnMessage())
|
||||||
messages.replaceAll(s -> s.replace("{name}", player.getName()));
|
messages.replaceAll(s -> s.replace("{name}", player.getName()));
|
||||||
|
} else {
|
||||||
|
if (messages != null && !activeBossHolder.isCustomSpawnMessage())
|
||||||
|
messages.replaceAll(s -> s.replace("{name}", "Console"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commands != null)
|
if (commands != null)
|
||||||
|
@ -68,7 +68,14 @@ public enum EntityFinder {
|
|||||||
POLAR_BEAR("PolarBear", new PolarBearHandler(), "polarbear", "polar_bear", "polar bear", "snowbear", "snow_bear", "snow bear"),
|
POLAR_BEAR("PolarBear", new PolarBearHandler(), "polarbear", "polar_bear", "polar bear", "snowbear", "snow_bear", "snow bear"),
|
||||||
LLAMA("Llama", new LlamaHandler(), "llama"),
|
LLAMA("Llama", new LlamaHandler(), "llama"),
|
||||||
PARROT("Parrot", new ParrotHandler(), "parrot"),
|
PARROT("Parrot", new ParrotHandler(), "parrot"),
|
||||||
VILLAGER("Villager", new VillagerHandler(), "villager");
|
VILLAGER("Villager", new VillagerHandler(), "villager"),
|
||||||
|
CAT("Cat", new CatHandler(), "cat"),
|
||||||
|
FOX("Fox", new FoxHandler(), "fox"),
|
||||||
|
PANDA("Panda", new PandaHandler(), "panda"),
|
||||||
|
PILLAGER("Pillager", new PillagerHandler(), "pillager"),
|
||||||
|
RAVAGER("Ravager", new RavagerHandler(), "ravager"),
|
||||||
|
TRADER_LLAMA("TraderLlama", new TraderLlamaHandler(), "traderllama", "trader_llama", "trader llama", "llamatrader", "llama_trader", "llama trader"),
|
||||||
|
WANDERING_TRADER("WanderingTrader", new WanderingTraderHandler(), "wanderingtrader", "wandering_trader", "wandering trader", "tradervillager", "trader_villager", "trader villager");
|
||||||
|
|
||||||
@Getter private ICustomEntityHandler customEntityHandler;
|
@Getter private ICustomEntityHandler customEntityHandler;
|
||||||
@Getter private List<String> names = new ArrayList<>();
|
@Getter private List<String> names = new ArrayList<>();
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.epicbosses.utils.entity.handlers;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.utils.Versions;
|
||||||
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
|
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class CatHandler implements ICustomEntityHandler {
|
||||||
|
|
||||||
|
private VersionHandler versionHandler = new VersionHandler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||||
|
if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) {
|
||||||
|
throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.CAT);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.epicbosses.utils.entity.handlers;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.utils.Versions;
|
||||||
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
|
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class FoxHandler implements ICustomEntityHandler {
|
||||||
|
|
||||||
|
private VersionHandler versionHandler = new VersionHandler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||||
|
if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) {
|
||||||
|
throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.FOX);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.epicbosses.utils.entity.handlers;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.utils.Versions;
|
||||||
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
|
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class PandaHandler implements ICustomEntityHandler {
|
||||||
|
|
||||||
|
private VersionHandler versionHandler = new VersionHandler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||||
|
if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) {
|
||||||
|
throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PANDA);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.epicbosses.utils.entity.handlers;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.utils.Versions;
|
||||||
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
|
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class PillagerHandler implements ICustomEntityHandler {
|
||||||
|
|
||||||
|
private VersionHandler versionHandler = new VersionHandler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||||
|
if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) {
|
||||||
|
throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PILLAGER);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.epicbosses.utils.entity.handlers;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.utils.Versions;
|
||||||
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
|
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class RavagerHandler implements ICustomEntityHandler {
|
||||||
|
|
||||||
|
private VersionHandler versionHandler = new VersionHandler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||||
|
if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) {
|
||||||
|
throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.RAVAGER);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.epicbosses.utils.entity.handlers;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.utils.Versions;
|
||||||
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
|
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class TraderLlamaHandler implements ICustomEntityHandler {
|
||||||
|
|
||||||
|
private VersionHandler versionHandler = new VersionHandler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||||
|
if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) {
|
||||||
|
throw new NullPointerException("This feature is only implemented in version 1.12 and above of Minecraft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.TRADER_LLAMA);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.songoda.epicbosses.utils.entity.handlers;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.utils.Versions;
|
||||||
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
|
import com.songoda.epicbosses.utils.version.VersionHandler;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class WanderingTraderHandler implements ICustomEntityHandler {
|
||||||
|
|
||||||
|
private VersionHandler versionHandler = new VersionHandler();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LivingEntity getBaseEntity(String entityType, Location spawnLocation) {
|
||||||
|
if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) {
|
||||||
|
throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.WANDERING_TRADER);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user