Added parrot_variant property

This commit is contained in:
D3v1s0m 2023-09-12 23:16:42 +05:30
parent dd3eda5512
commit bfbd883f03
No known key found for this signature in database
GPG Key ID: FA1F770C7B1D40C1
3 changed files with 12 additions and 3 deletions

@ -5,6 +5,5 @@ public enum ParrotVariant {
BLUE, BLUE,
GREEN, GREEN,
YELLOW_BLUE, YELLOW_BLUE,
GRAY, GRAY
NONE // only used to set empty nbt compound
} }

@ -363,6 +363,15 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
register(new EncodedIntegerProperty<DyeColor>("carpet_color", DyeColor.class, llamaIndex++, obj -> obj == null ? -1 : obj.ordinal())); register(new EncodedIntegerProperty<DyeColor>("carpet_color", DyeColor.class, llamaIndex++, obj -> obj == null ? -1 : obj.ordinal()));
register(new EncodedIntegerProperty<>("llama_variant", LlamaVariant.CREAMY, llamaIndex, Enum::ordinal)); register(new EncodedIntegerProperty<>("llama_variant", LlamaVariant.CREAMY, llamaIndex, Enum::ordinal));
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_12)) return;
// Parrot
int parrotIndex;
if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) parrotIndex = 19;
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_15)) parrotIndex = 18;
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_14)) parrotIndex = 17;
else parrotIndex = 15;
register(new EncodedIntegerProperty<>("parrot_variant", ParrotVariant.RED_BLUE, parrotIndex, Enum::ordinal));
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_14)) return; if (!ver.isNewerThanOrEquals(ServerVersion.V_1_14)) return;
// Pose // Pose
register(new NpcPoseProperty()); register(new NpcPoseProperty());

@ -227,7 +227,8 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry {
.setHologramOffset(-0.025)); .setHologramOffset(-0.025));
register(builder(p, "parrot", EntityTypes.PARROT) register(builder(p, "parrot", EntityTypes.PARROT)
.setHologramOffset(-1.075)); .setHologramOffset(-1.075)
.addProperties("parrot_variant"));
if (!version.isNewerThanOrEquals(ServerVersion.V_1_13)) return; if (!version.isNewerThanOrEquals(ServerVersion.V_1_13)) return;