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); } }
public RenderPlayer(RenderManager renderManager, boolean useSmallArms) { super(renderManager, new ModelPlayer(0.0F, useSmallArms), 0.5F); this.smallArms = useSmallArms; this.addLayer(new LayerBipedArmor(this)); this.addLayer(new LayerHeldItem(this)); this.addLayer(new LayerArrow(this)); this.addLayer(new LayerDeadmau5Head(this)); this.addLayer(new LayerCape(this)); this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead)); }
public RenderPlayer(RenderManager renderManager, boolean useSmallArms) { super(renderManager, new ModelPlayer(0.0F, useSmallArms), 0.5F); this.smallArms = useSmallArms; this.addLayer(new LayerBipedArmor(this)); this.addLayer(new LayerHeldItem(this)); this.addLayer(new LayerArrow(this)); this.addLayer(new LayerDeadmau5Head(this)); this.addLayer(new LayerCape(this)); this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead)); this.addLayer(new LayerElytra(this)); }
public LayerPonyCape(RenderLivingBase<? extends AbstractClientPlayer> entity) { super(entity, new LayerCape((RenderPlayer) entity)); }
@Hook("net.minecraft.client.renderer.entity.layers.LayerCape#func_177141_a") public static Hook.Result doRenderLayer_cape(LayerCape layer, AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { return getFormLiving0(player).getItem() == Items.ELYTRA ? Hook.Result.NULL : Hook.Result.VOID; }