diff --git a/Essentials/src/main/java/com/earth2me/essentials/Mob.java b/Essentials/src/main/java/com/earth2me/essentials/Mob.java index d48507d5d..514fc7b09 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/Mob.java +++ b/Essentials/src/main/java/com/earth2me/essentials/Mob.java @@ -105,6 +105,11 @@ public enum Mob { AXOLOTL("Axolotl", Enemies.FRIENDLY, "AXOLOTL"), GOAT("Goat", Enemies.NEUTRAL, "GOAT"), GLOW_SQUID("GlowSquid", Enemies.FRIENDLY, "GLOW_SQUID"), + ALLAY("Allay", Enemies.FRIENDLY, "ALLAY"), + FROG("Frog", Enemies.FRIENDLY, "FROG"), + TADPOLE("Tadpole", Enemies.FRIENDLY, "TADPOLE"), + WARDEN("Warden", Enemies.ENEMY, "WARDEN"), + CHEST_BOAT("ChestBoat", Enemies.NEUTRAL, "CHEST_BOAT"), ; public static final Logger logger = Logger.getLogger("Essentials"); diff --git a/Essentials/src/main/java/com/earth2me/essentials/MobCompat.java b/Essentials/src/main/java/com/earth2me/essentials/MobCompat.java index aca8ad876..373d41db2 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/MobCompat.java +++ b/Essentials/src/main/java/com/earth2me/essentials/MobCompat.java @@ -7,6 +7,7 @@ import org.bukkit.entity.Axolotl; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Fox; +import org.bukkit.entity.Frog; import org.bukkit.entity.Llama; import org.bukkit.entity.MushroomCow; import org.bukkit.entity.Ocelot; @@ -37,6 +38,7 @@ public final class MobCompat { public static final EntityType PHANTOM = getEntityType("PHANTOM"); public static final EntityType AXOLOTL = getEntityType("AXOLOTL"); public static final EntityType GOAT = getEntityType("GOAT"); + public static final EntityType FROG = getEntityType("FROG"); // Constants for mobs that have changed since earlier versions public static final EntityType CAT = getEntityType("CAT", "OCELOT"); @@ -164,6 +166,15 @@ public final class MobCompat { } } + public static void setFrogVariant(final Entity entity, final String variant) { + if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_19_R01)) { + return; + } + if (entity instanceof Frog) { + ((Frog) entity).setVariant(Frog.Variant.valueOf(variant)); + } + } + public enum CatType { // These are (loosely) Mojang names for the cats SIAMESE("SIAMESE", "SIAMESE_CAT"), diff --git a/Essentials/src/main/java/com/earth2me/essentials/MobData.java b/Essentials/src/main/java/com/earth2me/essentials/MobData.java index ab8d1a600..160640059 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/MobData.java +++ b/Essentials/src/main/java/com/earth2me/essentials/MobData.java @@ -197,6 +197,9 @@ public enum MobData { CYAN_AXOLOTL("cyan", MobCompat.AXOLOTL, "axolotl:CYAN", true), BLUE_AXOLOTL("blue", MobCompat.AXOLOTL, "axolotl:BLUE", true), SCREAMING_GOAT("screaming", MobCompat.GOAT, Data.GOAT_SCREAMING, true), + TEMPERATE_FROG("temperate", MobCompat.FROG, "frog:TEMPERATE", true), + WARM_FROG("warm", MobCompat.FROG, "frog:WARM", true), + COLD_FROG("cold", MobCompat.FROG, "frog:COLD", true), ; public static final Logger logger = Logger.getLogger("Essentials"); @@ -407,6 +410,10 @@ public enum MobData { MobCompat.setAxolotlVariant(spawned, split[1]); break; } + case "frog": { + MobCompat.setFrogVariant(spawned, split[1]); + break; + } } } else { logger.warning("Unknown mob data type: " + this.toString());