Fixed villagers' saddlebags interfering with their wings
|
@ -24,11 +24,14 @@ abstract class AbstractNpcRenderer<T extends MobEntity & VillagerDataContainer>
|
||||||
|
|
||||||
private final Map<Race, ModelWrapper<T, ClientPonyModel<T>>> models = new HashMap<>();
|
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) {
|
public AbstractNpcRenderer(EntityRendererFactory.Context context, String type, TextureSupplier<String> formatter) {
|
||||||
super(context, ModelType.getPlayerModel(Race.EARTH).getKey(false));
|
super(context, ModelType.getPlayerModel(Race.EARTH).getKey(false));
|
||||||
entityType = type;
|
entityType = type;
|
||||||
baseTextures = new PonyTextures<>(formatter);
|
baseTextures = new PonyTextures<>(formatter);
|
||||||
addFeature(new NpcClothingFeature<>(this, entityType));
|
clothing = new NpcClothingFeature<>(this, entityType);
|
||||||
|
addFeature(clothing);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -73,7 +76,7 @@ abstract class AbstractNpcRenderer<T extends MobEntity & VillagerDataContainer>
|
||||||
@Override
|
@Override
|
||||||
public Identifier getDefaultTexture(T villager, Wearable wearable) {
|
public Identifier getDefaultTexture(T villager, Wearable wearable) {
|
||||||
if (wearable == Wearable.SADDLE_BAGS) {
|
if (wearable == Wearable.SADDLE_BAGS) {
|
||||||
return NpcClothingFeature.getClothingTexture(villager, entityType);
|
return clothing.createTexture(villager, "accessory");
|
||||||
}
|
}
|
||||||
return super.getDefaultTexture(villager, wearable);
|
return super.getDefaultTexture(villager, wearable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,14 +45,21 @@ class NpcClothingFeature<
|
||||||
entityType = type;
|
entityType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated(forRemoval = true)
|
||||||
public static Identifier getClothingTexture(VillagerDataContainer entity, String entityType) {
|
public static Identifier getClothingTexture(VillagerDataContainer entity, String entityType) {
|
||||||
VillagerProfession profession = entity.getVillagerData().getProfession();
|
VillagerProfession profession = entity.getVillagerData().getProfession();
|
||||||
|
|
||||||
return createTexture("minelittlepony", entityType, "profession", Registry.VILLAGER_PROFESSION.getId(profession));
|
return createTexture("minelittlepony", entityType, "profession", Registry.VILLAGER_PROFESSION.getId(profession));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Identifier createTexture(String namespace, String entityType, String category, Identifier identifier) {
|
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, identifier.getPath()));
|
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) {
|
public Identifier createTexture(String category, Identifier identifier) {
|
||||||
|
|
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 12 KiB |