mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Fixed crash when viewing a villager or witch that does not have a custom name
This commit is contained in:
parent
e6da9aceca
commit
f7a92ea3e9
4 changed files with 16 additions and 12 deletions
|
@ -28,7 +28,7 @@ public class ModelVillagerPony<T extends LivingEntity & VillagerDataContainer> e
|
|||
@Override
|
||||
public void animateModel(T entity, float limbSwing, float limbSwingAmount, float partialTickTime) {
|
||||
profession = entity.getVillagerData().getProfession();
|
||||
special = "Derpy".equals(entity.getCustomName().getString());
|
||||
special = entity.hasCustomName() && "Derpy".equals(entity.getCustomName().getString());
|
||||
special2 = special && entity.getUuid().getLeastSignificantBits() % 20 == 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ public class ModelWitchPony extends ModelZebra<WitchEntity> {
|
|||
public void updateLivingState(WitchEntity entity, IPony pony) {
|
||||
super.updateLivingState(entity, pony);
|
||||
|
||||
if ("Filly".equals(entity.getCustomName().getString())) {
|
||||
if (entity.hasCustomName() && "Filly".equals(entity.getCustomName().getString())) {
|
||||
isChild = true;
|
||||
}
|
||||
leftArmPose = ArmPose.EMPTY;
|
||||
|
|
|
@ -32,12 +32,14 @@ public class RenderPonyVillager extends RenderPonyMob.Caster<VillagerEntity, Mod
|
|||
|
||||
@Override
|
||||
public Identifier findTexture(VillagerEntity entity) {
|
||||
String name = entity.getCustomName().getString();
|
||||
if ("Derpy".equals(name) || (entity.isBaby() && "Dinky".equals(name))) {
|
||||
if (entity.isBaby()) {
|
||||
return EGG_2;
|
||||
if (entity.hasCustomName()) {
|
||||
String name = entity.getCustomName().getString();
|
||||
if ("Derpy".equals(name) || (entity.isBaby() && "Dinky".equals(name))) {
|
||||
if (entity.isBaby()) {
|
||||
return EGG_2;
|
||||
}
|
||||
return EGG;
|
||||
}
|
||||
return EGG;
|
||||
}
|
||||
|
||||
return PROFESSIONS.supplyTexture(entity.getVillagerData());
|
||||
|
|
|
@ -25,12 +25,14 @@ public class RenderPonyZombieVillager extends RenderPonyMob.Caster<ZombieVillage
|
|||
|
||||
@Override
|
||||
public Identifier findTexture(ZombieVillagerEntity entity) {
|
||||
String name = entity.getCustomName().getString();
|
||||
if ("Derpy".equals(name) || (entity.isBaby() && "Dinky".equals(name))) {
|
||||
if (entity.isBaby()) {
|
||||
return EGG_2;
|
||||
if (entity.hasCustomName()) {
|
||||
String name = entity.getCustomName().getString();
|
||||
if ("Derpy".equals(name) || (entity.isBaby() && "Dinky".equals(name))) {
|
||||
if (entity.isBaby()) {
|
||||
return EGG_2;
|
||||
}
|
||||
return EGG;
|
||||
}
|
||||
return EGG;
|
||||
}
|
||||
|
||||
return PROFESSIONS.supplyTexture(entity.getVillagerData());
|
||||
|
|
Loading…
Reference in a new issue