mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 20:47:59 +01:00
Fix capes showing while elytra is worn
This commit is contained in:
parent
e87c550f2b
commit
f5c2fe7045
1 changed files with 12 additions and 15 deletions
|
@ -10,8 +10,12 @@ import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||||
import net.minecraft.client.renderer.entity.layers.LayerCape;
|
import net.minecraft.client.renderer.entity.layers.LayerCape;
|
||||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||||
import net.minecraft.entity.player.EnumPlayerModelParts;
|
import net.minecraft.entity.player.EnumPlayerModelParts;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
|
|
||||||
public class LayerPonyCape implements LayerRenderer<AbstractClientPlayer> {
|
public class LayerPonyCape implements LayerRenderer<AbstractClientPlayer> {
|
||||||
|
@ -25,27 +29,22 @@ public class LayerPonyCape implements LayerRenderer<AbstractClientPlayer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doRenderLayer(AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6,
|
public void doRenderLayer(@Nonnull AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6, float p7, float scale) {
|
||||||
float p7, float scale) {
|
|
||||||
PlayerModel model = ((IRenderPony) renderer).getPony();
|
PlayerModel model = ((IRenderPony) renderer).getPony();
|
||||||
if (model.getModel() instanceof ModelHumanPlayer) {
|
if (model.getModel() instanceof ModelHumanPlayer) {
|
||||||
cape.doRenderLayer(clientPlayer, p2, p3, ticks, p5, p6, p7, scale);
|
cape.doRenderLayer(clientPlayer, p2, p3, ticks, p5, p6, p7, scale);
|
||||||
} else if (clientPlayer.hasPlayerInfo() && !clientPlayer.isInvisible()
|
} else if (clientPlayer.hasPlayerInfo() && !clientPlayer.isInvisible()
|
||||||
&& clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null) {
|
&& clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null
|
||||||
|
&& clientPlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() != Items.ELYTRA) {
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
model.getModel().transform(BodyPart.BODY);
|
model.getModel().transform(BodyPart.BODY);
|
||||||
translate(0.0F, 0.24F, 0.0F);
|
translate(0.0F, 0.24F, 0.0F);
|
||||||
model.getModel().bipedBody.postRender(scale);
|
model.getModel().bipedBody.postRender(scale);
|
||||||
|
|
||||||
double d = clientPlayer.prevChasingPosX + (clientPlayer.chasingPosX - clientPlayer.prevChasingPosX) * scale
|
double d = clientPlayer.prevChasingPosX + (clientPlayer.chasingPosX - clientPlayer.prevChasingPosX) * scale - (clientPlayer.prevPosX + (clientPlayer.posX - clientPlayer.prevPosX) * scale);
|
||||||
- (clientPlayer.prevPosX + (clientPlayer.posX - clientPlayer.prevPosX) * scale);
|
double d1 = clientPlayer.prevChasingPosY + (clientPlayer.chasingPosY - clientPlayer.prevChasingPosY) * scale - (clientPlayer.prevPosY + (clientPlayer.posY - clientPlayer.prevPosY) * scale);
|
||||||
double d1 = clientPlayer.prevChasingPosY + (clientPlayer.chasingPosY - clientPlayer.prevChasingPosY) * scale
|
double d2 = clientPlayer.prevChasingPosZ + (clientPlayer.chasingPosZ - clientPlayer.prevChasingPosZ) * scale - (clientPlayer.prevPosZ + (clientPlayer.posZ - clientPlayer.prevPosZ) * scale);
|
||||||
- (clientPlayer.prevPosY + (clientPlayer.posY - clientPlayer.prevPosY) * scale);
|
float f10 = clientPlayer.prevRenderYawOffset + (clientPlayer.renderYawOffset - clientPlayer.prevRenderYawOffset) * scale;
|
||||||
double d2 = clientPlayer.prevChasingPosZ + (clientPlayer.chasingPosZ - clientPlayer.prevChasingPosZ) * scale
|
|
||||||
- (clientPlayer.prevPosZ + (clientPlayer.posZ - clientPlayer.prevPosZ) * scale);
|
|
||||||
float f10 = clientPlayer.prevRenderYawOffset
|
|
||||||
+ (clientPlayer.renderYawOffset - clientPlayer.prevRenderYawOffset) * scale;
|
|
||||||
double d3 = MathHelper.sin(f10 * 3.1415927F / 180.0F);
|
double d3 = MathHelper.sin(f10 * 3.1415927F / 180.0F);
|
||||||
double d4 = (-MathHelper.cos(f10 * 3.1415927F / 180.0F));
|
double d4 = (-MathHelper.cos(f10 * 3.1415927F / 180.0F));
|
||||||
float f12 = (float) d1 * 10.0F;
|
float f12 = (float) d1 * 10.0F;
|
||||||
|
@ -64,9 +63,7 @@ public class LayerPonyCape implements LayerRenderer<AbstractClientPlayer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
float f15 = clientPlayer.prevCameraYaw + (clientPlayer.cameraYaw - clientPlayer.prevCameraYaw) * scale;
|
float f15 = clientPlayer.prevCameraYaw + (clientPlayer.cameraYaw - clientPlayer.prevCameraYaw) * scale;
|
||||||
f12 += MathHelper.sin((clientPlayer.prevDistanceWalkedModified
|
f12 += MathHelper.sin((clientPlayer.prevDistanceWalkedModified + (clientPlayer.distanceWalkedModified - clientPlayer.prevDistanceWalkedModified) * scale) * 6.0F) * 32.0F * f15;
|
||||||
+ (clientPlayer.distanceWalkedModified - clientPlayer.prevDistanceWalkedModified) * scale) * 6.0F)
|
|
||||||
* 32.0F * f15;
|
|
||||||
|
|
||||||
rotate(2.0F + f13 / 12.0F + f12, 1.0F, 0.0F, 0.0F);
|
rotate(2.0F + f13 / 12.0F + f12, 1.0F, 0.0F, 0.0F);
|
||||||
rotate(f14 / 2.0F, 0.0F, 0.0F, 1.0F);
|
rotate(f14 / 2.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
|
Loading…
Reference in a new issue