mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Added some more guardian variants
This commit is contained in:
parent
891aa73254
commit
385d09e0f5
5 changed files with 8 additions and 2 deletions
|
@ -32,11 +32,11 @@ public class SeaponyRenderer extends GuardianEntityRenderer {
|
|||
}
|
||||
|
||||
public static SeaponyRenderer guardian(EntityRendererFactory.Context context) {
|
||||
return new SeaponyRenderer(context, TextureSupplier.ofPool(SEAPONY_TEXTURES, TextureSupplier.of(SEAPONY)), 1);
|
||||
return new SeaponyRenderer(context, TextureSupplier.ofVariations(SEAPONY_TEXTURES, TextureSupplier.of(SEAPONY)), 1);
|
||||
}
|
||||
|
||||
public static SeaponyRenderer elder(EntityRendererFactory.Context context) {
|
||||
return new SeaponyRenderer(context, TextureSupplier.ofPool(ELDER_SEAPONY_TEXTURES, TextureSupplier.of(SEAPONY)), ElderGuardianEntity.SCALE);
|
||||
return new SeaponyRenderer(context, TextureSupplier.ofVariations(ELDER_SEAPONY_TEXTURES, TextureSupplier.of(ELDER_SEAPONY)), ElderGuardianEntity.SCALE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,12 @@ public interface TextureSupplier<T> extends Function<T, Identifier> {
|
|||
return key -> new Identifier(domain, String.format(path, key));
|
||||
}
|
||||
|
||||
static <T extends LivingEntity> TextureSupplier<T> ofVariations(Identifier poolId, TextureSupplier<T> fallback) {
|
||||
return entity -> {
|
||||
return MineLittlePony.getInstance().getVariatedTextures().get(poolId).getId(entity.getUuid()).orElse(fallback.apply(entity));
|
||||
};
|
||||
}
|
||||
|
||||
static <T extends LivingEntity> TextureSupplier<T> ofPool(Identifier poolId, TextureSupplier<T> fallback) {
|
||||
final Function<T, Identifier> cache = FunctionUtil.memoize(entity -> {
|
||||
return MineLittlePony.getInstance().getVariatedTextures()
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 9.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
Loading…
Reference in a new issue