Clean up armor/armour, clean up villager models, more package changes

This commit is contained in:
Sollace 2018-04-25 16:40:47 +02:00
parent 403c195007
commit f151b31597
70 changed files with 709 additions and 954 deletions

View file

@ -1,21 +1,20 @@
package com.minelittlepony; package com.minelittlepony;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.minelittlepony.gui.PonySettingPanel;
import com.minelittlepony.hdskins.gui.GuiSkinsMineLP; import com.minelittlepony.hdskins.gui.GuiSkinsMineLP;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.pony.data.IPonyData; import com.minelittlepony.pony.data.IPonyData;
import com.minelittlepony.pony.data.PonyDataSerialzier; import com.minelittlepony.pony.data.PonyDataSerialzier;
import com.minelittlepony.renderer.RenderPonyEvoker; import com.minelittlepony.render.player.RenderPonyPlayer;
import com.minelittlepony.renderer.RenderPonyIllusionIllager; import com.minelittlepony.render.ponies.RenderPonyEvoker;
import com.minelittlepony.renderer.RenderPonyPigman; import com.minelittlepony.render.ponies.RenderPonyIllusionIllager;
import com.minelittlepony.renderer.RenderPonySkeleton; import com.minelittlepony.render.ponies.RenderPonyPigman;
import com.minelittlepony.renderer.RenderPonyVex; import com.minelittlepony.render.ponies.RenderPonySkeleton;
import com.minelittlepony.renderer.RenderPonyVillager; import com.minelittlepony.render.ponies.RenderPonyVex;
import com.minelittlepony.renderer.RenderPonyVindicator; import com.minelittlepony.render.ponies.RenderPonyVillager;
import com.minelittlepony.renderer.RenderPonyZombie; import com.minelittlepony.render.ponies.RenderPonyVindicator;
import com.minelittlepony.renderer.RenderPonyZombieVillager; import com.minelittlepony.render.ponies.RenderPonyZombie;
import com.minelittlepony.renderer.player.RenderPonyPlayer; import com.minelittlepony.render.ponies.RenderPonyZombieVillager;
import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.core.LiteLoader;
import com.mumfrey.liteloader.util.ModUtilities; import com.mumfrey.liteloader.util.ModUtilities;
import com.voxelmodpack.hdskins.HDSkinManager; import com.voxelmodpack.hdskins.HDSkinManager;

View file

@ -1,7 +1,5 @@
package com.minelittlepony.gui; package com.minelittlepony;
import com.minelittlepony.MineLittlePony;
import com.minelittlepony.PonyConfig;
import com.minelittlepony.pony.data.PonyLevel; import com.minelittlepony.pony.data.PonyLevel;
import com.mumfrey.liteloader.client.gui.GuiCheckbox; import com.mumfrey.liteloader.client.gui.GuiCheckbox;
import com.mumfrey.liteloader.core.LiteLoader; import com.mumfrey.liteloader.core.LiteLoader;

View file

@ -1,8 +1,8 @@
package com.minelittlepony.ducks; package com.minelittlepony.ducks;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
public interface IRenderPony { public interface IRenderPony {
PlayerModel getPlayerModel(); ModelWrapper getPlayerModel();
} }

View file

