Sushi Go Crafting

Sushi Go Crafting

8M Downloads

PlayerRenderer ClassCastException

Cheaterpaul opened this issue ยท 0 comments

commented

Minecraft: 1.20.1
NeoForge: 47.1.79
Titanium: 3.8.25
Sushi Go Crafting: 0.5.1
Vampirism: 1.20.1-1.10.6
Werewolves: 2.0.0.0-beta2

Crash Report: https://pastebin.com/raw/Cgq7BqgN

EventManager.mod(EntityRenderersEvent.AddLayers.class).process(event -> {
for (String skin : event.getSkins()) {
PlayerRenderer renderer = event.getSkin(skin);
renderer.addLayer(new ContributorsBackRender(renderer));
}
}).subscribe();

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