diff --git a/api/src/main/java/lol/pyr/znpcsplus/util/AxolotlVariant.java b/api/src/main/java/lol/pyr/znpcsplus/util/AxolotlVariant.java new file mode 100644 index 0000000..b38b907 --- /dev/null +++ b/api/src/main/java/lol/pyr/znpcsplus/util/AxolotlVariant.java @@ -0,0 +1,9 @@ +package lol.pyr.znpcsplus.util; + +public enum AxolotlVariant { + LUCY, + WILD, + GOLD, + CYAN, + BLUE +} diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java b/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java index 9e0f44b..77cf676 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java @@ -264,6 +264,7 @@ public class ZNpcsPlus extends JavaPlugin { registerEnumParser(manager, VillagerType.class, incorrectUsageMessage); registerEnumParser(manager, VillagerProfession.class, incorrectUsageMessage); registerEnumParser(manager, VillagerLevel.class, incorrectUsageMessage); + registerEnumParser(manager, AxolotlVariant.class, incorrectUsageMessage); manager.registerCommand("npc", new MultiCommand(loadHelpMessage("root")) .addSubcommand("create", new CreateCommand(npcRegistry, typeRegistry)) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java b/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java index 335cc16..25b6a5c 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java @@ -131,6 +131,7 @@ public class PropertySetCommand implements CommandHandler { if (type == VillagerType.class) return context.suggestEnum(VillagerType.values()); if (type == VillagerProfession.class) return context.suggestEnum(VillagerProfession.values()); if (type == VillagerLevel.class) return context.suggestEnum(VillagerLevel.values()); + if (type == AxolotlVariant.class) return context.suggestEnum(AxolotlVariant.values()); } else if (context.argSize() == 4) { if (type == BlockState.class) { diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java b/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java index f41eb42..844ef5b 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java @@ -58,6 +58,7 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry { registerEnumSerializer(VillagerType.class); registerEnumSerializer(VillagerProfession.class); registerEnumSerializer(VillagerLevel.class); + registerEnumSerializer(AxolotlVariant.class); /* registerType("using_item", false); // TODO: fix it for 1.8 and add new property to use offhand item and riptide animation @@ -301,6 +302,7 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry { register(new BitsetProperty("fox_faceplanted", foxIndex, 0x40)); linkProperties("fox_sitting", "fox_crouching", "fox_sleeping", "fox_faceplanted"); + // Bee int beeIndex; if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) beeIndex = 17; else beeIndex = 18; @@ -315,6 +317,9 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry { register(new BooleanProperty("immune_to_zombification", zombificationIndex, false, legacyBooleans)); if (!ver.isNewerThanOrEquals(ServerVersion.V_1_17)) return; + // Axolotl + register(new EncodedIntegerProperty<>("axolotl_variant", AxolotlVariant.LUCY, 17, Enum::ordinal)); + register(new BooleanProperty("playing_dead", 18, false, legacyBooleans)); // Goat register(new BooleanProperty("has_left_horn", 18, true, legacyBooleans));