Files
MinecraftForge/patches/minecraft/net/minecraft/client/renderer/blockentity/SkullBlockRenderer.java.patch
T
d50a3b5ab7 Minecraft 1.21.5
Co-authored-by: Ven <[email protected]>
Co-authored-by: Jonathing <[email protected]>
2025-03-26 16:34:26 -07:00

22 lines
1.1 KiB
Diff

--- a/net/minecraft/client/renderer/blockentity/SkullBlockRenderer.java
+++ b/net/minecraft/client/renderer/blockentity/SkullBlockRenderer.java
@@ -34,6 +_,7 @@
@OnlyIn(Dist.CLIENT)
public class SkullBlockRenderer implements BlockEntityRenderer<SkullBlockEntity> {
+ private static Map<SkullBlock.Type, Function<EntityModelSet, SkullModelBase>> customModels;
private final Function<SkullBlock.Type, SkullModelBase> modelByType;
public static final Map<SkullBlock.Type, ResourceLocation> SKIN_BY_TYPE = Util.make(Maps.newHashMap(), p_340906_ -> {
p_340906_.put(SkullBlock.Types.SKELETON, ResourceLocation.withDefaultNamespace("textures/entity/skeleton/skeleton.png"));
@@ -58,7 +_,9 @@
case PIGLIN -> new PiglinHeadModel(p_376421_.bakeLayer(ModelLayers.PIGLIN_HEAD));
});
} else {
- return null;
+ if (customModels == null)
+ customModels = net.minecraftforge.client.event.ForgeEventFactoryClient.onCreateSkullModels();
+ return customModels.getOrDefault(p_377655_, k -> null).apply(p_376421_);
}
}