fix llama properties on 1.20+

This commit is contained in:
Pyrbu 2024-12-29 13:51:33 +01:00
parent c0bcbcf7a3
commit ad8138f983
3 changed files with 7 additions and 3 deletions

View file

@ -8,7 +8,7 @@ runServer {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
}
minecraftVersion "1.21.3"
minecraftVersion "1.21.4"
}
processResources {

View file

@ -493,7 +493,9 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_15)) llamaIndex = 20;
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_14)) llamaIndex = 19;
else llamaIndex = 17;
register(new EncodedIntegerProperty<DyeColor>("carpet_color", DyeColor.class, llamaIndex++, obj -> obj == null ? -1 : obj.ordinal()));
// Removed in 1.20
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_20)) 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));
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_12)) return;
@ -655,6 +657,8 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
if (!ver.isNewerThanOrEquals(ServerVersion.V_1_20)) return;
register(new EquipmentProperty(packetFactory, "body", EquipmentSlot.BODY));
// Camel
int camelIndex = 18;
register(new BooleanProperty("bashing", camelIndex++, false, legacyBooleans));

View file

@ -221,7 +221,7 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry {
register(builder(p, "llama", EntityTypes.LLAMA)
.setHologramOffset(-0.105)
.addProperties("carpet_color", "llama_variant"));
.addProperties("carpet_color", "llama_variant", "body"));
register(builder(p, "vex", EntityTypes.VEX)
.setHologramOffset(-1.175)