mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 15:37:59 +01:00
Remove the c/p to prevent future errors
This commit is contained in:
parent
a4e329d7fa
commit
e2b6075fb6
2 changed files with 29 additions and 36 deletions
|
@ -2,15 +2,12 @@ package com.minelittlepony.hdskins.gui;
|
|||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.BodyPart;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.minelittlepony.model.capabilities.IModel;
|
||||
import com.minelittlepony.model.components.PonyElytra;
|
||||
import com.minelittlepony.model.player.PlayerModels;
|
||||
import com.minelittlepony.pony.data.Pony;
|
||||
import com.minelittlepony.pony.data.PonyRace;
|
||||
import com.minelittlepony.render.RenderPony;
|
||||
import com.minelittlepony.render.layer.AbstractPonyLayer;
|
||||
import com.minelittlepony.render.layer.LayerPonyElytra;
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
import com.voxelmodpack.hdskins.gui.RenderPlayerModel;
|
||||
|
||||
|
@ -21,9 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
|
@ -98,35 +92,25 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> implemen
|
|||
|
||||
@Override
|
||||
protected LayerRenderer<EntityLivingBase> getElytraLayer() {
|
||||
return new AbstractPonyLayer<EntityPonyModel>(this) {
|
||||
final PonyElytra ponyElytra = new PonyElytra();
|
||||
final ModelElytra modelElytra = new ModelElytra();
|
||||
return new LayerPonyElytra<EntityPonyModel>(this) {
|
||||
private final ModelElytra modelElytra = new ModelElytra();
|
||||
|
||||
@Override
|
||||
public void doPonyRender(EntityPonyModel entity, float move, float swing, float partialTicks, float ticks, float headYaw, float headPitch, float scale) {
|
||||
ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
|
||||
if (itemstack.getItem() == Items.ELYTRA) {
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
|
||||
bindTexture(entity.getLocal(Type.ELYTRA).getTexture());
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
ModelBase model = renderingAsHuman ? modelElytra : ponyElytra;
|
||||
|
||||
if (!renderingAsHuman) {
|
||||
((IModel)getMainModel()).transform(BodyPart.BODY);
|
||||
GlStateManager.translate(0, ((IModel)getMainModel()).getRiderYOffset(), 0.125F);
|
||||
}
|
||||
|
||||
model.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);
|
||||
model.render(entity, move, swing, ticks, headYaw, headPitch, scale);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
protected void preRenderCallback() {
|
||||
if (!renderingAsHuman) {
|
||||
super.preRenderCallback();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ModelBase getElytraModel() {
|
||||
return renderingAsHuman ? modelElytra : super.getElytraModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getElytraTexture(EntityPonyModel entity) {
|
||||
return entity.getLocal(Type.ELYTRA).getTexture();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.minelittlepony.model.BodyPart;
|
|||
import com.minelittlepony.model.components.PonyElytra;
|
||||
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
|
||||
|
@ -35,20 +36,28 @@ public class LayerPonyElytra<T extends EntityLivingBase> extends AbstractPonyLay
|
|||
getRenderer().bindTexture(getElytraTexture(entity));
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0, getPlayerModel().getRiderYOffset(), 0.125F);
|
||||
getPlayerModel().transform(BodyPart.BODY);
|
||||
preRenderCallback();
|
||||
|
||||
modelElytra.setRotationAngles(move, swing, ticks, yaw, head, scale, entity);
|
||||
modelElytra.render(entity, move, swing, ticks, yaw, head, scale);
|
||||
getElytraModel().setRotationAngles(move, swing, ticks, yaw, head, scale, entity);
|
||||
getElytraModel().render(entity, move, swing, ticks, yaw, head, scale);
|
||||
|
||||
if (itemstack.isItemEnchanted()) {
|
||||
LayerArmorBase.renderEnchantedGlint(getRenderer(), entity, modelElytra, move, swing, partialTicks, ticks, yaw, head, scale);
|
||||
LayerArmorBase.renderEnchantedGlint(getRenderer(), entity, getElytraModel(), move, swing, partialTicks, ticks, yaw, head, scale);
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected void preRenderCallback() {
|
||||
GlStateManager.translate(0, getPlayerModel().getRiderYOffset(), 0.125F);
|
||||
getPlayerModel().transform(BodyPart.BODY);
|
||||
}
|
||||
|
||||
protected ModelBase getElytraModel() {
|
||||
return modelElytra;
|
||||
}
|
||||
|
||||
protected ResourceLocation getElytraTexture(T entity) {
|
||||
if (entity instanceof AbstractClientPlayer) {
|
||||
AbstractClientPlayer player = (AbstractClientPlayer) entity;
|
||||
|
|
Loading…
Reference in a new issue