Fixed villagers' saddlebags interfering with their wings

This commit is contained in:
Sollace 2022-11-02 22:33:11 +01:00
parent ff9510a840
commit ca9cf43ef5
34 changed files with 14 additions and 4 deletions

View file

@ -24,11 +24,14 @@ abstract class AbstractNpcRenderer<T extends MobEntity & VillagerDataContainer>
private final Map<Race, ModelWrapper<T, ClientPonyModel<T>>> models = new HashMap<>();
private final NpcClothingFeature<T, ClientPonyModel<T>, AbstractNpcRenderer<T>> clothing;
public AbstractNpcRenderer(EntityRendererFactory.Context context, String type, TextureSupplier<String> formatter) {
super(context, ModelType.getPlayerModel(Race.EARTH).getKey(false));
entityType = type;
baseTextures = new PonyTextures<>(formatter);
addFeature(new NpcClothingFeature<>(this, entityType));
clothing = new NpcClothingFeature<>(this, entityType);
addFeature(clothing);
}
@Override
@ -73,7 +76,7 @@ abstract class AbstractNpcRenderer<T extends MobEntity & VillagerDataContainer>
@Override
public Identifier getDefaultTexture(T villager, Wearable wearable) {
if (wearable == Wearable.SADDLE_BAGS) {
return NpcClothingFeature.getClothingTexture(villager, entityType);
return clothing.createTexture(villager, "accessory");
}
return super.getDefaultTexture(villager, wearable);
}

View file

@ -45,14 +45,21 @@ class NpcClothingFeature<
entityType = type;
}
@Deprecated(forRemoval = true)
public static Identifier getClothingTexture(VillagerDataContainer entity, String entityType) {
VillagerProfession profession = entity.getVillagerData().getProfession();
return createTexture("minelittlepony", entityType, "profession", Registry.VILLAGER_PROFESSION.getId(profession));
}
public static Identifier createTexture(String namespace, String entityType, String category, Identifier identifier) {
return new Identifier(namespace, String.format("textures/entity/%s/%s/%s.png", entityType, category, identifier.getPath()));
public static Identifier createTexture(String namespace, String entityType, String category, Identifier profession) {
return new Identifier(namespace, String.format("textures/entity/%s/%s/%s.png", entityType, category, profession.getPath()));
}
public Identifier createTexture(VillagerDataContainer entity, String category) {
VillagerProfession profession = entity.getVillagerData().getProfession();
return createTexture(category, Registry.VILLAGER_PROFESSION.getId(profession));
}
public Identifier createTexture(String category, Identifier identifier) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB