Industrial Foregoing

Industrial Foregoing

95M Downloads

PlayerRenderer ClassCastException

Cheaterpaul opened this issue ยท 0 comments

commented

Minecraft: 1.20.1
NeoForge: 47.1.79
Industrial Foregoing: 3.5.15
Vampirism: 1.20.1-1.10.6
Werewolves: 2.0.0.0-beta2

Crash Report: https://pastebin.com/raw/8pj1G9Nu

public static void addLayers(EntityRenderersEvent.AddLayers event) {
for (String skin : event.getSkins()) {
PlayerRenderer renderer = event.getSkin(skin);
renderer.addLayer(new ContributorsCatEarsRender(renderer));
renderer.addLayer(new InfinityLauncherProjectileArmorLayer(renderer));
}
}

I am not sure why this works without a manual cast but the EntityRenderersEvent#AddLayers method gives you a LivingEntityRenderer<? extends Player, ? extends EntityModel<? extends Player>> which is not necessarily of type PlayerRenderer. This will cause problems if mods want to render the player with a different renderer, like TeamLapen/Werewolves#178