@ -3,10 +3,10 @@ package com.minelittlepony.hdskins.gui;
import com.minelittlepony.MineLittlePony; import com.minelittlepony.MineLittlePony;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.ModelPonyElytra; import com.minelittlepony.model.ModelWrapper;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.components.PonyElytra;
import com.minelittlepony.pony.data.Pony; import com.minelittlepony.pony.data.Pony;
import com.minelittlepony.renderer.layer.AbstractPonyLayer; import com.minelittlepony.render.layer.AbstractPonyLayer;
import com.voxelmodpack.hdskins.gui.RenderPlayerModel; import com.voxelmodpack.hdskins.gui.RenderPlayerModel;
import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -33,7 +33,7 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
Pony thePony = MineLittlePony.getInstance().getManager().getPony(loc, playermodel.profile.getId()); Pony thePony = MineLittlePony.getInstance().getManager().getPony(loc, playermodel.profile.getId());
PlayerModel pm = thePony.getModel(true); ModelWrapper pm = thePony.getModel(true);
pm.apply(thePony.getMetadata()); pm.apply(thePony.getMetadata());
return pm.getModel(); return pm.getModel();
@ -42,7 +42,7 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
@Override @Override
protected LayerRenderer<EntityLivingBase> getElytraLayer() { protected LayerRenderer<EntityLivingBase> getElytraLayer() {
final LayerRenderer<EntityLivingBase> elytra = super.getElytraLayer(); final LayerRenderer<EntityLivingBase> elytra = super.getElytraLayer();
final ModelPonyElytra modelElytra = new ModelPonyElytra(); final PonyElytra modelElytra = new PonyElytra();
return new AbstractPonyLayer<EntityLivingBase>(this, elytra) { return new AbstractPonyLayer<EntityLivingBase>(this, elytra) {
@Override @Override

View file

@ -1,15 +0,0 @@
package com.minelittlepony.model;
import com.minelittlepony.pony.data.IPonyData;
public abstract class AbstractArmor {
public AbstractPonyModel modelArmorChestplate;
public AbstractPonyModel modelArmor;
public void apply(IPonyData meta) {
modelArmorChestplate.metadata = meta;
modelArmor.metadata = meta;
}
}

View file

@ -1,6 +1,7 @@
package com.minelittlepony.model; package com.minelittlepony.model;
import com.minelittlepony.model.pony.ModelPlayerPony; import com.minelittlepony.model.armour.PonyArmor;
import com.minelittlepony.model.ponies.ModelPlayerPony;
import com.minelittlepony.pony.data.IPonyData; import com.minelittlepony.pony.data.IPonyData;
import com.minelittlepony.pony.data.PonyData; import com.minelittlepony.pony.data.PonyData;
import com.minelittlepony.pony.data.PonySize; import com.minelittlepony.pony.data.PonySize;
@ -45,6 +46,8 @@ public abstract class AbstractPonyModel extends ModelPlayer {
this.initPositions(yOffset, stretch); this.initPositions(yOffset, stretch);
} }
public abstract PonyArmor createArmour();
protected abstract void initTextures(); protected abstract void initTextures();
protected abstract void initPositions(float yOffset, float stretch); protected abstract void initPositions(float yOffset, float stretch);
@ -76,6 +79,15 @@ public abstract class AbstractPonyModel extends ModelPlayer {
aRenderer.rotationPointZ += shiftZ; aRenderer.rotationPointZ += shiftZ;
} }
protected static void rotateArmHolding(ModelRenderer arm, float direction, float var8, float var9, float tick) {
arm.rotateAngleZ = 0.0F;
arm.rotateAngleY = direction * (0.1F - var8 * 0.6F);
arm.rotateAngleX = -1.5707964F;
arm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
arm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
arm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
}
public void transform(BodyPart part) { public void transform(BodyPart part) {
if (this.isRiding) { if (this.isRiding) {
translate(0.0F, -0.6F, -0.2F); translate(0.0F, -0.6F, -0.2F);

View file

@ -0,0 +1,46 @@
package com.minelittlepony.model;
import com.minelittlepony.model.ponies.ModelPlayerPony;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
public class ModelMobPony extends ModelPlayerPony {
public ModelMobPony() {
super(false);
}
@Override
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
super.rotateLegs(move, swing, tick, entity);
float var8 = MathHelper.sin(swingProgress * (float)Math.PI);
float var9 = MathHelper.sin((1 - (1 - swingProgress) * (1 - swingProgress)) * (float)Math.PI);
rotateRightArm(var8, var9, move, tick);
rotateLeftArm(var8, var9, move, tick);
}
protected void rotateRightArm(float var8, float var9, float move, float tick) {
if (this.rightArmPose == ArmPose.EMPTY) return;
if (!metadata.hasMagic()) {
rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
} else {
unicornArmRight.setRotationPoint(-7, 12, -2);
rotateArmHolding(unicornArmRight, 1, var8, var9, tick);
}
}
protected void rotateLeftArm(float var8, float var9, float move, float tick) {
if (leftArmPose == ArmPose.EMPTY) return;
if (!metadata.hasMagic()) {
rotateArmHolding(bipedLeftArm, 1, var8, var9, tick);
} else {
unicornArmRight.setRotationPoint(-7, 12, -2);
rotateArmHolding(unicornArmLeft, 1, var8, var9, tick);
}
}
}

View file

@ -1,33 +1,29 @@
package com.minelittlepony.model; package com.minelittlepony.model;
import com.minelittlepony.model.armour.PonyArmor;
import com.minelittlepony.pony.data.IPonyData; import com.minelittlepony.pony.data.IPonyData;
public class PlayerModel { public class ModelWrapper {
private final AbstractPonyModel model; private final AbstractPonyModel model;
private AbstractArmor armor; private final PonyArmor armor;
public PlayerModel(AbstractPonyModel model) { public ModelWrapper(AbstractPonyModel model) {
this.model = model; this.model = model;
this.armor = model.createArmour();
this.armor.apply(model.metadata);
} }
public AbstractPonyModel getModel() { public AbstractPonyModel getModel() {
return model; return model;
} }
public PlayerModel setArmor(AbstractArmor armor) {
this.armor = armor;
this.armor.apply(model.metadata);
return this;
}
public void init() { public void init() {
getModel().init(0, 0); model.init(0, 0);
getArmor().modelArmorChestplate.init(0.0F, 1.0F); armor.init();
getArmor().modelArmor.init(0.0F, 0.5F);
} }
public AbstractArmor getArmor() { public PonyArmor getArmor() {
return armor; return armor;
} }

View file

@ -1,35 +1,36 @@
package com.minelittlepony.model; package com.minelittlepony.model;
import com.minelittlepony.model.pony.ModelHumanPlayer; import com.minelittlepony.model.ponies.ModelHumanPlayer;
import com.minelittlepony.model.pony.ModelIllagerPony; import com.minelittlepony.model.ponies.ModelIllagerPony;
import com.minelittlepony.model.pony.ModelPlayerPony; import com.minelittlepony.model.ponies.ModelPlayerPony;
import com.minelittlepony.model.pony.ModelSkeletonPony; import com.minelittlepony.model.ponies.ModelSkeletonPony;
import com.minelittlepony.model.pony.ModelVillagerPony; import com.minelittlepony.model.ponies.ModelVillagerPony;
import com.minelittlepony.model.pony.ModelZombiePony; import com.minelittlepony.model.ponies.ModelZombiePony;
import com.minelittlepony.model.pony.armor.HumanArmors;
import com.minelittlepony.model.pony.armor.PonyArmors;
import com.minelittlepony.model.pony.armor.SkeletonPonyArmors;
import com.minelittlepony.model.pony.armor.ZombiePonyArmors;
import java.lang.reflect.Field; import java.lang.reflect.Field;
/**
* PMAPI - Pony Models API?
*
*/
public final class PMAPI { public final class PMAPI {
public static final PlayerModel pony = new PlayerModel(new ModelPlayerPony(false)).setArmor(new PonyArmors()); public static final ModelWrapper
public static final PlayerModel ponySmall = new PlayerModel(new ModelPlayerPony(true)).setArmor(new PonyArmors()); pony = new ModelWrapper(new ModelPlayerPony(false)),
ponySmall = new ModelWrapper(new ModelPlayerPony(true)),
public static final PlayerModel human = new PlayerModel(new ModelHumanPlayer(false)).setArmor(new HumanArmors()); human = new ModelWrapper(new ModelHumanPlayer(false)),
public static final PlayerModel humanSmall = new PlayerModel(new ModelHumanPlayer(true)).setArmor(new HumanArmors()); humanSmall = new ModelWrapper(new ModelHumanPlayer(true)),
public static final PlayerModel zombie = new PlayerModel(new ModelZombiePony()).setArmor(new ZombiePonyArmors()); zombie = new ModelWrapper(new ModelZombiePony()),
public static final PlayerModel skeleton = new PlayerModel(new ModelSkeletonPony()).setArmor(new SkeletonPonyArmors()); skeleton = new ModelWrapper(new ModelSkeletonPony()),
public static final PlayerModel villager = new PlayerModel(new ModelVillagerPony()).setArmor(new PonyArmors()); villager = new ModelWrapper(new ModelVillagerPony()),
public static final PlayerModel illager = new PlayerModel(new ModelIllagerPony()).setArmor(new PonyArmors()); illager = new ModelWrapper(new ModelIllagerPony());
public static void init() { public static void init() {
for (Field field : PMAPI.class.getFields()) { for (Field field : PMAPI.class.getFields()) {
try { try {
PlayerModel model = (PlayerModel) field.get(null); ModelWrapper model = (ModelWrapper) field.get(null);
model.init(); model.init();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View file

@ -1,79 +1,30 @@
package com.minelittlepony.model.pony.armor; package com.minelittlepony.model.armour;
import com.minelittlepony.model.pony.ModelPlayerPony;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.*; import static com.minelittlepony.model.PonyModelConstants.*;
public class ModelPonyArmor extends ModelPlayerPony { import com.minelittlepony.model.ModelMobPony;
public ModelRenderer Bodypiece; public class ModelPonyArmor extends ModelMobPony {
public ModelRenderer extBody;
public ModelRenderer[] extHead; public ModelRenderer Bodypiece, extBody;
public ModelRenderer[] extLegs; public ModelRenderer[] extHead, extLegs;
public ModelPonyArmor() { public ModelPonyArmor() {
super(false); super();
this.textureHeight = 32; this.textureHeight = 32;
} }
@Override @Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { protected void rotateLook(float limbSwing, float limbSwingAmount, float bodySwing, float ticks) {
this.bipedBody.rotateAngleY = bodySwing * 0.2F;
this.checkRainboom(entityIn, limbSwingAmount); }
this.rotateHead(netHeadYaw, headPitch);
float bodySwingRotation = 0.0F;
if (this.swingProgress > -9990.0F && !this.metadata.hasMagic()) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
}
this.bipedBody.rotateAngleY = bodySwingRotation * 0.2F;
this.setLegs(limbSwing, limbSwingAmount, ageInTicks, entityIn);
this.holdItem(limbSwingAmount);
this.swingItem(entityIn, this.swingProgress);
if (this.isSneak && !this.isFlying) {
this.adjustBody(BODY_ROTATE_ANGLE_X_SNEAK, BODY_RP_Y_SNEAK, BODY_RP_Z_SNEAK);
this.sneakLegs();
this.setHead(0.0F, 6.0F, -2.0F);
} else if (this.isRiding) {
this.adjustBody(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
this.bipedLeftLeg.rotationPointZ = 15;
this.bipedLeftLeg.rotationPointY = 10;
this.bipedLeftLeg.rotateAngleX = (float) (Math.PI * -0.25);
this.bipedLeftLeg.rotateAngleY = (float) (Math.PI * -0.2);
this.bipedRightLeg.rotationPointZ = 15;
this.bipedRightLeg.rotationPointY = 10;
this.bipedRightLeg.rotateAngleX = (float) (Math.PI * -0.25);
this.bipedRightLeg.rotateAngleY = (float) (Math.PI * 0.2);
this.bipedLeftArm.rotateAngleZ = (float) (Math.PI * -0.06);
this.bipedRightArm.rotateAngleZ = (float) (Math.PI * 0.06);
} else {
this.adjustBody(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK);
this.bipedRightLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK;
this.bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK;
this.swingArms(ageInTicks);
this.setHead(0.0F, 0.0F, 0.0F);
}
if (this.isSleeping) {
this.ponySleep();
}
this.aimBow(leftArmPose, rightArmPose, ageInTicks);
@Override
protected void adjustBodyRiding() {
this.adjustBody(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
} }
@Override @Override
@ -102,9 +53,11 @@ public class ModelPonyArmor extends ModelPlayerPony {
this.bipedBody.rotateAngleX = rotateAngleX; this.bipedBody.rotateAngleX = rotateAngleX;
this.bipedBody.rotationPointY = rotationPointY; this.bipedBody.rotationPointY = rotationPointY;
this.bipedBody.rotationPointZ = rotationPointZ; this.bipedBody.rotationPointZ = rotationPointZ;
this.Bodypiece.rotateAngleX = rotateAngleX; this.Bodypiece.rotateAngleX = rotateAngleX;
this.Bodypiece.rotationPointY = rotationPointY; this.Bodypiece.rotationPointY = rotationPointY;
this.Bodypiece.rotationPointZ = rotationPointZ; this.Bodypiece.rotationPointZ = rotationPointZ;
this.extBody.rotateAngleX = rotateAngleX; this.extBody.rotateAngleX = rotateAngleX;
this.extBody.rotationPointY = rotationPointY; this.extBody.rotationPointY = rotationPointY;
this.extBody.rotationPointZ = rotationPointZ; this.extBody.rotationPointZ = rotationPointZ;
@ -194,32 +147,36 @@ public class ModelPonyArmor extends ModelPlayerPony {
@Override @Override
protected void initHeadPositions(float yOffset, float stretch) { protected void initHeadPositions(float yOffset, float stretch) {
this.bipedHead.addBox(-4.0F + HEAD_CENTRE_X, -4.0F + HEAD_CENTRE_Y, -4.0F + HEAD_CENTRE_Z, 8, 8, 8, stretch * 1.1F); this.bipedHead .addBox(-4.0F + HEAD_CENTRE_X, -4.0F + HEAD_CENTRE_Y, -4.0F + HEAD_CENTRE_Z, 8, 8, 8, stretch * 1.1F);
this.bipedHead.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); this.bipedHeadwear .addBox(-4.0F + HEAD_CENTRE_X, -4.0F + HEAD_CENTRE_Y, -4.0F + HEAD_CENTRE_Z, 8, 8, 8, stretch * 1.1F + 0.5F);
this.extHead[0].addBox(-4.0F + HEAD_CENTRE_X, -6.0F + HEAD_CENTRE_Y, 1.0F + HEAD_CENTRE_Z, 2, 2, 2, stretch * 0.5F); this.extHead[0].addBox(-4.0F + HEAD_CENTRE_X, -6.0F + HEAD_CENTRE_Y, 1.0F + HEAD_CENTRE_Z, 2, 2, 2, stretch * 0.5F);
this.extHead[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.extHead[1].addBox(2.0F + HEAD_CENTRE_X, -6.0F + HEAD_CENTRE_Y, 1.0F + HEAD_CENTRE_Z, 2, 2, 2, stretch * 0.5F); this.extHead[1].addBox(2.0F + HEAD_CENTRE_X, -6.0F + HEAD_CENTRE_Y, 1.0F + HEAD_CENTRE_Z, 2, 2, 2, stretch * 0.5F);
this.extHead[1].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.bipedHeadwear.addBox(-4.0F + HEAD_CENTRE_X, -4.0F + HEAD_CENTRE_Y, -4.0F + HEAD_CENTRE_Z, 8, 8, 8, stretch * 1.1F + 0.5F); this.bipedHead .setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.bipedHeadwear.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); this.bipedHeadwear .setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.extHead[0] .setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.extHead[1] .setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
} }
@Override @Override
protected void initBodyPositions(float yOffset, float stretch) { protected void initBodyPositions(float yOffset, float stretch) {
this.bipedBody.addBox(-4.0F, 4.0F, -2.0F, 8, 8, 4, stretch); this.bipedBody.addBox(-4.0F, 4.0F, -2.0F, 8, 8, 4, stretch);
this.bipedBody.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.Bodypiece.addBox(-4.0F, 4.0F, 6.0F, 8, 8, 8, stretch); this.Bodypiece.addBox(-4.0F, 4.0F, 6.0F, 8, 8, 8, stretch);
this.Bodypiece.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.extBody.addBox(-4.0F, 4.0F, -2.0F, 8, 8, 16, stretch); this.extBody.addBox(-4.0F, 4.0F, -2.0F, 8, 8, 16, stretch);
this.extBody.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.bipedBody.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.Bodypiece.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.extBody .setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
} }
@Override @Override
protected void initLegPositions(float yOffset, float stretch) { protected void initLegPositions(float yOffset, float stretch) {
super.initLegPositions(yOffset, stretch); super.initLegPositions(yOffset, stretch);
this.extLegs[0].addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch); this.extLegs[0].addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch);
this.extLegs[0].setRotationPoint(-3.0F, 0.0F + yOffset, 0.0F);
this.extLegs[1].addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch); this.extLegs[1].addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch);
this.extLegs[0].setRotationPoint(-3.0F, 0.0F + yOffset, 0.0F);
this.extLegs[1].setRotationPoint(3.0F, 0.0F + yOffset, 0.0F); this.extLegs[1].setRotationPoint(3.0F, 0.0F + yOffset, 0.0F);
} }
@ -227,12 +184,15 @@ public class ModelPonyArmor extends ModelPlayerPony {
this.extLegs[0].rotateAngleX = this.bipedRightLeg.rotateAngleX; this.extLegs[0].rotateAngleX = this.bipedRightLeg.rotateAngleX;
this.extLegs[0].rotateAngleY = this.bipedRightLeg.rotateAngleY; this.extLegs[0].rotateAngleY = this.bipedRightLeg.rotateAngleY;
this.extLegs[0].rotateAngleZ = this.bipedRightLeg.rotateAngleZ; this.extLegs[0].rotateAngleZ = this.bipedRightLeg.rotateAngleZ;
this.extLegs[0].rotationPointX = this.bipedRightLeg.rotationPointX; this.extLegs[0].rotationPointX = this.bipedRightLeg.rotationPointX;
this.extLegs[0].rotationPointY = this.bipedRightLeg.rotationPointY; this.extLegs[0].rotationPointY = this.bipedRightLeg.rotationPointY;
this.extLegs[0].rotationPointZ = this.bipedRightLeg.rotationPointZ; this.extLegs[0].rotationPointZ = this.bipedRightLeg.rotationPointZ;
this.extLegs[1].rotateAngleX = this.bipedLeftLeg.rotateAngleX; this.extLegs[1].rotateAngleX = this.bipedLeftLeg.rotateAngleX;
this.extLegs[1].rotateAngleY = this.bipedLeftLeg.rotateAngleY; this.extLegs[1].rotateAngleY = this.bipedLeftLeg.rotateAngleY;
this.extLegs[1].rotateAngleZ = this.bipedLeftLeg.rotateAngleZ; this.extLegs[1].rotateAngleZ = this.bipedLeftLeg.rotateAngleZ;
this.extLegs[1].rotationPointX = this.bipedLeftLeg.rotationPointX; this.extLegs[1].rotationPointX = this.bipedLeftLeg.rotationPointX;
this.extLegs[1].rotationPointY = this.bipedLeftLeg.rotationPointY; this.extLegs[1].rotationPointY = this.bipedLeftLeg.rotationPointY;
this.extLegs[1].rotationPointZ = this.bipedLeftLeg.rotationPointZ; this.extLegs[1].rotationPointZ = this.bipedLeftLeg.rotationPointZ;

View file

@ -0,0 +1,23 @@
package com.minelittlepony.model.armour;
public class ModelSkeletonPonyArmor extends ModelPonyArmor {
@Override
protected void rotateRightArm(float var8, float var9, float move, float tick) {
if (this.rightArmPose == ArmPose.EMPTY) return;
if (!this.metadata.hasMagic()) {
rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
} else {
rotateArmHolding(unicornArmRight, 1, var8, var9, tick);
}
}
@Override
protected void fixSpecialRotationPoints(float move) {
if (this.rightArmPose != ArmPose.EMPTY && !this.metadata.hasMagic()) {
this.bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4.0F);
}
}
}

View file

@ -1,22 +1,16 @@
package com.minelittlepony.model.pony; package com.minelittlepony.model.armour;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import com.minelittlepony.model.entity.ModelMobPony; public class ModelZombiePonyArmor extends ModelPonyArmor {
public class ModelZombiePony extends ModelMobPony {
public ModelZombiePony() {
super();
}
private boolean isRight(float move) { private boolean isRight(float move) {
return MathHelper.sin(move / 20f) < 0f; return MathHelper.sin(move / 20f) < 0;
} }
@Override @Override
protected void rotateRightArm(float var8, float var9, float move, float tick) { protected void rotateRightArm(float var8, float var9, float move, float tick) {
if (this.rightArmPose != ArmPose.EMPTY) return; if (rightArmPose != ArmPose.EMPTY) return;
if (isRight(move)) { if (isRight(move)) {
rotateArmHolding(bipedRightArm, 1, var8, var9, tick); rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
@ -32,13 +26,11 @@ public class ModelZombiePony extends ModelMobPony {
@Override @Override
protected void fixSpecialRotationPoints(float move) { protected void fixSpecialRotationPoints(float move) {
if (rightArmPose != ArmPose.EMPTY) return; if (this.rightArmPose != ArmPose.EMPTY) return;
if (isRight(move)) { if (isRight(move)) {
shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3); shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3);
} else { } else {
shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3); shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3);
} }
} }
} }

View file

@ -0,0 +1,24 @@
package com.minelittlepony.model.armour;
import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.pony.data.IPonyData;
public class PonyArmor {
public final AbstractPonyModel modelArmorChestplate, modelArmor;
public PonyArmor(AbstractPonyModel chest, AbstractPonyModel body) {
this.modelArmorChestplate = chest;
this.modelArmor = body;
}
public void apply(IPonyData meta) {
modelArmorChestplate.metadata = meta;
modelArmor.metadata = meta;
}
public void init() {
modelArmorChestplate.init(0, 1);
modelArmor.init(0, 0.5f);
}
}

View file

@ -1,6 +1,5 @@
package com.minelittlepony.model; package com.minelittlepony.model.components;
import com.minelittlepony.renderer.HornGlowRenderer;
import net.minecraft.client.model.ModelBox; import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.PositionTextureVertex; import net.minecraft.client.model.PositionTextureVertex;
import net.minecraft.client.model.TexturedQuad; import net.minecraft.client.model.TexturedQuad;
@ -8,7 +7,9 @@ import net.minecraft.client.renderer.BufferBuilder;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class ModelHornGlow extends ModelBox { import com.minelittlepony.render.HornGlowRenderer;
public class HornGlow extends ModelBox {
private final float alpha; private final float alpha;
@ -16,7 +17,7 @@ public class ModelHornGlow extends ModelBox {
private TexturedQuad[] quadList; private TexturedQuad[] quadList;
public ModelHornGlow(HornGlowRenderer parent, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10, float alpha) { public HornGlow(HornGlowRenderer parent, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10, float alpha) {
super(parent, par2, par3, par4, par5, par6, par7, par8, par9, par10); super(parent, par2, par3, par4, par5, par6, par7, par8, par9, par10);
this.parent = parent; this.parent = parent;
this.alpha = alpha; this.alpha = alpha;

View file

@ -1,11 +1,11 @@
package com.minelittlepony.model.components; package com.minelittlepony.model.components;
import com.minelittlepony.model.AbstractPonyModel;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import static com.minelittlepony.model.PonyModelConstants.*; import static com.minelittlepony.model.PonyModelConstants.*;
import com.minelittlepony.model.AbstractPonyModel;
// TODO: Combine each wing into one ModelRenderer with multiple boxes, not multiple ModelRenderers each with one box. // TODO: Combine each wing into one ModelRenderer with multiple boxes, not multiple ModelRenderers each with one box.
public class ModelWing { public class ModelWing {
public ModelRenderer[] folded = new ModelRenderer[3], public ModelRenderer[] folded = new ModelRenderer[3],

View file

@ -1,13 +1,13 @@
package com.minelittlepony.model.components; package com.minelittlepony.model.components;
import com.minelittlepony.model.AbstractPonyModel;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.*; import static com.minelittlepony.model.PonyModelConstants.*;
import com.minelittlepony.model.AbstractPonyModel;
public class PegasusWings extends ModelBase { public class PegasusWings extends ModelBase {
private final AbstractPonyModel pony; private final AbstractPonyModel pony;

View file

@ -1,4 +1,6 @@
package com.minelittlepony.model; package com.minelittlepony.model.components;
import com.minelittlepony.model.PonyModelConstants;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
@ -8,11 +10,11 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
public class ModelPonyElytra extends ModelBase { public class PonyElytra extends ModelBase {
private ModelRenderer rightWing; private ModelRenderer rightWing;
private ModelRenderer leftWing = new ModelRenderer(this, 22, 0); private ModelRenderer leftWing = new ModelRenderer(this, 22, 0);
public ModelPonyElytra() { public PonyElytra() {
this.leftWing.addBox(-10.0F, 0.0F, 0.0F, 10, 20, 2, 1.0F); this.leftWing.addBox(-10.0F, 0.0F, 0.0F, 10, 20, 2, 1.0F);
this.rightWing = new ModelRenderer(this, 22, 0); this.rightWing = new ModelRenderer(this, 22, 0);
this.rightWing.mirror = true; this.rightWing.mirror = true;

View file

@ -1,11 +1,12 @@
package com.minelittlepony.model.components; package com.minelittlepony.model.components;
import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.pony.data.PonyGender; import com.minelittlepony.pony.data.PonyGender;
import com.minelittlepony.renderer.plane.PlaneRenderer; import com.minelittlepony.render.plane.PlaneRenderer;
import static com.minelittlepony.model.PonyModelConstants.*; import static com.minelittlepony.model.PonyModelConstants.*;
import com.minelittlepony.model.AbstractPonyModel;
public class PonySnout { public class PonySnout {
private PlaneRenderer mare, stallion; private PlaneRenderer mare, stallion;

View file

@ -1,21 +1,21 @@
package com.minelittlepony.model.components; package com.minelittlepony.model.components;
import com.minelittlepony.renderer.plane.PlaneRenderer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.*; import static com.minelittlepony.model.PonyModelConstants.*;
import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.pony.data.TailLengths; import com.minelittlepony.pony.data.TailLengths;
import com.minelittlepony.render.plane.PlaneRenderer;
public class PonyTail extends PlaneRenderer { public class PonyTail extends PlaneRenderer {
private final TailSegment[] segments = new TailSegment[4]; private final TailSegment[] segments = new TailSegment[4];
private final ModelBase theModel; private final AbstractPonyModel theModel;
public PonyTail(ModelBase model) { public PonyTail(AbstractPonyModel model) {
super(model); super(model);
theModel = model; theModel = model;
} }
@ -26,6 +26,35 @@ public class PonyTail extends PlaneRenderer {
} }
} }
public void setRotationAndAngles(boolean rainboom, float limbSwing, float limbSwingAmount, float bodySwing, float ticks) {
swingZ(rainboom, limbSwing, limbSwingAmount);
rotateAngleY = bodySwing;
if (theModel.isSneak && !theModel.isFlying && !rainboom) {
rotateSneak();
} else if (theModel.isRiding) {
rotationPointZ = 13;
rotationPointY = 3;
rotateAngleX = (float) (Math.PI * 0.2);
} else {
setRotationPoint(TAIL_RP_X, TAIL_RP_Y, TAIL_RP_Z_NOTSNEAK);
if (rainboom) {
rotateAngleX = ROTATE_90 + 0.1F * MathHelper.sin(limbSwing);
} else {
rotateAngleX = 0.5F * limbSwingAmount;
}
if (!rainboom) {
swingX(ticks);
}
}
if (rainboom) {
rotationPointY += 6.0F;
rotationPointZ++;
}
}
public void swingZ(boolean rainboom, float move, float swing) { public void swingZ(boolean rainboom, float move, float swing) {
rotateAngleZ = rainboom ? 0 : MathHelper.cos(move * 0.8F) * 0.2F * swing; rotateAngleZ = rainboom ? 0 : MathHelper.cos(move * 0.8F) * 0.2F * swing;
} }

View file

@ -1,7 +1,8 @@
package com.minelittlepony.model.components; package com.minelittlepony.model.components;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.renderer.HornGlowRenderer; import com.minelittlepony.render.HornGlowRenderer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;

View file

@ -1,113 +0,0 @@
package com.minelittlepony.model.entity;
import static com.minelittlepony.model.PonyModelConstants.*;
import com.minelittlepony.model.pony.ModelPlayerPony;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper;
public class ModelMobPony extends ModelPlayerPony {
public ModelMobPony() {
super(false);
}
@Override
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX;
float leftArmRotateAngleX;
float rightLegRotateAngleX;
float leftLegRotateAngleX;
float var8;
float var9;
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) {
if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270;
rightLegRotateAngleX = ROTATE_90;
leftLegRotateAngleX = ROTATE_90;
} else {
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
}
this.bipedRightArm.rotateAngleY = 0.2F;
this.steveRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.rotateAngleY = 0.2F;
} else {
var8 = (float) Math.pow(swing, 16.0D);
var9 = 3.1415927F * var8 * 0.5F;
float laQuad = 3.1415927F * var8;
float rlQuad = 3.1415927F * var8 * 0.2F;
float llQuad = 3.1415927F * var8 * -0.4F;
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + var9) * 0.6F * swing;
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.6F * swing;
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing;
this.bipedRightArm.rotateAngleY = 0.0F;
this.steveRightArm.rotateAngleY = 0.0F;
this.unicornArmRight.rotateAngleY = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleY = 0.0F;
this.bipedLeftLeg.rotateAngleY = 0.0F;
}
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornArmRight.rotateAngleX = rightArmRotateAngleX;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F;
this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornArmRight.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
var8 = MathHelper.sin(this.swingProgress * (float)Math.PI);
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
rotateRightArm(var8, var9, move, tick);
rotateLeftArm(var8, var9, move, tick);
}
protected void rotateRightArm(float var8, float var9, float move, float tick) {
if (this.rightArmPose == ArmPose.EMPTY) return;
if (!this.metadata.hasMagic()) {
rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
} else {
this.unicornArmRight.setRotationPoint(-7, 12, -2);
rotateArmHolding(unicornArmRight, 1, var8, var9, tick);
}
}
protected static void rotateArmHolding(ModelRenderer arm, float direction, float var8, float var9, float tick) {
arm.rotateAngleZ = 0.0F;
arm.rotateAngleY = direction * (0.1F - var8 * 0.6F);
arm.rotateAngleX = -1.5707964F;
arm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
arm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
arm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
}
protected void rotateLeftArm(float var8, float var9, float move, float tick) {
if (this.leftArmPose == ArmPose.EMPTY) return;
if (!this.metadata.hasMagic()) {
rotateArmHolding(bipedLeftArm, 1, var8, var9, tick);
} else {
this.unicornArmRight.setRotationPoint(-7, 12, -2);
rotateArmHolding(unicornArmLeft, 1, var8, var9, tick);
}
}
}

View file

@ -1,4 +1,7 @@
package com.minelittlepony.model; package com.minelittlepony.model.player;
import com.minelittlepony.model.PMAPI;
import com.minelittlepony.model.ModelWrapper;
public enum PlayerModels { public enum PlayerModels {
HUMAN("default", "slim", () -> PMAPI.human, () -> PMAPI.humanSmall), HUMAN("default", "slim", () -> PMAPI.human, () -> PMAPI.humanSmall),
@ -16,7 +19,7 @@ public enum PlayerModels {
this.slim = slim; this.slim = slim;
} }
public PlayerModel getModel(boolean slim) { public ModelWrapper getModel(boolean slim) {
return slim ? this.slim.resolve() : this.normal.resolve(); return slim ? this.slim.resolve() : this.normal.resolve();
} }
@ -28,6 +31,6 @@ public enum PlayerModels {
* FIXME: PMAPI fields are null when the game starts. * FIXME: PMAPI fields are null when the game starts.
*/ */
static interface ModelResolver { static interface ModelResolver {
PlayerModel resolve(); ModelWrapper resolve();
} }
} }

View file

@ -1,4 +1,4 @@
package com.minelittlepony.model.pony; package com.minelittlepony.model.ponies;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;

View file

@ -1,7 +1,8 @@
package com.minelittlepony.model.pony; package com.minelittlepony.model.ponies;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.armour.PonyArmor;
public class ModelHumanPlayer extends AbstractPonyModel { public class ModelHumanPlayer extends AbstractPonyModel {
@ -27,4 +28,9 @@ public class ModelHumanPlayer extends AbstractPonyModel {
protected void initPositions(float yOffset, float stretch) { protected void initPositions(float yOffset, float stretch) {
} }
@Override
public PonyArmor createArmour() {
return new PonyArmor(new ModelHumanPlayer(false), new ModelHumanPlayer(false));
}
} }

View file

@ -1,4 +1,4 @@
package com.minelittlepony.model.pony; package com.minelittlepony.model.ponies;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;

View file

@ -1,12 +1,14 @@
package com.minelittlepony.model.pony; package com.minelittlepony.model.ponies;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.armour.ModelPonyArmor;
import com.minelittlepony.model.armour.PonyArmor;
import com.minelittlepony.model.components.PegasusWings; import com.minelittlepony.model.components.PegasusWings;
import com.minelittlepony.model.components.PonySnout; import com.minelittlepony.model.components.PonySnout;
import com.minelittlepony.model.components.PonyTail; import com.minelittlepony.model.components.PonyTail;
import com.minelittlepony.model.components.UnicornHorn; import com.minelittlepony.model.components.UnicornHorn;
import com.minelittlepony.renderer.plane.PlaneRenderer; import com.minelittlepony.render.plane.PlaneRenderer;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -41,6 +43,12 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.smallArms = smallArms; this.smallArms = smallArms;
} }
@Override
public PonyArmor createArmour() {
return new PonyArmor(new ModelPonyArmor(), new ModelPonyArmor());
}
@Override
public void init(float yOffset, float stretch) { public void init(float yOffset, float stretch) {
super.init(yOffset, stretch); super.init(yOffset, stretch);
snout = new PonySnout(this, yOffset, stretch); snout = new PonySnout(this, yOffset, stretch);
@ -49,32 +57,19 @@ public class ModelPlayerPony extends AbstractPonyModel {
} }
@Override @Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
Entity entityIn) {
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.checkRainboom(entityIn, limbSwingAmount); this.checkRainboom(entityIn, limbSwingAmount);
this.rotateHead(netHeadYaw, headPitch); this.rotateHead(netHeadYaw, headPitch);
this.Tail.swingZ(rainboom, limbSwing, limbSwingAmount);
float bodySwingRotation = 0.0F; float bodySwingRotation = 0.0F;
if (this.swingProgress > -9990.0F && !this.metadata.hasMagic()) { if (this.swingProgress > -9990.0F && !this.metadata.hasMagic()) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F; bodySwingRotation = MathHelper.sin(MathHelper.sqrt(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
} }
this.bipedBody.rotateAngleY = bodySwingRotation * 0.2F; rotateLook(limbSwing, limbSwingAmount, bodySwingRotation, ageInTicks);
int k1;
for (k1 = 0; k1 < this.Bodypiece.length; ++k1) {
this.Bodypiece[k1].rotateAngleY = bodySwingRotation * 0.2F;
}
this.BodypieceNeck.rotateAngleY = bodySwingRotation * 0.2F;
this.Tail.rotateAngleY = bodySwingRotation;
this.bipedHead.offsetY = 0f;
this.bipedHead.offsetZ = 0f;
this.bipedHeadwear.offsetY = 0f;
this.bipedHeadwear.offsetZ = 0f;
this.setLegs(limbSwing, limbSwingAmount, ageInTicks, entityIn); this.setLegs(limbSwing, limbSwingAmount, ageInTicks, entityIn);
this.holdItem(limbSwingAmount); this.holdItem(limbSwingAmount);
this.swingItem(entityIn, this.swingProgress); this.swingItem(entityIn, this.swingProgress);
@ -82,12 +77,8 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.adjustBody(BODY_ROTATE_ANGLE_X_SNEAK, BODY_RP_Y_SNEAK, BODY_RP_Z_SNEAK); this.adjustBody(BODY_ROTATE_ANGLE_X_SNEAK, BODY_RP_Y_SNEAK, BODY_RP_Z_SNEAK);
this.sneakLegs(); this.sneakLegs();
this.setHead(0.0F, 6.0F, -2.0F); this.setHead(0.0F, 6.0F, -2.0F);
this.Tail.rotateSneak();
} else if (this.isRiding) { } else if (this.isRiding) {
this.adjustBodyRiding();
this.adjustBodyComponents(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
this.adjustNeck(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK);
this.setHead(0.0F, 0.0F, 0.0F);
this.bipedLeftLeg.rotationPointZ = 15; this.bipedLeftLeg.rotationPointZ = 15;
this.bipedLeftLeg.rotationPointY = 10; this.bipedLeftLeg.rotationPointY = 10;
this.bipedLeftLeg.rotateAngleX = (float) (Math.PI * -0.25); this.bipedLeftLeg.rotateAngleX = (float) (Math.PI * -0.25);
@ -100,10 +91,6 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.bipedLeftArm.rotateAngleZ = (float) (Math.PI * -0.06); this.bipedLeftArm.rotateAngleZ = (float) (Math.PI * -0.06);
this.bipedRightArm.rotateAngleZ = (float) (Math.PI * 0.06); this.bipedRightArm.rotateAngleZ = (float) (Math.PI * 0.06);
Tail.rotationPointZ = 13;
Tail.rotationPointY = 3;
Tail.rotateAngleX = (float) (Math.PI * 0.2);
} else { } else {
this.adjustBody(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK); this.adjustBody(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK);
@ -112,22 +99,6 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK; this.bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_NOTSNEAK;
this.swingArms(ageInTicks); this.swingArms(ageInTicks);
this.setHead(0.0F, 0.0F, 0.0F); this.setHead(0.0F, 0.0F, 0.0F);
this.Tail.setRotationPoint(TAIL_RP_X, TAIL_RP_Y, TAIL_RP_Z_NOTSNEAK);
if (this.rainboom) {
this.Tail.rotateAngleX = ROTATE_90 + 0.1F * MathHelper.sin(limbSwing);
} else {
this.Tail.rotateAngleX = 0.5F * limbSwingAmount;
}
if (!this.rainboom) {
this.Tail.swingX(ageInTicks);
}
}
if (this.rainboom) {
this.Tail.rotationPointY += 6.0F;
this.Tail.rotationPointZ++;
} }
if (this.isSleeping) { if (this.isSleeping) {
@ -147,6 +118,27 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.wings.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); this.wings.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
} }
protected void adjustBodyRiding() {
this.adjustBodyComponents(BODY_ROTATE_ANGLE_X_RIDING, BODY_RP_Y_RIDING, BODY_RP_Z_RIDING);
this.adjustNeck(BODY_ROTATE_ANGLE_X_NOTSNEAK, BODY_RP_Y_NOTSNEAK, BODY_RP_Z_NOTSNEAK);
this.setHead(0.0F, 0.0F, 0.0F);
}
protected void rotateLook(float limbSwing, float limbSwingAmount, float bodySwing, float ticks) {
this.Tail.setRotationAndAngles(rainboom, limbSwing, limbSwingAmount, bodySwing, ticks);
for (PlaneRenderer i : this.Bodypiece) {
i.rotateAngleY = bodySwing * 0.2F;
}
this.bipedBody.rotateAngleY = bodySwing * 0.2F;
this.BodypieceNeck.rotateAngleY = bodySwing * 0.2F;
this.bipedHead.offsetY = 0f;
this.bipedHead.offsetZ = 0f;
this.bipedHeadwear.offsetY = 0f;
this.bipedHeadwear.offsetZ = 0f;
}
private void animateWears() { private void animateWears() {
copyModelAngles(bipedLeftArm, bipedLeftArmwear); copyModelAngles(bipedLeftArm, bipedLeftArmwear);
copyModelAngles(bipedRightArm, bipedRightArmwear); copyModelAngles(bipedRightArm, bipedRightArmwear);
@ -193,162 +185,145 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.adjustLegs(); this.adjustLegs();
} }
public boolean isFlying(Entity entity) {
return (isFlying && metadata.getRace().hasWings()) ||
(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying());
}
protected void rotateLegs(float move, float swing, float tick, Entity entity) { protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX; float leftArm, rightArm,
float leftArmRotateAngleX; leftLeg, rightLeg;
float rightLegRotateAngleX;
float leftLegRotateAngleX;
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity) if (isFlying(entity)) {
.isElytraFlying()) {
if (this.rainboom) { if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270; rightArm = leftArm = ROTATE_270;
leftArmRotateAngleX = ROTATE_270; rightLeg = leftLeg = ROTATE_90;
rightLegRotateAngleX = ROTATE_90;
leftLegRotateAngleX = ROTATE_90;
} else { } else {
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F); rightArm = leftArm = MathHelper.sin(-swing / 2);
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F); rightLeg = leftLeg = MathHelper.sin(swing / 2);
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
} }
this.steveRightArm.rotateAngleY = 0.2F; steveRightArm.rotateAngleY = bipedRightArm.rotateAngleY = 0.2F;
this.bipedRightArm.rotateAngleY = 0.2F; bipedLeftArm.rotateAngleY = bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.rotateAngleY = 0.2F; this.bipedLeftLeg.rotateAngleY = 0.2F;
} else { } else {
float swag = (float) Math.pow(swing, 16.0D); float PI = (float)Math.PI;
float raQuad = 3.1415927F * swag * 0.5F; float pi = PI * (float) Math.pow(swing, 16);
float laQuad = 3.1415927F * swag;
float rlQuad = 3.1415927F * swag * 0.2F;
float llQuad = 3.1415927F * swag * -0.4F;
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + raQuad) * 0.45F * swing;
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing;
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing;
this.steveRightArm.rotateAngleY = 0.0F;
this.unicornArmRight.rotateAngleY = 0.0F;
this.unicornArmLeft.rotateAngleY = 0.0F;
this.bipedRightArm.rotateAngleY = 0.0F; float mve = move * 0.6662F; // magic number ahoy
this.bipedLeftArm.rotateAngleY = 0.0F; float srt = swing / 4;
this.bipedRightLeg.rotateAngleY = 0.0F;
this.bipedLeftLeg.rotateAngleY = 0.0F; leftArm = MathHelper.cos(mve + pi) * srt;
rightArm = MathHelper.cos(mve + PI + pi / 2) * srt;
leftLeg = MathHelper.cos(mve + PI - (pi * 0.4f)) * srt;
rightLeg = MathHelper.cos(mve + pi * 0.2f) * srt;
this.steveRightArm.rotateAngleY = 0;
this.unicornArmRight.rotateAngleY = 0;
this.unicornArmLeft.rotateAngleY = 0;
this.bipedRightArm.rotateAngleY = 0;
this.bipedLeftArm.rotateAngleY = 0;
this.bipedRightLeg.rotateAngleY = 0;
this.bipedLeftLeg.rotateAngleY = 0;
} }
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX; this.bipedRightArm.rotateAngleX = rightArm;
this.steveRightArm.rotateAngleX = rightArmRotateAngleX; this.steveRightArm.rotateAngleX = rightArm;
this.unicornArmRight.rotateAngleX = 0.0F; this.unicornArmRight.rotateAngleX = 0;
this.unicornArmLeft.rotateAngleX = 0.0F; this.unicornArmLeft.rotateAngleX = 0;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX; this.bipedLeftArm.rotateAngleX = leftArm;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX; this.bipedRightLeg.rotateAngleX = rightLeg;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX; this.bipedLeftLeg.rotateAngleX = leftLeg;
this.bipedRightArm.rotateAngleZ = 0.0F;
this.steveRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0;
this.unicornArmRight.rotateAngleZ = 0.0F;
this.unicornArmLeft.rotateAngleZ = 0.0F; this.steveRightArm.rotateAngleZ = 0;
this.bipedLeftArm.rotateAngleZ = 0.0F; this.unicornArmRight.rotateAngleZ = 0;
this.unicornArmLeft.rotateAngleZ = 0;
this.bipedLeftArm.rotateAngleZ = 0;
}
private float getLegOutset() {
if (isSleeping) return 2.6f;
if (isSneak && !isFlying) return smallArms ? 1 : 0;
return 4;
} }
protected void adjustLegs() { protected void adjustLegs() {
float sinBodyRotateAngleYFactor = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; float sinBodyRotateAngleYFactor = MathHelper.sin(this.bipedBody.rotateAngleY) * 5;
float cosBodyRotateAngleYFactor = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; float cosBodyRotateAngleYFactor = MathHelper.cos(this.bipedBody.rotateAngleY) * 5;
float legOutset = 4.0F;
if (this.isSneak && !this.isFlying) {
legOutset = smallArms ? 1.0F : 0F;
}
if (this.isSleeping) {
legOutset = 2.6F;
}
if (this.rainboom) { float legOutset = getLegOutset();
this.bipedRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 2.0F; float spread = rainboom ? 2 : 1;
this.steveRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 2.0F;
this.bipedLeftArm.rotationPointZ = 0.0F - sinBodyRotateAngleYFactor + 2.0F;
} else {
this.bipedRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 1.0F;
this.steveRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 1.0F;
this.bipedLeftArm.rotationPointZ = 0.0F - sinBodyRotateAngleYFactor + 1.0F;
}
this.steveRightArm.rotationPointX = 0.0F - cosBodyRotateAngleYFactor;
this.bipedRightArm.rotationPointX = 0.0F - cosBodyRotateAngleYFactor - 1.0F + legOutset; this.bipedRightArm.rotationPointZ = spread + sinBodyRotateAngleYFactor;
this.bipedLeftArm.rotationPointX = cosBodyRotateAngleYFactor + 2.0F - legOutset; this.steveRightArm.rotationPointZ = spread + sinBodyRotateAngleYFactor;
this.bipedRightLeg.rotationPointX = 0.0F - cosBodyRotateAngleYFactor - 1.0F + legOutset; this.bipedLeftArm.rotationPointZ = spread - sinBodyRotateAngleYFactor;
this.bipedLeftLeg.rotationPointX = cosBodyRotateAngleYFactor + 1.0F - legOutset; this.steveRightArm.rotationPointX = -cosBodyRotateAngleYFactor;
float rpxl = legOutset - cosBodyRotateAngleYFactor - 1;
float rpxr = cosBodyRotateAngleYFactor + 2 - legOutset;
bipedRightArm.rotationPointX = bipedRightLeg.rotationPointX = rpxl;
bipedLeftArm.rotationPointX = bipedLeftLeg.rotationPointX = rpxr;
bipedRightArm.rotateAngleY += bipedBody.rotateAngleY;
bipedLeftArm.rotateAngleY += bipedBody.rotateAngleY;
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
//noinspection SuspiciousNameCombination //noinspection SuspiciousNameCombination
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
this.bipedRightArm.rotationPointY = 8.0F; bipedRightArm.rotationPointY = bipedLeftArm.rotationPointY = 8;
this.bipedLeftArm.rotationPointY = 8.0F; bipedRightLeg.rotationPointZ = bipedLeftLeg.rotationPointZ = 10;
this.bipedRightLeg.rotationPointZ = 10.0F;
this.bipedLeftLeg.rotationPointZ = 10.0F;
} }
@SuppressWarnings("incomplete-switch")
protected void holdItem(float swing) { protected void holdItem(float swing) {
if (!this.rainboom && !this.metadata.hasMagic()) { if (!this.rainboom && !this.metadata.hasMagic()) {
boolean bothHoovesAreOccupied = this.leftArmPose == ArmPose.ITEM && this.rightArmPose == ArmPose.ITEM; boolean bothHoovesAreOccupied = this.leftArmPose == ArmPose.ITEM && this.rightArmPose == ArmPose.ITEM;
alignArmForAction(bipedLeftArm, leftArmPose, bothHoovesAreOccupied, swing);
switch (this.leftArmPose) { alignArmForAction(bipedRightArm, rightArmPose, bothHoovesAreOccupied, swing);
case EMPTY:
this.bipedLeftArm.rotateAngleY = 0.0F;
break;
case BLOCK:
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - 0.9424779F;
this.bipedLeftArm.rotateAngleY = (float) (Math.PI / 6);
break;
case ITEM:
float swag = 1f;
if (!isFlying && bothHoovesAreOccupied) {
swag = (float) (1d - Math.pow(swing, 2d));
}
float rotationMultiplier = 0.5f + 0.5f * (1f - swag);
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * rotationMultiplier - ((float) Math.PI / 10F) * swag;
this.bipedLeftArm.rotateAngleY = 0.0F;
}
switch (this.rightArmPose) {
case EMPTY:
this.bipedRightArm.rotateAngleY = 0.0F;
break;
case BLOCK:
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - 0.9424779F;
this.bipedRightArm.rotateAngleY = (float) (-Math.PI / 6);
break;
case ITEM:
float swag = 1f;
if (!isFlying && bothHoovesAreOccupied) {
swag = (float) (1d - Math.pow(swing, 2d));
}
float rotationMultiplier = 0.5f + 0.5f * (1f - swag);
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * rotationMultiplier - ((float) Math.PI / 10F) * swag;
this.bipedRightArm.rotateAngleY = 0.0F;
}
} else if (this.metadata.hasMagic()) { } else if (this.metadata.hasMagic()) {
if (this.leftArmPose == ArmPose.BLOCK) { if (this.leftArmPose == ArmPose.BLOCK) blockArm(unicornArmLeft);
this.unicornArmLeft.rotateAngleX = this.unicornArmLeft.rotateAngleX * 0.5F - 0.9424779F; if (this.rightArmPose == ArmPose.BLOCK) blockArm(unicornArmRight);
this.unicornArmLeft.rotateAngleY = (float) (Math.PI / 6);
}
if (this.rightArmPose == ArmPose.BLOCK) {
this.unicornArmRight.rotateAngleY = (float) (-Math.PI / 6);
this.unicornArmRight.rotateAngleX = this.unicornArmRight.rotateAngleX * 0.5F - 0.9424779F;
}
} }
this.horn.setUsingMagic(this.leftArmPose != ArmPose.EMPTY || this.rightArmPose != ArmPose.EMPTY); this.horn.setUsingMagic(this.leftArmPose != ArmPose.EMPTY || this.rightArmPose != ArmPose.EMPTY);
} }
@SuppressWarnings("incomplete-switch")
private void alignArmForAction(ModelRenderer arm, ArmPose pose, boolean bothHoovesAreOccupied, float swing) {
switch (pose) {
case ITEM:
float swag = 1;
if (!isFlying && bothHoovesAreOccupied) {
swag = (float) (1 - Math.pow(swing, 2));
}
float rotationMultiplier = 0.5f + (1 - swag)/2;
arm.rotateAngleX = this.bipedLeftArm.rotateAngleX * rotationMultiplier - ((float) Math.PI / 10) * swag;
case EMPTY:
arm.rotateAngleY = 0;
break;
case BLOCK:
arm.rotateAngleX = arm.rotateAngleX / 2 - 0.9424779F;
arm.rotateAngleY = (float) (Math.PI / 6);
break;
}
}
private void blockArm(ModelRenderer arm) {
arm.rotateAngleX = arm.rotateAngleX * 0.5F - 0.9424779F;
arm.rotateAngleY = (float) (Math.PI / 6);
}
protected void swingItem(Entity entity, float swingProgress) { protected void swingItem(Entity entity, float swingProgress) {
if (swingProgress > -9990.0F && !this.isSleeping) { if (swingProgress > -9990.0F && !this.isSleeping) {
float f16 = 1.0F - swingProgress; float f16 = 1.0F - swingProgress;
@ -357,59 +332,56 @@ public class ModelPlayerPony extends AbstractPonyModel {
float f22 = MathHelper.sin(f16 * 3.1415927F); float f22 = MathHelper.sin(f16 * 3.1415927F);
float f28 = MathHelper.sin(swingProgress * 3.1415927F); float f28 = MathHelper.sin(swingProgress * 3.1415927F);
float f33 = f28 * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; float f33 = f28 * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
EnumHandSide mainSide = this.getMainHand(entity); EnumHandSide mainSide = this.getMainHand(entity);
boolean mainRight = mainSide == EnumHandSide.RIGHT; boolean mainRight = mainSide == EnumHandSide.RIGHT;
ArmPose mainPose = mainRight ? this.rightArmPose : this.leftArmPose; ArmPose mainPose = mainRight ? this.rightArmPose : this.leftArmPose;
if (this.metadata.hasMagic() && mainPose != ArmPose.EMPTY) { if (this.metadata.hasMagic() && mainPose != ArmPose.EMPTY) {
swingArm(mainRight ? this.unicornArmRight : this.unicornArmLeft, f22, f33, f28);
ModelRenderer unicornarm = mainSide == EnumHandSide.LEFT ? this.unicornArmLeft : this.unicornArmRight;
unicornarm.rotateAngleX = (float) (this.unicornArmRight.rotateAngleX - (f22 * 1.2D + f33));
unicornarm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
unicornarm.rotateAngleZ = f28 * -0.4F;
} else { } else {
ModelRenderer bipedArm = this.getArmForSide(mainSide); swingArm(this.getArmForSide(mainSide), f22, f33, f28);
ModelRenderer steveArm = mainRight ? this.steveRightArm : this.steveLeftArm; swingArm(mainRight ? this.steveRightArm : this.steveLeftArm, f22, f33, f28);
bipedArm.rotateAngleX = (float) (bipedArm.rotateAngleX - (f22 * 1.2D + f33));
bipedArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
bipedArm.rotateAngleZ = f28 * -0.4F;
steveArm.rotateAngleX = (float) (steveArm.rotateAngleX - (f22 * 1.2D + f33));
steveArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
steveArm.rotateAngleZ = f28 * -0.4F;
} }
} }
}
private void swingArm(ModelRenderer arm, float f22, float f33, float f28) {
arm.rotateAngleX = (float) (this.unicornArmRight.rotateAngleX - (f22 * 1.2D + f33));
arm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
arm.rotateAngleZ = f28 * -0.4F;
} }
protected void swingArms(float tick) { protected void swingArms(float tick) {
float cosTickFactor = MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
float sinTickFactor = MathHelper.sin(tick * 0.067F) * 0.05F;
if (this.rightArmPose != ArmPose.EMPTY && !this.isSleeping) { if (this.rightArmPose != ArmPose.EMPTY && !this.isSleeping) {
float cosTickFactor = MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
float sinTickFactor = MathHelper.sin(tick * 0.067F) * 0.05F;
if (this.metadata.hasMagic()) { if (this.metadata.hasMagic()) {
this.unicornArmRight.rotateAngleZ += cosTickFactor; this.unicornArmRight.rotateAngleZ += cosTickFactor;
this.unicornArmRight.rotateAngleX += sinTickFactor; this.unicornArmRight.rotateAngleX += sinTickFactor;
} else { } else {
this.bipedRightArm.rotateAngleZ += cosTickFactor; this.bipedRightArm.rotateAngleZ += cosTickFactor;
this.bipedRightArm.rotateAngleX += sinTickFactor; this.bipedRightArm.rotateAngleX += sinTickFactor;
this.steveRightArm.rotateAngleZ += cosTickFactor; this.steveRightArm.rotateAngleZ += cosTickFactor;
this.steveRightArm.rotateAngleX += sinTickFactor; this.steveRightArm.rotateAngleX += sinTickFactor;
} }
} }
if (this.leftArmPose != ArmPose.EMPTY && !this.isSleeping) { if (this.leftArmPose != ArmPose.EMPTY && !this.isSleeping) {
float cosTickFactor = MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
float sinTickFactor = MathHelper.sin(tick * 0.067F) * 0.05F;
if (this.metadata.hasMagic()) { if (this.metadata.hasMagic()) {
this.unicornArmLeft.rotateAngleZ += cosTickFactor; this.unicornArmLeft.rotateAngleZ += cosTickFactor;
this.unicornArmLeft.rotateAngleX += sinTickFactor; this.unicornArmLeft.rotateAngleX += sinTickFactor;
} else { } else {
this.bipedLeftArm.rotateAngleZ += cosTickFactor; this.bipedLeftArm.rotateAngleZ += cosTickFactor;
this.bipedLeftArm.rotateAngleX += sinTickFactor; this.bipedLeftArm.rotateAngleX += sinTickFactor;
this.steveLeftArm.rotateAngleZ += cosTickFactor; this.steveLeftArm.rotateAngleZ += cosTickFactor;
this.steveLeftArm.rotateAngleX += sinTickFactor; this.steveLeftArm.rotateAngleX += sinTickFactor;
} }
} }
} }
protected void adjustBody(float rotateAngleX, float rotationPointY, float rotationPointZ) { protected void adjustBody(float rotateAngleX, float rotationPointY, float rotationPointZ) {
@ -422,30 +394,28 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.bipedBody.rotationPointY = rotationPointY; this.bipedBody.rotationPointY = rotationPointY;
this.bipedBody.rotationPointZ = rotationPointZ; this.bipedBody.rotationPointZ = rotationPointZ;
int k3; for (PlaneRenderer i : Bodypiece) {
for (k3 = 0; k3 < this.Bodypiece.length; ++k3) { i.rotateAngleX = rotateAngleX;
this.Bodypiece[k3].rotateAngleX = rotateAngleX; i.rotationPointY = rotationPointY;
this.Bodypiece[k3].rotationPointY = rotationPointY; i.rotationPointZ = rotationPointZ;
this.Bodypiece[k3].rotationPointZ = rotationPointZ;
} }
} }
protected void adjustNeck(float rotateAngleX, float rotationPointY, float rotationPointZ) { protected void adjustNeck(float rotateAngleX, float rotationPointY, float rotationPointZ) {
BodypieceNeck.rotateAngleX = NECK_ROT_X + rotateAngleX; BodypieceNeck.setRotationPoint(NECK_ROT_X + rotateAngleX, rotationPointY, rotationPointZ);
BodypieceNeck.rotationPointY = rotationPointY;
BodypieceNeck.rotationPointZ = rotationPointZ;
} }
protected void sneakLegs() { protected void sneakLegs() {
this.steveRightArm.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT; this.steveRightArm.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT;
this.unicornArmRight.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT; this.unicornArmRight.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT;
this.unicornArmLeft.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT; this.unicornArmLeft.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT;
this.bipedRightArm.rotateAngleX -= SNEAK_LEG_X_ROTATION_ADJUSTMENT; this.bipedRightArm.rotateAngleX -= SNEAK_LEG_X_ROTATION_ADJUSTMENT;
this.bipedLeftArm.rotateAngleX -= SNEAK_LEG_X_ROTATION_ADJUSTMENT;
this.bipedRightLeg.rotationPointY = FRONT_LEG_RP_Y_SNEAK; this.bipedRightLeg.rotationPointY = FRONT_LEG_RP_Y_SNEAK;
this.bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_SNEAK;
this.bipedLeftArm.rotateAngleX -= SNEAK_LEG_X_ROTATION_ADJUSTMENT;
this.bipedLeftLeg.rotationPointY = FRONT_LEG_RP_Y_SNEAK;
} }
protected void ponySleep() { protected void ponySleep() {
@ -453,17 +423,17 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.bipedLeftArm.rotateAngleX = ROTATE_270; this.bipedLeftArm.rotateAngleX = ROTATE_270;
this.bipedRightLeg.rotateAngleX = ROTATE_90; this.bipedRightLeg.rotateAngleX = ROTATE_90;
this.bipedLeftLeg.rotateAngleX = ROTATE_90; this.bipedLeftLeg.rotateAngleX = ROTATE_90;
float headPosX;
float headPosY; float headPosX, headPosY, headPosZ;
float headPosZ;
if (this.isSneak) { if (this.isSneak) {
headPosY = 2.0F; headPosY = 2;
headPosZ = -1.0F; headPosZ = -1;
headPosX = 1.0F; headPosX = 1;
} else { } else {
headPosY = 2.0F; headPosY = 2;
headPosZ = 1.0F; headPosZ = 1;
headPosX = 1.0F; headPosX = 1;
} }
this.setHead(headPosX, headPosY, headPosZ); this.setHead(headPosX, headPosY, headPosZ);
@ -624,7 +594,6 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.Bodypiece[12] = new PlaneRenderer(this, 32, 0); this.Bodypiece[12] = new PlaneRenderer(this, 32, 0);
this.Bodypiece[13] = new PlaneRenderer(this, 32, 0); this.Bodypiece[13] = new PlaneRenderer(this, 32, 0);
// neck
this.BodypieceNeck = new PlaneRenderer(this, 0, 16); this.BodypieceNeck = new PlaneRenderer(this, 0, 16);
} }
@ -698,8 +667,8 @@ public class ModelPlayerPony extends AbstractPonyModel {
this.BodypieceNeck.addBackPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -8.8F + BODY_CENTRE_Z, 4, 4, stretch); this.BodypieceNeck.addBackPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -8.8F + BODY_CENTRE_Z, 4, 4, stretch);
this.BodypieceNeck.addBackPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -4.8F + BODY_CENTRE_Z, 4, 4, stretch); this.BodypieceNeck.addBackPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -4.8F + BODY_CENTRE_Z, 4, 4, stretch);
this.BodypieceNeck.addWestPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -8.8F + BODY_CENTRE_Z, 4, 4, stretch);
this.BodypieceNeck.addEastPlane(2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -8.8F + BODY_CENTRE_Z, 4, 4, stretch); this.BodypieceNeck.addEastPlane(2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -8.8F + BODY_CENTRE_Z, 4, 4, stretch);
this.BodypieceNeck.addWestPlane(-2.0F + BODY_CENTRE_X, -6.8F + BODY_CENTRE_Y, -8.8F + BODY_CENTRE_Z, 4, 4, stretch);
this.BodypieceNeck.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z); this.BodypieceNeck.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.BodypieceNeck.rotateAngleX = NECK_ROT_X; this.BodypieceNeck.rotateAngleX = NECK_ROT_X;
@ -745,8 +714,6 @@ public class ModelPlayerPony extends AbstractPonyModel {
if (this.bipedLeftLegwear != null) { if (this.bipedLeftLegwear != null) {
this.bipedLeftLegwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch + 0.25f); this.bipedLeftLegwear.addBox(-2.0F + THIRDP_ARM_CENTRE_X, -6.0F + THIRDP_ARM_CENTRE_Y, -2.0F + THIRDP_ARM_CENTRE_Z, 4, 12, 4, stretch + 0.25f);
} }
} }
@Override @Override

View file

@ -1,8 +1,10 @@
package com.minelittlepony.model.pony; package com.minelittlepony.model.ponies;
import static net.minecraft.client.renderer.GlStateManager.*; import static net.minecraft.client.renderer.GlStateManager.*;
import com.minelittlepony.model.entity.ModelMobPony; import com.minelittlepony.model.ModelMobPony;
import com.minelittlepony.model.armour.ModelSkeletonPonyArmor;
import com.minelittlepony.model.armour.PonyArmor;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -19,6 +21,11 @@ public class ModelSkeletonPony extends ModelMobPony {
super(); super();
} }
@Override
public PonyArmor createArmour() {
return new PonyArmor(new ModelSkeletonPonyArmor(), new ModelSkeletonPonyArmor());
}
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) { public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
rightArmPose = ModelBiped.ArmPose.EMPTY; rightArmPose = ModelBiped.ArmPose.EMPTY;
leftArmPose = ModelBiped.ArmPose.EMPTY; leftArmPose = ModelBiped.ArmPose.EMPTY;

View file

@ -0,0 +1,91 @@
package com.minelittlepony.model.ponies;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.*;
import com.minelittlepony.render.plane.PlaneRenderer;
public class ModelVillagerPony extends ModelPlayerPony {
public PlaneRenderer bag, apron, trinket;
public ModelVillagerPony() {
super(false);
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
float swing = 0;
if (swingProgress > -9990.0F && !metadata.hasMagic()) {
swing = MathHelper.sin(MathHelper.sqrt(swingProgress) * (float)Math.PI * 2) * 0.04f;
}
bag.rotateAngleY = swing;
apron.rotateAngleY = swing;
trinket.rotateAngleY = swing;
}
@Override
protected void renderBody(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
super.renderBody(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
if (entityIn instanceof EntityVillager) {
this.bipedBody.postRender(this.scale);
int profession = ((EntityVillager) entityIn).getProfession();
if (profession < 2) {
bag.render(scale);
} else if (profession == 2) {
trinket.render(scale);
} else if (profession > 2) {
apron.render(scale);
}
}
}
@Override
protected void initTextures() {
super.initTextures();
bag = new PlaneRenderer(this, 56, 19).at(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z);
apron = new PlaneRenderer(this, 56, 16).at(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z);
trinket = new PlaneRenderer(this, 0, 3).at(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z);
}
@Override
protected void initPositions(float yOffset, float stretch) {
super.initPositions(yOffset, stretch);
bag.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
bag.setTextureOffset(56, 29);
bag.addWestPlane(-7, -5, -4, 6, 8, stretch);
bag.addWestPlane(-4, -5, -4, 6, 8, stretch);
bag.addWestPlane( 4, -5, -4, 6, 8, stretch);
bag.addWestPlane( 7, -5, -4, 6, 8, stretch);
PlaneRenderer rotatedPieces = new PlaneRenderer(this, 56, 16);
rotatedPieces.rotateAngleY = 4.712389F;
bag.addChild(rotatedPieces);
rotatedPieces.addTopPlane(2, -5, -2, 8, 3, stretch);
rotatedPieces.addTopPlane(2, -5, -13, 8, 3, stretch);
rotatedPieces.setTextureOffset(56, 22);
rotatedPieces.addBottomPlane(2, 1, -2, 8, 3, stretch);
bag.setTextureOffset(56, 22);
bag.addBottomPlane(2, 1, -13, 8, 3, stretch);
bag.setTextureOffset(56, 25);
bag.addBackPlane(-7, -5, -4, 3, 6, stretch);
bag.addBackPlane( 4, -5, -4, 3, 6, stretch);
bag.setTextureOffset(59, 25);
bag.addBackPlane(-7, -5, 4, 3, 6, stretch);
bag.addBackPlane( 5, -5, 4, 3, 6, stretch);
bag.setTextureOffset(56, 31);
bag.addTopPlane(-4, -4.5F, -1, 8, 1, stretch);
bag.addTopPlane(-4, -4.5F, 0, 8, 1, stretch);
apron.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z).addBackPlane(-4, -4, -9, 8, 10, stretch);
trinket.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z).addBackPlane(-2, -4, -9, 4, 5, stretch);
}
}

View file

@ -0,0 +1,51 @@
package com.minelittlepony.model.ponies;
import com.minelittlepony.model.ModelMobPony;
import com.minelittlepony.model.armour.ModelZombiePonyArmor;
import com.minelittlepony.model.armour.PonyArmor;
import net.minecraft.util.math.MathHelper;
public class ModelZombiePony extends ModelMobPony {
public ModelZombiePony() {
super();
}
@Override
public PonyArmor createArmour() {
return new PonyArmor(new ModelZombiePonyArmor(), new ModelZombiePonyArmor());
}
private boolean isRight(float move) {
return MathHelper.sin(move / 20f) < 0;
}
@Override
protected void rotateRightArm(float var8, float var9, float move, float tick) {
if (rightArmPose != ArmPose.EMPTY) return;
if (isRight(move)) {
rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
} else {
rotateArmHolding(bipedLeftArm, -1, var8, var9, tick);
}
}
@Override
protected void rotateLeftArm(float var8, float var9, float move, float tick) {
}
@Override
protected void fixSpecialRotationPoints(float move) {
if (rightArmPose != ArmPose.EMPTY) return;
if (isRight(move)) {
shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3);
} else {
shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3);
}
}
}

View file

@ -1,6 +1,6 @@
@MethodsReturnNonnullByDefault @MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault @ParametersAreNonnullByDefault
package com.minelittlepony.model.pony; package com.minelittlepony.model.ponies;
import mcp.MethodsReturnNonnullByDefault; import mcp.MethodsReturnNonnullByDefault;

View file

@ -1,117 +0,0 @@
package com.minelittlepony.model.pony;
import com.minelittlepony.renderer.plane.PlaneRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.*;
public class ModelVillagerPony extends ModelPlayerPony {
public PlaneRenderer[] VillagerBagPiece;
public PlaneRenderer VillagerApron;
public PlaneRenderer VillagerTrinket;
public ModelVillagerPony() {
super(false);
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
float bodySwingRotation = 0.0F;
if (this.swingProgress > -9990.0F && !this.metadata.hasMagic()) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt(this.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
}
for (PlaneRenderer aVillagerBagPiece : this.VillagerBagPiece) {
aVillagerBagPiece.rotateAngleY = bodySwingRotation * 0.2F;
}
this.VillagerBagPiece[4].rotateAngleY += 4.712389F;
this.VillagerBagPiece[5].rotateAngleY += 4.712389F;
this.VillagerBagPiece[6].rotateAngleY += 4.712389F;
this.VillagerBagPiece[7].rotateAngleY += 4.712389F;
this.VillagerApron.rotateAngleY = bodySwingRotation * 0.2F;
this.VillagerTrinket.rotateAngleY = bodySwingRotation * 0.2F;
}
@Override
protected void renderBody(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
super.renderBody(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
if (entityIn instanceof EntityVillager) {
this.bipedBody.postRender(this.scale);
int profession = ((EntityVillager) entityIn).getProfession();
if (profession < 2) {
for (PlaneRenderer aVillagerBagPiece : this.VillagerBagPiece) {
aVillagerBagPiece.render(this.scale);
}
} else if (profession == 2) {
this.VillagerTrinket.render(this.scale);
} else if (profession > 2) {
this.VillagerApron.render(this.scale);
}
}
}
@Override
protected void initTextures() {
super.initTextures();
this.VillagerBagPiece = new PlaneRenderer[14];
this.VillagerBagPiece[0] = new PlaneRenderer(this, 56, 19);
this.VillagerBagPiece[1] = new PlaneRenderer(this, 56, 19);
this.VillagerBagPiece[2] = new PlaneRenderer(this, 56, 19);
this.VillagerBagPiece[3] = new PlaneRenderer(this, 56, 19);
this.VillagerBagPiece[4] = new PlaneRenderer(this, 56, 16);
this.VillagerBagPiece[5] = new PlaneRenderer(this, 56, 16);
this.VillagerBagPiece[6] = new PlaneRenderer(this, 56, 22);
this.VillagerBagPiece[7] = new PlaneRenderer(this, 56, 22);
this.VillagerBagPiece[8] = new PlaneRenderer(this, 56, 25);
this.VillagerBagPiece[9] = new PlaneRenderer(this, 56, 25);
this.VillagerBagPiece[10] = new PlaneRenderer(this, 59, 25);
this.VillagerBagPiece[11] = new PlaneRenderer(this, 59, 25);
this.VillagerBagPiece[12] = new PlaneRenderer(this, 56, 31);
this.VillagerBagPiece[13] = new PlaneRenderer(this, 56, 31);
this.VillagerApron = new PlaneRenderer(this, 56, 16);
this.VillagerTrinket = new PlaneRenderer(this, 0, 3);
}
@Override
protected void initPositions(float yOffset, float stretch) {
super.initPositions(yOffset, stretch);
this.VillagerBagPiece[0].addWestPlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 6, 8, stretch);
this.VillagerBagPiece[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[1].addWestPlane(-4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 6, 8, stretch);
this.VillagerBagPiece[1].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[2].addWestPlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 6, 8, stretch);
this.VillagerBagPiece[2].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[3].addWestPlane(7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 6, 8, stretch);
this.VillagerBagPiece[3].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[4].addTopPlane(2.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -2.0F + BODY_CENTRE_Z, 8, 3, stretch);
this.VillagerBagPiece[4].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[5].addTopPlane(2.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -13.0F + BODY_CENTRE_Z, 8, 3, stretch);
this.VillagerBagPiece[5].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[6].addBottomPlane(2.0F + BODY_CENTRE_X, 1.0F + BODY_CENTRE_Y, -2.0F + BODY_CENTRE_Z, 8, 3, stretch);
this.VillagerBagPiece[6].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[7].addBottomPlane(2.0F + BODY_CENTRE_X, 1.0F + BODY_CENTRE_Y, -13.0F + BODY_CENTRE_Z, 8, 3, stretch);
this.VillagerBagPiece[7].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[8].addBackPlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 3, 6, stretch);
this.VillagerBagPiece[8].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[9].addBackPlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, -4.0F + BODY_CENTRE_Z, 3, 6, stretch);
this.VillagerBagPiece[9].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[10].addBackPlane(-7.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, 4.0F + BODY_CENTRE_Z, 3, 6, stretch);
this.VillagerBagPiece[10].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[11].addBackPlane(4.0F + BODY_CENTRE_X, -5.0F + BODY_CENTRE_Y, 4.0F + BODY_CENTRE_Z, 3, 6, stretch);
this.VillagerBagPiece[11].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[12].addTopPlane(-4.0F + BODY_CENTRE_X, -4.5F + BODY_CENTRE_Y, -1.0F + BODY_CENTRE_Z, 8, 1, stretch);
this.VillagerBagPiece[13].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerBagPiece[13].addTopPlane(-4.0F + BODY_CENTRE_X, -4.5F + BODY_CENTRE_Y, 0.0F + BODY_CENTRE_Z, 8, 1, stretch);
this.VillagerBagPiece[13].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerApron.addBackPlane(-4.0F + BODY_CENTRE_X, -4.0F + BODY_CENTRE_Y, -9.0F + BODY_CENTRE_Z, 8, 10, stretch);
this.VillagerApron.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.VillagerTrinket.addBackPlane(-2.0F + BODY_CENTRE_X, -4.0F + BODY_CENTRE_Y, -9.0F + BODY_CENTRE_Z, 4, 5, stretch);
this.VillagerTrinket.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
}
}

View file

@ -1,13 +0,0 @@
package com.minelittlepony.model.pony.armor;
import com.minelittlepony.model.AbstractArmor;
import com.minelittlepony.model.pony.ModelHumanPlayer;
public class HumanArmors extends AbstractArmor {
public HumanArmors() {
this.modelArmorChestplate = new ModelHumanPlayer(false);
this.modelArmor = new ModelHumanPlayer(false);
}
}

View file

@ -1,95 +0,0 @@
package com.minelittlepony.model.pony.armor;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.*;
public class ModelSkeletonPonyArmor extends ModelPonyArmor {
@Override
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX;
float leftArmRotateAngleX;
float rightLegRotateAngleX;
float leftLegRotateAngleX;
float var8;
float var9;
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) {
if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270;
rightLegRotateAngleX = ROTATE_90;
leftLegRotateAngleX = ROTATE_90;
} else {
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
}
this.bipedRightArm.rotateAngleY = 0.2F;
this.steveRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.rotateAngleY = 0.2F;
} else {
var8 = (float) Math.pow(swing, 16.0D);
var9 = 3.1415927F * var8 * 0.5F;
float laQuad = 3.1415927F * var8;
float rlQuad = 3.1415927F * var8 * 0.2F;
float llQuad = 3.1415927F * var8 * -0.4F;
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + var9) * 0.6F * swing;
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.6F * swing;
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing;
this.bipedRightArm.rotateAngleY = 0.0F;
this.steveRightArm.rotateAngleY = 0.0F;
this.unicornArmRight.rotateAngleY = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleY = 0.0F;
this.bipedLeftLeg.rotateAngleY = 0.0F;
}
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornArmRight.rotateAngleX = 0.0F;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F;
this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornArmRight.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
if (this.rightArmPose != ArmPose.EMPTY) {
var8 = MathHelper.sin(this.swingProgress * 3.1415927F);
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
if (!this.metadata.hasMagic()) {
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = 0.1F - var8 * 0.6F;
this.bipedRightArm.rotateAngleX = -1.5707964F;
this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
this.bipedRightArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
} else {
this.unicornArmRight.rotateAngleZ = 0.0F;
this.unicornArmRight.rotateAngleY = 0.1F - var8 * 0.6F;
this.unicornArmRight.rotateAngleX = -1.5707964F;
this.unicornArmRight.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
this.unicornArmRight.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
this.unicornArmRight.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
}
}
this.syncLegs();
}
@Override
protected void fixSpecialRotationPoints(float move) {
if (this.rightArmPose != ArmPose.EMPTY && !this.metadata.hasMagic()) {
this.bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4.0F);
}
}
}

View file

@ -1,98 +0,0 @@
package com.minelittlepony.model.pony.armor;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.*;
public class ModelZombiePonyArmor extends ModelPonyArmor {
@Override
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
float rightArmRotateAngleX;
float leftArmRotateAngleX;
float rightLegRotateAngleX;
float leftLegRotateAngleX;
float var8;
float var9;
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) {
if (this.rainboom) {
rightArmRotateAngleX = ROTATE_270;
leftArmRotateAngleX = ROTATE_270;
rightLegRotateAngleX = ROTATE_90;
leftLegRotateAngleX = ROTATE_90;
} else {
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
}
this.bipedRightArm.rotateAngleY = 0.2F;
this.steveRightArm.rotateAngleY = 0.2F;
this.bipedLeftArm.rotateAngleY = -0.2F;
this.bipedRightLeg.rotateAngleY = -0.2F;
this.bipedLeftLeg.rotateAngleY = 0.2F;
} else {
var8 = (float) Math.pow(swing, 16.0D);
var9 = 3.1415927F * var8 * 0.5F;
float laQuad = 3.1415927F * var8;
float rlQuad = 3.1415927F * var8 * 0.2F;
float llQuad = 3.1415927F * var8 * -0.4F;
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + var9) * 0.45F * swing;
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing;
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing;
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing;
this.bipedRightArm.rotateAngleY = 0.0F;
this.steveRightArm.rotateAngleY = 0.0F;
this.unicornArmRight.rotateAngleY = 0.0F;
this.bipedLeftArm.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleY = 0.0F;
this.bipedLeftLeg.rotateAngleY = 0.0F;
}
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
this.unicornArmRight.rotateAngleX = 0.0F;
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
this.bipedRightArm.rotateAngleZ = 0.0F;
this.steveRightArm.rotateAngleZ = 0.0F;
this.unicornArmRight.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
if (this.rightArmPose == ArmPose.EMPTY) {
var8 = MathHelper.sin(this.swingProgress * 3.1415927F);
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
if (MathHelper.sin(move / 20.0F) < 0.0F) {
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = 0.1F - var8 * 0.6F;
this.bipedRightArm.rotateAngleX = -1.5707964F;
this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
this.bipedRightArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
} else {
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleY = -(0.1F - var8 * 0.6F);
this.bipedLeftArm.rotateAngleX = -1.5707964F;
this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
this.bipedLeftArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
this.bipedLeftArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
}
}
this.syncLegs();
}
@Override
protected void fixSpecialRotationPoints(float move) {
if (this.rightArmPose == ArmPose.EMPTY) {
if (MathHelper.sin(move / 20.0F) < 0.0F) {
shiftRotationPoint(this.bipedRightArm, 0.5F, 1.5F, 3.0F);
} else {
shiftRotationPoint(this.bipedLeftArm, -0.5F, 1.5F, 3.0F);
}
}
}
}

