use of net.minecraft.client.renderer.entity.layers.LayerCape in project EnderIO by SleepyTrousers.
the class UpgradeRenderManager method replaceCapeLayer.
private static void replaceCapeLayer(@Nonnull RenderPlayer renderLivingBase) {
try {
List<LayerRenderer<AbstractClientPlayer>> value = ReflectionHelper.getPrivateValue(RenderLivingBase.class, renderLivingBase, "layerRenderers", "field_177097_h");
if (value != null) {
LayerRenderer<AbstractClientPlayer> capeLayer = null;
for (LayerRenderer<AbstractClientPlayer> layerRenderer : value) {
if (layerRenderer instanceof LayerCape && !(layerRenderer instanceof CapeFilterLayer)) {
capeLayer = layerRenderer;
break;
}
}
if (capeLayer != null) {
renderLivingBase.addLayer(new CapeFilterLayer(capeLayer));
value.remove(capeLayer);
}
}
} catch (UnableToAccessFieldException e) {
Log.warn("Unable to access RenderLivingBase.layerRenderers, reason: " + e);
}
}
Aggregations