1.14 mobs

This commit is contained in:
Esophose 2019-08-04 12:02:01 -06:00
parent ce3d75492d
commit e9d0dbeb62
9 changed files with 165 additions and 1 deletions

View File

@ -138,6 +138,9 @@ public class BossSpawnListener implements Listener {
if (messages != null && !activeBossHolder.isCustomSpawnMessage())
messages.replaceAll(s -> s.replace("{name}", player.getName()));
} else {
if (messages != null && !activeBossHolder.isCustomSpawnMessage())
messages.replaceAll(s -> s.replace("{name}", "Console"));
}
if (commands != null)

View File

@ -68,7 +68,14 @@ public enum EntityFinder {
POLAR_BEAR("PolarBear", new PolarBearHandler(), "polarbear", "polar_bear", "polar bear", "snowbear", "snow_bear", "snow bear"),
LLAMA("Llama", new LlamaHandler(), "llama"),
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 List<String> names = new ArrayList<>();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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