From 6c0542ff89787f39e223d755d82b1adc04b97172 Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Mon, 26 Dec 2016 20:58:21 -0500 Subject: [PATCH] Fix rendering issues with elytra flight --- .../mixin/MixinRenderPlayer.java | 19 +++++++++---------- .../model/pony/ModelPlayerPony.java | 9 ++------- .../renderer/layer/LayerPonyElytra.java | 6 ++++-- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/minelittlepony/mixin/MixinRenderPlayer.java b/src/main/java/com/minelittlepony/mixin/MixinRenderPlayer.java index d1685c4f..c84b5329 100644 --- a/src/main/java/com/minelittlepony/mixin/MixinRenderPlayer.java +++ b/src/main/java/com/minelittlepony/mixin/MixinRenderPlayer.java @@ -8,11 +8,7 @@ import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.pony.ModelHumanPlayer; import com.minelittlepony.model.pony.ModelPlayerPony; -import com.minelittlepony.renderer.layer.LayerHeldPonyItem; -import com.minelittlepony.renderer.layer.LayerPonyArmor; -import com.minelittlepony.renderer.layer.LayerPonyCape; -import com.minelittlepony.renderer.layer.LayerPonyElytra; -import com.minelittlepony.renderer.layer.LayerPonySkull; +import com.minelittlepony.renderer.layer.*; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelRenderer; @@ -32,8 +28,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import static net.minecraft.client.renderer.GlStateManager.scale; - @Mixin(RenderPlayer.class) public abstract class MixinRenderPlayer extends RenderLivingBase implements IRenderPony { @@ -43,6 +37,7 @@ public abstract class MixinRenderPlayer extends RenderLivingBase { private static final ResourceLocation TEXTURE_ELYTRA = new ResourceLocation("textures/entity/elytra.png"); @@ -31,7 +33,7 @@ public class LayerPonyElytra implements LayerRenderer { } @Override - public void doRenderLayer(AbstractClientPlayer entity, float swing, float swingAmount, float ticks, float age, float yaw, float head, float scale) { + public void doRenderLayer(@Nonnull AbstractClientPlayer entity, float swing, float swingAmount, float ticks, float age, float yaw, float head, float scale) { AbstractPonyModel model = ((IRenderPony) this.renderPlayer).getPony().getModel(); if (model instanceof ModelHumanPlayer) { @@ -41,7 +43,7 @@ public class LayerPonyElytra implements LayerRenderer { ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.CHEST); - if (itemstack != null && itemstack.getItem() == Items.ELYTRA) { + if (itemstack.getItem() == Items.ELYTRA) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if (entity.isPlayerInfoSet() && entity.getLocationElytra() != null) {