Fixed tiny silly ponies reverting to normal villagers when they grow up

This commit is contained in:
Sollace 2023-10-05 20:28:29 +01:00
parent 509f6477f2
commit e31ee1c53b
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -8,7 +8,9 @@ public class SillyPonyTextureSupplier {
public static <T extends LivingEntity & VillagerDataContainer> TextureSupplier<T> create(TextureSupplier<T> fallback, TextureSupplier<String> formatter) { public static <T extends LivingEntity & VillagerDataContainer> TextureSupplier<T> create(TextureSupplier<T> fallback, TextureSupplier<String> formatter) {
Identifier egg = formatter.apply("silly_pony"); Identifier egg = formatter.apply("silly_pony");
Identifier egg2 = formatter.apply("tiny_silly_pony"); Identifier egg2 = formatter.apply("tiny_silly_pony");
return entity -> isBestPony(entity) ? (entity.isBaby() ? egg2 : egg) : fallback.apply(entity); return entity -> {
return isBestPony(entity) ? ("Dinky".equals(entity.getCustomName().getString()) ? egg2 : egg) : fallback.apply(entity);
};
} }
public static boolean isBestPony(LivingEntity entity) { public static boolean isBestPony(LivingEntity entity) {
@ -16,7 +18,7 @@ public class SillyPonyTextureSupplier {
return false; return false;
} }
String name = entity.getCustomName().getString(); String name = entity.getCustomName().getString();
return "Derpy".equals(name) || (entity.isBaby() && "Dinky".equals(name)); return "Derpy".equals(name) || "Dinky".equals(name);
} }
public static boolean isCrownPony(LivingEntity entity) { public static boolean isCrownPony(LivingEntity entity) {