View file

@ -1,11 +0,0 @@
package com.minelittlepony.model.pony.armor;
import com.minelittlepony.model.AbstractArmor;
public class PonyArmors extends AbstractArmor {
public PonyArmors() {
this.modelArmorChestplate = new ModelPonyArmor();
this.modelArmor = new ModelPonyArmor();
}
}

View file

@ -1,11 +0,0 @@
package com.minelittlepony.model.pony.armor;
import com.minelittlepony.model.AbstractArmor;
public class SkeletonPonyArmors extends AbstractArmor {
public SkeletonPonyArmors() {
this.modelArmorChestplate = new ModelSkeletonPonyArmor();
this.modelArmor = new ModelSkeletonPonyArmor();
}
}

View file

@ -1,11 +0,0 @@
package com.minelittlepony.model.pony.armor;
import com.minelittlepony.model.AbstractArmor;
public class ZombiePonyArmors extends AbstractArmor {
public ZombiePonyArmors() {
this.modelArmorChestplate = new ModelZombiePonyArmor();
this.modelArmor = new ModelZombiePonyArmor();
}
}

View file

@ -1,7 +0,0 @@
@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
package com.minelittlepony.model.pony.armor;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -3,7 +3,7 @@ package com.minelittlepony.pony.data;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import com.minelittlepony.MineLittlePony; import com.minelittlepony.MineLittlePony;
import com.minelittlepony.ducks.IDownloadImageData; import com.minelittlepony.ducks.IDownloadImageData;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
import com.voxelmodpack.hdskins.DynamicTextureImage; import com.voxelmodpack.hdskins.DynamicTextureImage;
import com.voxelmodpack.hdskins.ThreadDownloadImageETag; import com.voxelmodpack.hdskins.ThreadDownloadImageETag;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -103,7 +103,7 @@ public class Pony {
return player.capabilities.isFlying || !(player.onGround || player.isRiding() || player.isOnLadder() || player.isInWater() || player.isElytraFlying()); return player.capabilities.isFlying || !(player.onGround || player.isRiding() || player.isOnLadder() || player.isInWater() || player.isElytraFlying());
} }
public PlayerModel getModel(boolean ignorePony) { public ModelWrapper getModel(boolean ignorePony) {
return getRace(ignorePony).getModel().getModel(smallArms); return getRace(ignorePony).getModel().getModel(smallArms);
} }

