mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 01:25:26 +02:00
New animals for spawner and spawnmob
This commit is contained in:
@@ -27,7 +27,10 @@ public enum Mob
|
|||||||
SQUID("Squid", Enemies.FRIENDLY, CreatureType.SQUID),
|
SQUID("Squid", Enemies.FRIENDLY, CreatureType.SQUID),
|
||||||
ZOMBIE("Zombie", Enemies.ENEMY, CreatureType.ZOMBIE),
|
ZOMBIE("Zombie", Enemies.ENEMY, CreatureType.ZOMBIE),
|
||||||
MONSTER("Monster", Enemies.ENEMY, CreatureType.MONSTER),
|
MONSTER("Monster", Enemies.ENEMY, CreatureType.MONSTER),
|
||||||
WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF);
|
WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF),
|
||||||
|
CAVESPIDER("CaveSpider", Enemies.ENEMY, CreatureType.CAVE_SPIDER),
|
||||||
|
ENDERMAN("Enderman", Enemies.ENEMY, CreatureType.ENDERMAN),
|
||||||
|
SILVERFISH("Silverfish", Enemies.ENEMY, CreatureType.SILVERFISH);
|
||||||
|
|
||||||
public static final Logger logger = Logger.getLogger("Minecraft");
|
public static final Logger logger = Logger.getLogger("Minecraft");
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ public class Commandspawner extends EssentialsCommand
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
String name = args[0];
|
String name = args[0];
|
||||||
name = name.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(name);
|
name = name.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : name.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(name);
|
||||||
|
|
||||||
Mob mob = null;
|
Mob mob = null;
|
||||||
mob = Mob.fromName(name);
|
mob = Mob.fromName(name);
|
||||||
|
@@ -37,7 +37,7 @@ public class Commandspawnmob extends EssentialsCommand
|
|||||||
String[] mountparts = args[0].split(",");
|
String[] mountparts = args[0].split(",");
|
||||||
String[] parts = mountparts[0].split(":");
|
String[] parts = mountparts[0].split(":");
|
||||||
String mobType = parts[0];
|
String mobType = parts[0];
|
||||||
mobType = mobType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mobType);
|
mobType = mobType.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : mobType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mobType);
|
||||||
String mobData = null;
|
String mobData = null;
|
||||||
if (parts.length == 2)
|
if (parts.length == 2)
|
||||||
{
|
{
|
||||||
@@ -49,7 +49,7 @@ public class Commandspawnmob extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
parts = mountparts[1].split(":");
|
parts = mountparts[1].split(":");
|
||||||
mountType = parts[0];
|
mountType = parts[0];
|
||||||
mountType = mountType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mountType);
|
mountType = mountType.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : mountType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mountType);
|
||||||
if (parts.length == 2)
|
if (parts.length == 2)
|
||||||
{
|
{
|
||||||
mountData = parts[1];
|
mountData = parts[1];
|
||||||
@@ -77,7 +77,8 @@ public class Commandspawnmob extends EssentialsCommand
|
|||||||
8, 9
|
8, 9
|
||||||
};
|
};
|
||||||
Block block = (new TargetBlock(user, 300, 0.2, ignore)).getTargetBlock();
|
Block block = (new TargetBlock(user, 300, 0.2, ignore)).getTargetBlock();
|
||||||
if(block == null) {
|
if (block == null)
|
||||||
|
{
|
||||||
user.sendMessage(Util.i18n("unableToSpawnMob"));
|
user.sendMessage(Util.i18n("unableToSpawnMob"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user