Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MinecraftForge
GitHub Repository: MinecraftForge/MinecraftForge
Path: blob/1.21.x/patches/minecraft/net/minecraft/client/renderer/blockentity/SkullBlockRenderer.java.patch
7710 views
1
--- a/net/minecraft/client/renderer/blockentity/SkullBlockRenderer.java
2
+++ b/net/minecraft/client/renderer/blockentity/SkullBlockRenderer.java
3
@@ -36,6 +_,7 @@
4
5
@OnlyIn(Dist.CLIENT)
6
public class SkullBlockRenderer implements BlockEntityRenderer<SkullBlockEntity, SkullBlockRenderState> {
7
+ private static Map<SkullBlock.Type, Function<EntityModelSet, SkullModelBase>> customModels;
8
private final Function<SkullBlock.Type, SkullModelBase> modelByType;
9
public static final Map<SkullBlock.Type, ResourceLocation> SKIN_BY_TYPE = Util.make(Maps.newHashMap(), p_340906_ -> {
10
p_340906_.put(SkullBlock.Types.SKELETON, ResourceLocation.withDefaultNamespace("textures/entity/skeleton/skeleton.png"));
11
@@ -61,7 +_,9 @@
12
case PIGLIN -> new PiglinHeadModel(p_376421_.bakeLayer(ModelLayers.PIGLIN_HEAD));
13
});
14
} else {
15
- return null;
16
+ if (customModels == null)
17
+ customModels = net.minecraftforge.client.event.ForgeEventFactoryClient.onCreateSkullModels();
18
+ return customModels.getOrDefault(p_377655_, k -> null).apply(p_376421_);
19
}
20
}
21
22
23