View file

@ -1,6 +1,6 @@
package com.minelittlepony.pony.data; package com.minelittlepony.pony.data;
import com.minelittlepony.model.PlayerModels; import com.minelittlepony.model.player.PlayerModels;
public enum PonyRace implements ITriggerPixelMapped<PonyRace> { public enum PonyRace implements ITriggerPixelMapped<PonyRace> {

View file

@ -1,4 +1,4 @@
package com.minelittlepony.renderer; package com.minelittlepony.render;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
@ -29,6 +29,18 @@ public class BasePonyRenderer<T extends BasePonyRenderer<T>> extends ModelRender
return (T) this; return (T) this;
} }
public T at(float x, float y, float z) {
offsetX = x;
offsetY = y;
offsetZ = z;
return (T) this;
}
public T around(float x, float y, float z) {
setRotationPoint(x, y, z);
return (T) this;
}
@Override @Override
public T addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth) { public T addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth) {
partName = boxName + "." + partName; partName = boxName + "." + partName;

View file

@ -1,8 +1,9 @@
package com.minelittlepony.renderer; package com.minelittlepony.render;
import static net.minecraft.client.renderer.GlStateManager.color; import static net.minecraft.client.renderer.GlStateManager.color;
import com.minelittlepony.model.ModelHornGlow; import com.minelittlepony.model.components.HornGlow;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
public class HornGlowRenderer extends BasePonyRenderer<HornGlowRenderer> { public class HornGlowRenderer extends BasePonyRenderer<HornGlowRenderer> {
@ -33,7 +34,7 @@ public class HornGlowRenderer extends BasePonyRenderer<HornGlowRenderer> {
@Override @Override
public void addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor) { public void addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor) {
this.cubeList.add(new ModelHornGlow(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor, a)); this.cubeList.add(new HornGlow(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor, a));
} }
@Override @Override

View file

@ -1,12 +1,12 @@
package com.minelittlepony.renderer; package com.minelittlepony.render;
import com.minelittlepony.MineLittlePony; import com.minelittlepony.MineLittlePony;
import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
import com.minelittlepony.renderer.layer.LayerHeldPonyItem; import com.minelittlepony.render.layer.LayerHeldPonyItem;
import com.minelittlepony.renderer.layer.LayerPonyArmor; import com.minelittlepony.render.layer.LayerPonyArmor;
import com.minelittlepony.renderer.layer.LayerPonyCustomHead; import com.minelittlepony.render.layer.LayerPonyCustomHead;
import com.minelittlepony.renderer.layer.LayerPonyElytra; import com.minelittlepony.render.layer.LayerPonyElytra;
import com.voxelmodpack.hdskins.HDSkinManager; import com.voxelmodpack.hdskins.HDSkinManager;
import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
@ -18,9 +18,9 @@ import javax.annotation.OverridingMethodsMustInvokeSuper;
public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving<T> implements IRenderPony { public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving<T> implements IRenderPony {
protected PlayerModel playerModel; protected ModelWrapper playerModel;
public RenderPonyMob(RenderManager renderManager, PlayerModel playerModel) { public RenderPonyMob(RenderManager renderManager, ModelWrapper playerModel) {
super(renderManager, playerModel.getModel(), 0.5F); super(renderManager, playerModel.getModel(), 0.5F);
this.playerModel = playerModel; this.playerModel = playerModel;
@ -66,7 +66,7 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
} }
@Override @Override
public PlayerModel getPlayerModel() { public ModelWrapper getPlayerModel() {
return playerModel; return playerModel;
} }

View file

@ -1,6 +1,7 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.minelittlepony.model.ponies.ModelHumanPlayer;
import com.minelittlepony.model.pony.ModelHumanPlayer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.layers.LayerRenderer; import net.minecraft.client.renderer.entity.layers.LayerRenderer;

View file

@ -1,8 +1,9 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.minelittlepony.ForgeProxy; import com.minelittlepony.ForgeProxy;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.pony.ModelPlayerPony; import com.minelittlepony.model.ponies.ModelPlayerPony;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;

View file

@ -1,10 +1,10 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.minelittlepony.ducks.IRenderItem; import com.minelittlepony.ducks.IRenderItem;
import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.pony.ModelPlayerPony; import com.minelittlepony.model.ponies.ModelPlayerPony;
import com.minelittlepony.pony.data.IPonyData; import com.minelittlepony.pony.data.IPonyData;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;

View file

@ -1,4 +1,4 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.client.renderer.entity.RenderLivingBase;

View file

@ -1,11 +1,12 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.minelittlepony.ForgeProxy; import com.minelittlepony.ForgeProxy;
import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
import com.minelittlepony.model.pony.armor.ModelPonyArmor; import com.minelittlepony.model.armour.ModelPonyArmor;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
@ -32,7 +33,7 @@ public class LayerPonyArmor extends AbstractPonyLayer<EntityLivingBase> {
private static final Map<String, ResourceLocation> HUMAN_ARMORS = Maps.newHashMap(); private static final Map<String, ResourceLocation> HUMAN_ARMORS = Maps.newHashMap();
private static final Map<ResourceLocation, ResourceLocation> PONY_ARMORS = Maps.newHashMap(); private static final Map<ResourceLocation, ResourceLocation> PONY_ARMORS = Maps.newHashMap();
private PlayerModel pony; private ModelWrapper pony;
public LayerPonyArmor(RenderLivingBase<? extends EntityLivingBase> renderer) { public LayerPonyArmor(RenderLivingBase<? extends EntityLivingBase> renderer) {
super(renderer, new LayerBipedArmor(renderer)); super(renderer, new LayerBipedArmor(renderer));

View file

@ -1,8 +1,9 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.client.renderer.entity.RenderPlayer;
@ -24,7 +25,7 @@ public class LayerPonyCape extends AbstractPonyLayer<AbstractClientPlayer> {
@Override @Override
public void doPonyRender(@Nonnull AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6, float p7, float scale) { public void doPonyRender(@Nonnull AbstractClientPlayer clientPlayer, float p2, float p3, float ticks, float p5, float p6, float p7, float scale) {
PlayerModel model = ((IRenderPony) getRenderer()).getPlayerModel(); ModelWrapper model = ((IRenderPony) getRenderer()).getPlayerModel();
if (clientPlayer.hasPlayerInfo() && !clientPlayer.isInvisible() 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) { && clientPlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() != Items.ELYTRA) {

View file

@ -1,10 +1,10 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
import com.minelittlepony.model.pony.ModelPlayerPony; import com.minelittlepony.model.ponies.ModelPlayerPony;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
@ -97,7 +97,7 @@ public class LayerPonyCustomHead implements LayerRenderer<EntityLivingBase> {
} }
private PlayerModel getModel() { private ModelWrapper getModel() {
return ((IRenderPony) renderer).getPlayerModel(); return ((IRenderPony) renderer).getPlayerModel();
} }

View file

@ -1,9 +1,10 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.ModelPonyElytra; import com.minelittlepony.model.components.PonyElytra;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.client.renderer.entity.RenderLivingBase;
@ -21,7 +22,7 @@ import javax.annotation.Nonnull;
public class LayerPonyElytra extends AbstractPonyLayer<EntityLivingBase> { public class LayerPonyElytra extends AbstractPonyLayer<EntityLivingBase> {
private static final ResourceLocation TEXTURE_ELYTRA = new ResourceLocation("textures/entity/elytra.png"); private static final ResourceLocation TEXTURE_ELYTRA = new ResourceLocation("textures/entity/elytra.png");
private ModelPonyElytra modelElytra = new ModelPonyElytra(); private PonyElytra modelElytra = new PonyElytra();
public LayerPonyElytra(RenderLivingBase<?> rp) { public LayerPonyElytra(RenderLivingBase<?> rp) {
super(rp, new LayerElytra(rp)); super(rp, new LayerElytra(rp));

View file

@ -1,6 +1,7 @@
package com.minelittlepony.renderer.layer; package com.minelittlepony.render.layer;
import com.minelittlepony.model.ponies.ModelSkeletonPony;
import com.minelittlepony.model.pony.ModelSkeletonPony;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.entity.monster.EntityStray; import net.minecraft.entity.monster.EntityStray;

View file

@ -1,6 +1,6 @@
@MethodsReturnNonnullByDefault @MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault @ParametersAreNonnullByDefault
package com.minelittlepony.renderer; package com.minelittlepony.render.layer;
import mcp.MethodsReturnNonnullByDefault; import mcp.MethodsReturnNonnullByDefault;

View file

@ -1,6 +1,6 @@
@MethodsReturnNonnullByDefault @MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault @ParametersAreNonnullByDefault
package com.minelittlepony.gui; package com.minelittlepony.render;
import mcp.MethodsReturnNonnullByDefault; import mcp.MethodsReturnNonnullByDefault;

View file

@ -1,4 +1,4 @@
package com.minelittlepony.renderer.plane; package com.minelittlepony.render.plane;
enum Face { enum Face {
WEST, EAST, WEST, EAST,

View file

@ -1,4 +1,4 @@
package com.minelittlepony.renderer.plane; package com.minelittlepony.render.plane;
import net.minecraft.client.model.ModelBox; import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.PositionTextureVertex; import net.minecraft.client.model.PositionTextureVertex;

View file

@ -1,6 +1,6 @@
package com.minelittlepony.renderer.plane; package com.minelittlepony.render.plane;
import com.minelittlepony.renderer.BasePonyRenderer; import com.minelittlepony.render.BasePonyRenderer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;

View file

@ -1,18 +1,18 @@
package com.minelittlepony.renderer.player; package com.minelittlepony.render.player;
import com.minelittlepony.MineLittlePony; import com.minelittlepony.MineLittlePony;
import com.minelittlepony.ducks.IRenderManager; import com.minelittlepony.ducks.IRenderManager;
import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
import com.minelittlepony.model.pony.ModelPlayerPony; import com.minelittlepony.model.ponies.ModelPlayerPony;
import com.minelittlepony.pony.data.Pony; import com.minelittlepony.pony.data.Pony;
import com.minelittlepony.renderer.layer.LayerEntityOnPonyShoulder; import com.minelittlepony.render.layer.LayerEntityOnPonyShoulder;
import com.minelittlepony.renderer.layer.LayerHeldPonyItem; import com.minelittlepony.render.layer.LayerHeldPonyItem;
import com.minelittlepony.renderer.layer.LayerPonyArmor; import com.minelittlepony.render.layer.LayerPonyArmor;
import com.minelittlepony.renderer.layer.LayerPonyCape; import com.minelittlepony.render.layer.LayerPonyCape;
import com.minelittlepony.renderer.layer.LayerPonyCustomHead; import com.minelittlepony.render.layer.LayerPonyCustomHead;
import com.minelittlepony.renderer.layer.LayerPonyElytra; import com.minelittlepony.render.layer.LayerPonyElytra;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -25,13 +25,13 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
protected final boolean smallArms; protected final boolean smallArms;
private PlayerModel playerModel; private ModelWrapper playerModel;
protected AbstractPonyModel ponyModel; protected AbstractPonyModel ponyModel;
private Pony pony; private Pony pony;
public RenderPonyBase(RenderManager manager, boolean useSmallArms, String id, PlayerModel model) { public RenderPonyBase(RenderManager manager, boolean useSmallArms, String id, ModelWrapper model) {
super(manager, useSmallArms); super(manager, useSmallArms);
smallArms = useSmallArms; smallArms = useSmallArms;
@ -126,11 +126,11 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
} }
@Override @Override
public PlayerModel getPlayerModel() { public ModelWrapper getPlayerModel() {
return playerModel; return playerModel;
} }
protected void setPlayerModel(PlayerModel model) { protected void setPlayerModel(ModelWrapper model) {
playerModel = model; playerModel = model;
mainModel = ponyModel = playerModel.getModel(); mainModel = ponyModel = playerModel.getModel();
} }

View file

@ -1,15 +1,15 @@
package com.minelittlepony.renderer.player; package com.minelittlepony.render.player;
import com.minelittlepony.MineLittlePony; import com.minelittlepony.MineLittlePony;
import com.minelittlepony.ducks.IPonyAnimationHolder; import com.minelittlepony.ducks.IPonyAnimationHolder;
import com.minelittlepony.model.PlayerModel; import com.minelittlepony.model.ModelWrapper;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
public class RenderPonyPlayer extends RenderPonyBase { public class RenderPonyPlayer extends RenderPonyBase {
public RenderPonyPlayer(RenderManager renderManager, boolean useSmallArms, String id, PlayerModel model) { public RenderPonyPlayer(RenderManager renderManager, boolean useSmallArms, String id, ModelWrapper model) {
super(renderManager, useSmallArms, id, model); super(renderManager, useSmallArms, id, model);
} }

View file

@ -1,8 +1,10 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.model.pony.ModelIllagerPony; import com.minelittlepony.model.ponies.ModelIllagerPony;
import com.minelittlepony.renderer.layer.LayerHeldPonyItem; import com.minelittlepony.render.RenderPonyMob;
import com.minelittlepony.render.layer.LayerHeldPonyItem;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -1,8 +1,10 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.model.pony.ModelIllagerPony; import com.minelittlepony.model.ponies.ModelIllagerPony;
import com.minelittlepony.renderer.layer.LayerHeldPonyItem; import com.minelittlepony.render.RenderPonyMob;
import com.minelittlepony.render.layer.LayerHeldPonyItem;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -1,6 +1,8 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.render.RenderPonyMob;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;

View file

@ -1,7 +1,9 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.renderer.layer.LayerPonyStrayOverlay; import com.minelittlepony.render.RenderPonyMob;
import com.minelittlepony.render.layer.LayerPonyStrayOverlay;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;

View file

@ -1,6 +1,7 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.ponies.ModelBreezie;
import com.minelittlepony.model.pony.ModelBreezie;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderBiped; import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;

View file

@ -1,6 +1,8 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.render.RenderPonyMob;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityVillager;

View file

@ -1,8 +1,10 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.model.pony.ModelIllagerPony; import com.minelittlepony.model.ponies.ModelIllagerPony;
import com.minelittlepony.renderer.layer.LayerHeldPonyItem; import com.minelittlepony.render.RenderPonyMob;
import com.minelittlepony.render.layer.LayerHeldPonyItem;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -1,6 +1,7 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.render.RenderPonyMob;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;

View file

@ -1,6 +1,8 @@
package com.minelittlepony.renderer; package com.minelittlepony.render.ponies;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.render.RenderPonyMob;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityZombieVillager; import net.minecraft.entity.monster.EntityZombieVillager;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;

View file

@ -0,0 +1,8 @@
/**
*
*/
/**
* @author Chris Albers
*
*/
package com.minelittlepony.render.ponies;

View file

@ -1,7 +0,0 @@
@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
package com.minelittlepony.renderer.layer;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;