mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-23 04:57:58 +01:00
Clean up armor/armour, clean up villager models, more package changes
This commit is contained in:
parent
403c195007
commit
f151b31597
70 changed files with 709 additions and 954 deletions
|
@ -1,21 +1,20 @@
|
|||
package com.minelittlepony;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.minelittlepony.gui.PonySettingPanel;
|
||||
import com.minelittlepony.hdskins.gui.GuiSkinsMineLP;
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.pony.data.IPonyData;
|
||||
import com.minelittlepony.pony.data.PonyDataSerialzier;
|
||||
import com.minelittlepony.renderer.RenderPonyEvoker;
|
||||
import com.minelittlepony.renderer.RenderPonyIllusionIllager;
|
||||
import com.minelittlepony.renderer.RenderPonyPigman;
|
||||
import com.minelittlepony.renderer.RenderPonySkeleton;
|
||||
import com.minelittlepony.renderer.RenderPonyVex;
|
||||
import com.minelittlepony.renderer.RenderPonyVillager;
|
||||
import com.minelittlepony.renderer.RenderPonyVindicator;
|
||||
import com.minelittlepony.renderer.RenderPonyZombie;
|
||||
import com.minelittlepony.renderer.RenderPonyZombieVillager;
|
||||
import com.minelittlepony.renderer.player.RenderPonyPlayer;
|
||||
import com.minelittlepony.render.player.RenderPonyPlayer;
|
||||
import com.minelittlepony.render.ponies.RenderPonyEvoker;
|
||||
import com.minelittlepony.render.ponies.RenderPonyIllusionIllager;
|
||||
import com.minelittlepony.render.ponies.RenderPonyPigman;
|
||||
import com.minelittlepony.render.ponies.RenderPonySkeleton;
|
||||
import com.minelittlepony.render.ponies.RenderPonyVex;
|
||||
import com.minelittlepony.render.ponies.RenderPonyVillager;
|
||||
import com.minelittlepony.render.ponies.RenderPonyVindicator;
|
||||
import com.minelittlepony.render.ponies.RenderPonyZombie;
|
||||
import com.minelittlepony.render.ponies.RenderPonyZombieVillager;
|
||||
import com.mumfrey.liteloader.core.LiteLoader;
|
||||
import com.mumfrey.liteloader.util.ModUtilities;
|
||||
import com.voxelmodpack.hdskins.HDSkinManager;
|
||||
|
|
|
@ -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.mumfrey.liteloader.client.gui.GuiCheckbox;
|
||||
import com.mumfrey.liteloader.core.LiteLoader;
|
|
@ -1,8 +1,8 @@
|
|||
package com.minelittlepony.ducks;
|
||||
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
|
||||
public interface IRenderPony {
|
||||
|
||||
PlayerModel getPlayerModel();
|
||||
ModelWrapper getPlayerModel();
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@ package com.minelittlepony.hdskins.gui;
|
|||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
import com.minelittlepony.model.BodyPart;
|
||||
import com.minelittlepony.model.ModelPonyElytra;
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.minelittlepony.model.components.PonyElytra;
|
||||
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 net.minecraft.client.model.ModelPlayer;
|
||||
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());
|
||||
|
||||
PlayerModel pm = thePony.getModel(true);
|
||||
ModelWrapper pm = thePony.getModel(true);
|
||||
pm.apply(thePony.getMetadata());
|
||||
|
||||
return pm.getModel();
|
||||
|
@ -42,7 +42,7 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
|
|||
@Override
|
||||
protected LayerRenderer<EntityLivingBase> getElytraLayer() {
|
||||
final LayerRenderer<EntityLivingBase> elytra = super.getElytraLayer();
|
||||
final ModelPonyElytra modelElytra = new ModelPonyElytra();
|
||||
final PonyElytra modelElytra = new PonyElytra();
|
||||
return new AbstractPonyLayer<EntityLivingBase>(this, elytra) {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
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.PonyData;
|
||||
import com.minelittlepony.pony.data.PonySize;
|
||||
|
@ -45,6 +46,8 @@ public abstract class AbstractPonyModel extends ModelPlayer {
|
|||
this.initPositions(yOffset, stretch);
|
||||
}
|
||||
|
||||
public abstract PonyArmor createArmour();
|
||||
|
||||
protected abstract void initTextures();
|
||||
|
||||
protected abstract void initPositions(float yOffset, float stretch);
|
||||
|
@ -76,6 +79,15 @@ public abstract class AbstractPonyModel extends ModelPlayer {
|
|||
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) {
|
||||
if (this.isRiding) {
|
||||
translate(0.0F, -0.6F, -0.2F);
|
||||
|
|
46
src/main/java/com/minelittlepony/model/ModelMobPony.java
Normal file
46
src/main/java/com/minelittlepony/model/ModelMobPony.java
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +1,29 @@
|
|||
package com.minelittlepony.model;
|
||||
|
||||
import com.minelittlepony.model.armour.PonyArmor;
|
||||
import com.minelittlepony.pony.data.IPonyData;
|
||||
|
||||
public class PlayerModel {
|
||||
public class ModelWrapper {
|
||||
|
||||
private final AbstractPonyModel model;
|
||||
private AbstractArmor armor;
|
||||
private final PonyArmor armor;
|
||||
|
||||
public PlayerModel(AbstractPonyModel model) {
|
||||
public ModelWrapper(AbstractPonyModel model) {
|
||||
this.model = model;
|
||||
this.armor = model.createArmour();
|
||||
this.armor.apply(model.metadata);
|
||||
}
|
||||
|
||||
public AbstractPonyModel getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public PlayerModel setArmor(AbstractArmor armor) {
|
||||
this.armor = armor;
|
||||
this.armor.apply(model.metadata);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
getModel().init(0, 0);
|
||||
getArmor().modelArmorChestplate.init(0.0F, 1.0F);
|
||||
getArmor().modelArmor.init(0.0F, 0.5F);
|
||||
model.init(0, 0);
|
||||
armor.init();
|
||||
}
|
||||
|
||||
public AbstractArmor getArmor() {
|
||||
public PonyArmor getArmor() {
|
||||
return armor;
|
||||
}
|
||||
|
|
@ -1,35 +1,36 @@
|
|||
package com.minelittlepony.model;
|
||||
|
||||
import com.minelittlepony.model.pony.ModelHumanPlayer;
|
||||
import com.minelittlepony.model.pony.ModelIllagerPony;
|
||||
import com.minelittlepony.model.pony.ModelPlayerPony;
|
||||
import com.minelittlepony.model.pony.ModelSkeletonPony;
|
||||
import com.minelittlepony.model.pony.ModelVillagerPony;
|
||||
import com.minelittlepony.model.pony.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 com.minelittlepony.model.ponies.ModelHumanPlayer;
|
||||
import com.minelittlepony.model.ponies.ModelIllagerPony;
|
||||
import com.minelittlepony.model.ponies.ModelPlayerPony;
|
||||
import com.minelittlepony.model.ponies.ModelSkeletonPony;
|
||||
import com.minelittlepony.model.ponies.ModelVillagerPony;
|
||||
import com.minelittlepony.model.ponies.ModelZombiePony;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* PMAPI - Pony Models API?
|
||||
*
|
||||
*/
|
||||
public final class PMAPI {
|
||||
|
||||
public static final PlayerModel pony = new PlayerModel(new ModelPlayerPony(false)).setArmor(new PonyArmors());
|
||||
public static final PlayerModel ponySmall = new PlayerModel(new ModelPlayerPony(true)).setArmor(new PonyArmors());
|
||||
public static final ModelWrapper
|
||||
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());
|
||||
public static final PlayerModel humanSmall = new PlayerModel(new ModelHumanPlayer(true)).setArmor(new HumanArmors());
|
||||
human = new ModelWrapper(new ModelHumanPlayer(false)),
|
||||
humanSmall = new ModelWrapper(new ModelHumanPlayer(true)),
|
||||
|
||||
public static final PlayerModel zombie = new PlayerModel(new ModelZombiePony()).setArmor(new ZombiePonyArmors());
|
||||
public static final PlayerModel skeleton = new PlayerModel(new ModelSkeletonPony()).setArmor(new SkeletonPonyArmors());
|
||||
public static final PlayerModel villager = new PlayerModel(new ModelVillagerPony()).setArmor(new PonyArmors());
|
||||
public static final PlayerModel illager = new PlayerModel(new ModelIllagerPony()).setArmor(new PonyArmors());
|
||||
zombie = new ModelWrapper(new ModelZombiePony()),
|
||||
skeleton = new ModelWrapper(new ModelSkeletonPony()),
|
||||
villager = new ModelWrapper(new ModelVillagerPony()),
|
||||
illager = new ModelWrapper(new ModelIllagerPony());
|
||||
|
||||
public static void init() {
|
||||
for (Field field : PMAPI.class.getFields()) {
|
||||
try {
|
||||
PlayerModel model = (PlayerModel) field.get(null);
|
||||
ModelWrapper model = (ModelWrapper) field.get(null);
|
||||
model.init();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -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.entity.Entity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||
|
||||
public class ModelPonyArmor extends ModelPlayerPony {
|
||||
import com.minelittlepony.model.ModelMobPony;
|
||||
|
||||
public ModelRenderer Bodypiece;
|
||||
public ModelRenderer extBody;
|
||||
public ModelRenderer[] extHead;
|
||||
public ModelRenderer[] extLegs;
|
||||
public class ModelPonyArmor extends ModelMobPony {
|
||||
|
||||
public ModelRenderer Bodypiece, extBody;
|
||||
public ModelRenderer[] extHead, extLegs;
|
||||
|
||||
public ModelPonyArmor() {
|
||||
super(false);
|
||||
super();
|
||||
this.textureHeight = 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
|
||||
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;
|
||||
protected void rotateLook(float limbSwing, float limbSwingAmount, float bodySwing, float ticks) {
|
||||
this.bipedBody.rotateAngleY = bodySwing * 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) {
|
||||
|
||||
@Override
|
||||
protected void adjustBodyRiding() {
|
||||
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
|
||||
|
@ -102,9 +53,11 @@ public class ModelPonyArmor extends ModelPlayerPony {
|
|||
this.bipedBody.rotateAngleX = rotateAngleX;
|
||||
this.bipedBody.rotationPointY = rotationPointY;
|
||||
this.bipedBody.rotationPointZ = rotationPointZ;
|
||||
|
||||
this.Bodypiece.rotateAngleX = rotateAngleX;
|
||||
this.Bodypiece.rotationPointY = rotationPointY;
|
||||
this.Bodypiece.rotationPointZ = rotationPointZ;
|
||||
|
||||
this.extBody.rotateAngleX = rotateAngleX;
|
||||
this.extBody.rotationPointY = rotationPointY;
|
||||
this.extBody.rotationPointZ = rotationPointZ;
|
||||
|
@ -194,32 +147,36 @@ public class ModelPonyArmor extends ModelPlayerPony {
|
|||
|
||||
@Override
|
||||
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.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
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.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].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].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.bipedHeadwear.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
|
||||
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.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
|
||||
protected void initBodyPositions(float yOffset, float 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.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.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
|
||||
protected void initLegPositions(float yOffset, float 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].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[0].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].rotateAngleY = this.bipedRightLeg.rotateAngleY;
|
||||
this.extLegs[0].rotateAngleZ = this.bipedRightLeg.rotateAngleZ;
|
||||
|
||||
this.extLegs[0].rotationPointX = this.bipedRightLeg.rotationPointX;
|
||||
this.extLegs[0].rotationPointY = this.bipedRightLeg.rotationPointY;
|
||||
this.extLegs[0].rotationPointZ = this.bipedRightLeg.rotationPointZ;
|
||||
|
||||
this.extLegs[1].rotateAngleX = this.bipedLeftLeg.rotateAngleX;
|
||||
this.extLegs[1].rotateAngleY = this.bipedLeftLeg.rotateAngleY;
|
||||
this.extLegs[1].rotateAngleZ = this.bipedLeftLeg.rotateAngleZ;
|
||||
|
||||
this.extLegs[1].rotationPointX = this.bipedLeftLeg.rotationPointX;
|
||||
this.extLegs[1].rotationPointY = this.bipedLeftLeg.rotationPointY;
|
||||
this.extLegs[1].rotationPointZ = this.bipedLeftLeg.rotationPointZ;
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,22 +1,16 @@
|
|||
package com.minelittlepony.model.pony;
|
||||
package com.minelittlepony.model.armour;
|
||||
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import com.minelittlepony.model.entity.ModelMobPony;
|
||||
|
||||
public class ModelZombiePony extends ModelMobPony {
|
||||
|
||||
public ModelZombiePony() {
|
||||
super();
|
||||
}
|
||||
public class ModelZombiePonyArmor extends ModelPonyArmor {
|
||||
|
||||
private boolean isRight(float move) {
|
||||
return MathHelper.sin(move / 20f) < 0f;
|
||||
return MathHelper.sin(move / 20f) < 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
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)) {
|
||||
rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
|
||||
|
@ -32,13 +26,11 @@ public class ModelZombiePony extends ModelMobPony {
|
|||
|
||||
@Override
|
||||
protected void fixSpecialRotationPoints(float move) {
|
||||
if (rightArmPose != ArmPose.EMPTY) return;
|
||||
|
||||
if (this.rightArmPose != ArmPose.EMPTY) return;
|
||||
if (isRight(move)) {
|
||||
shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3);
|
||||
} else {
|
||||
shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
24
src/main/java/com/minelittlepony/model/armour/PonyArmor.java
Normal file
24
src/main/java/com/minelittlepony/model/armour/PonyArmor.java
Normal 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);
|
||||
}
|
||||
}
|
|
@ -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.PositionTextureVertex;
|
||||
import net.minecraft.client.model.TexturedQuad;
|
||||
|
@ -8,7 +7,9 @@ import net.minecraft.client.renderer.BufferBuilder;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ModelHornGlow extends ModelBox {
|
||||
import com.minelittlepony.render.HornGlowRenderer;
|
||||
|
||||
public class HornGlow extends ModelBox {
|
||||
|
||||
private final float alpha;
|
||||
|
||||
|
@ -16,7 +17,7 @@ public class ModelHornGlow extends ModelBox {
|
|||
|
||||
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);
|
||||
this.parent = parent;
|
||||
this.alpha = alpha;
|
|
@ -1,11 +1,11 @@
|
|||
package com.minelittlepony.model.components;
|
||||
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
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.
|
||||
public class ModelWing {
|
||||
public ModelRenderer[] folded = new ModelRenderer[3],
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.minelittlepony.model.components;
|
||||
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
|
||||
public class PegasusWings extends ModelBase {
|
||||
|
||||
private final AbstractPonyModel pony;
|
||||
|
|
|
@ -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.model.ModelBase;
|
||||
|
@ -8,11 +10,11 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class ModelPonyElytra extends ModelBase {
|
||||
public class PonyElytra extends ModelBase {
|
||||
private ModelRenderer rightWing;
|
||||
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.rightWing = new ModelRenderer(this, 22, 0);
|
||||
this.rightWing.mirror = true;
|
|
@ -1,11 +1,12 @@
|
|||
package com.minelittlepony.model.components;
|
||||
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
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 com.minelittlepony.model.AbstractPonyModel;
|
||||
|
||||
public class PonySnout {
|
||||
|
||||
private PlaneRenderer mare, stallion;
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package com.minelittlepony.model.components;
|
||||
|
||||
import com.minelittlepony.renderer.plane.PlaneRenderer;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
import com.minelittlepony.pony.data.TailLengths;
|
||||
import com.minelittlepony.render.plane.PlaneRenderer;
|
||||
|
||||
public class PonyTail extends PlaneRenderer {
|
||||
|
||||
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);
|
||||
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) {
|
||||
rotateAngleZ = rainboom ? 0 : MathHelper.cos(move * 0.8F) * 0.2F * swing;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package com.minelittlepony.model.components;
|
||||
|
||||
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.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 {
|
||||
HUMAN("default", "slim", () -> PMAPI.human, () -> PMAPI.humanSmall),
|
||||
|
@ -16,7 +19,7 @@ public enum PlayerModels {
|
|||
this.slim = slim;
|
||||
}
|
||||
|
||||
public PlayerModel getModel(boolean slim) {
|
||||
public ModelWrapper getModel(boolean slim) {
|
||||
return slim ? this.slim.resolve() : this.normal.resolve();
|
||||
}
|
||||
|
||||
|
@ -28,6 +31,6 @@ public enum PlayerModels {
|
|||
* FIXME: PMAPI fields are null when the game starts.
|
||||
*/
|
||||
static interface ModelResolver {
|
||||
PlayerModel resolve();
|
||||
ModelWrapper resolve();
|
||||
}
|
||||
}
|
|
@ -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.ModelRenderer;
|
|
@ -1,7 +1,8 @@
|
|||
package com.minelittlepony.model.pony;
|
||||
package com.minelittlepony.model.ponies;
|
||||
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
import com.minelittlepony.model.BodyPart;
|
||||
import com.minelittlepony.model.armour.PonyArmor;
|
||||
|
||||
public class ModelHumanPlayer extends AbstractPonyModel {
|
||||
|
||||
|
@ -27,4 +28,9 @@ public class ModelHumanPlayer extends AbstractPonyModel {
|
|||
protected void initPositions(float yOffset, float stretch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PonyArmor createArmour() {
|
||||
return new PonyArmor(new ModelHumanPlayer(false), new ModelHumanPlayer(false));
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.minelittlepony.model.pony;
|
||||
package com.minelittlepony.model.ponies;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
|
@ -1,12 +1,14 @@
|
|||
package com.minelittlepony.model.pony;
|
||||
package com.minelittlepony.model.ponies;
|
||||
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
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.PonySnout;
|
||||
import com.minelittlepony.model.components.PonyTail;
|
||||
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.renderer.GlStateManager;
|
||||
|
@ -41,6 +43,12 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
this.smallArms = smallArms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PonyArmor createArmour() {
|
||||
return new PonyArmor(new ModelPonyArmor(), new ModelPonyArmor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
super.init(yOffset, stretch);
|
||||
snout = new PonySnout(this, yOffset, stretch);
|
||||
|
@ -49,32 +57,19 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor,
|
||||
Entity entityIn) {
|
||||
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);
|
||||
|
||||
this.checkRainboom(entityIn, limbSwingAmount);
|
||||
this.rotateHead(netHeadYaw, headPitch);
|
||||
this.Tail.swingZ(rainboom, limbSwing, limbSwingAmount);
|
||||
|
||||
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;
|
||||
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.holdItem(limbSwingAmount);
|
||||
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.sneakLegs();
|
||||
this.setHead(0.0F, 6.0F, -2.0F);
|
||||
this.Tail.rotateSneak();
|
||||
} else if (this.isRiding) {
|
||||
|
||||
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.adjustBodyRiding();
|
||||
this.bipedLeftLeg.rotationPointZ = 15;
|
||||
this.bipedLeftLeg.rotationPointY = 10;
|
||||
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.bipedRightArm.rotateAngleZ = (float) (Math.PI * 0.06);
|
||||
|
||||
Tail.rotationPointZ = 13;
|
||||
Tail.rotationPointY = 3;
|
||||
Tail.rotateAngleX = (float) (Math.PI * 0.2);
|
||||
} else {
|
||||
|
||||
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.swingArms(ageInTicks);
|
||||
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) {
|
||||
|
@ -147,6 +118,27 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
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() {
|
||||
copyModelAngles(bipedLeftArm, bipedLeftArmwear);
|
||||
copyModelAngles(bipedRightArm, bipedRightArmwear);
|
||||
|
@ -193,162 +185,145 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
this.adjustLegs();
|
||||
}
|
||||
|
||||
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
||||
float rightArmRotateAngleX;
|
||||
float leftArmRotateAngleX;
|
||||
float rightLegRotateAngleX;
|
||||
float leftLegRotateAngleX;
|
||||
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);
|
||||
public boolean isFlying(Entity entity) {
|
||||
return (isFlying && metadata.getRace().hasWings()) ||
|
||||
(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying());
|
||||
}
|
||||
|
||||
this.steveRightArm.rotateAngleY = 0.2F;
|
||||
this.bipedRightArm.rotateAngleY = 0.2F;
|
||||
this.bipedLeftArm.rotateAngleY = -0.2F;
|
||||
this.bipedRightLeg.rotateAngleY = -0.2F;
|
||||
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
||||
float leftArm, rightArm,
|
||||
leftLeg, rightLeg;
|
||||
|
||||
|
||||
if (isFlying(entity)) {
|
||||
if (this.rainboom) {
|
||||
rightArm = leftArm = ROTATE_270;
|
||||
rightLeg = leftLeg = ROTATE_90;
|
||||
} else {
|
||||
rightArm = leftArm = MathHelper.sin(-swing / 2);
|
||||
rightLeg = leftLeg = MathHelper.sin(swing / 2);
|
||||
}
|
||||
|
||||
steveRightArm.rotateAngleY = bipedRightArm.rotateAngleY = 0.2F;
|
||||
bipedLeftArm.rotateAngleY = bipedRightLeg.rotateAngleY = -0.2F;
|
||||
|
||||
this.bipedLeftLeg.rotateAngleY = 0.2F;
|
||||
|
||||
} else {
|
||||
float swag = (float) Math.pow(swing, 16.0D);
|
||||
float raQuad = 3.1415927F * swag * 0.5F;
|
||||
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;
|
||||
float PI = (float)Math.PI;
|
||||
float pi = PI * (float) Math.pow(swing, 16);
|
||||
|
||||
this.bipedRightArm.rotateAngleY = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
this.bipedRightLeg.rotateAngleY = 0.0F;
|
||||
this.bipedLeftLeg.rotateAngleY = 0.0F;
|
||||
float mve = move * 0.6662F; // magic number ahoy
|
||||
float srt = swing / 4;
|
||||
|
||||
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.steveRightArm.rotateAngleX = rightArmRotateAngleX;
|
||||
this.unicornArmRight.rotateAngleX = 0.0F;
|
||||
this.unicornArmLeft.rotateAngleX = 0.0F;
|
||||
this.bipedRightArm.rotateAngleX = rightArm;
|
||||
this.steveRightArm.rotateAngleX = rightArm;
|
||||
this.unicornArmRight.rotateAngleX = 0;
|
||||
this.unicornArmLeft.rotateAngleX = 0;
|
||||
|
||||
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
|
||||
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
|
||||
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleX = leftArm;
|
||||
this.bipedRightLeg.rotateAngleX = rightLeg;
|
||||
this.bipedLeftLeg.rotateAngleX = leftLeg;
|
||||
|
||||
this.steveRightArm.rotateAngleZ = 0.0F;
|
||||
this.unicornArmRight.rotateAngleZ = 0.0F;
|
||||
this.unicornArmLeft.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.bipedRightArm.rotateAngleZ = 0;
|
||||
|
||||
this.steveRightArm.rotateAngleZ = 0;
|
||||
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() {
|
||||
float sinBodyRotateAngleYFactor = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
float cosBodyRotateAngleYFactor = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
float legOutset = 4.0F;
|
||||
if (this.isSneak && !this.isFlying) {
|
||||
legOutset = smallArms ? 1.0F : 0F;
|
||||
}
|
||||
float sinBodyRotateAngleYFactor = MathHelper.sin(this.bipedBody.rotateAngleY) * 5;
|
||||
float cosBodyRotateAngleYFactor = MathHelper.cos(this.bipedBody.rotateAngleY) * 5;
|
||||
|
||||
if (this.isSleeping) {
|
||||
legOutset = 2.6F;
|
||||
}
|
||||
|
||||
if (this.rainboom) {
|
||||
this.bipedRightArm.rotationPointZ = sinBodyRotateAngleYFactor + 2.0F;
|
||||
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;
|
||||
float legOutset = getLegOutset();
|
||||
float spread = rainboom ? 2 : 1;
|
||||
|
||||
this.bipedRightArm.rotationPointX = 0.0F - cosBodyRotateAngleYFactor - 1.0F + legOutset;
|
||||
this.bipedLeftArm.rotationPointX = cosBodyRotateAngleYFactor + 2.0F - legOutset;
|
||||
this.bipedRightLeg.rotationPointX = 0.0F - cosBodyRotateAngleYFactor - 1.0F + legOutset;
|
||||
this.bipedLeftLeg.rotationPointX = cosBodyRotateAngleYFactor + 1.0F - legOutset;
|
||||
this.bipedRightArm.rotationPointZ = spread + sinBodyRotateAngleYFactor;
|
||||
this.steveRightArm.rotationPointZ = spread + sinBodyRotateAngleYFactor;
|
||||
this.bipedLeftArm.rotationPointZ = spread - sinBodyRotateAngleYFactor;
|
||||
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
|
||||
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
|
||||
|
||||
this.bipedRightArm.rotationPointY = 8.0F;
|
||||
this.bipedLeftArm.rotationPointY = 8.0F;
|
||||
this.bipedRightLeg.rotationPointZ = 10.0F;
|
||||
this.bipedLeftLeg.rotationPointZ = 10.0F;
|
||||
bipedRightArm.rotationPointY = bipedLeftArm.rotationPointY = 8;
|
||||
bipedRightLeg.rotationPointZ = bipedLeftLeg.rotationPointZ = 10;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
|
||||
protected void holdItem(float swing) {
|
||||
if (!this.rainboom && !this.metadata.hasMagic()) {
|
||||
boolean bothHoovesAreOccupied = this.leftArmPose == ArmPose.ITEM && this.rightArmPose == ArmPose.ITEM;
|
||||
|
||||
switch (this.leftArmPose) {
|
||||
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;
|
||||
}
|
||||
|
||||
alignArmForAction(bipedLeftArm, leftArmPose, bothHoovesAreOccupied, swing);
|
||||
alignArmForAction(bipedRightArm, rightArmPose, bothHoovesAreOccupied, swing);
|
||||
} else if (this.metadata.hasMagic()) {
|
||||
if (this.leftArmPose == ArmPose.BLOCK) {
|
||||
this.unicornArmLeft.rotateAngleX = this.unicornArmLeft.rotateAngleX * 0.5F - 0.9424779F;
|
||||
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;
|
||||
}
|
||||
if (this.leftArmPose == ArmPose.BLOCK) blockArm(unicornArmLeft);
|
||||
if (this.rightArmPose == ArmPose.BLOCK) blockArm(unicornArmRight);
|
||||
}
|
||||
|
||||
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) {
|
||||
if (swingProgress > -9990.0F && !this.isSleeping) {
|
||||
float f16 = 1.0F - swingProgress;
|
||||
|
@ -357,59 +332,56 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
float f22 = MathHelper.sin(f16 * 3.1415927F);
|
||||
float f28 = MathHelper.sin(swingProgress * 3.1415927F);
|
||||
float f33 = f28 * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
|
||||
|
||||
EnumHandSide mainSide = this.getMainHand(entity);
|
||||
|
||||
boolean mainRight = mainSide == EnumHandSide.RIGHT;
|
||||
ArmPose mainPose = mainRight ? this.rightArmPose : this.leftArmPose;
|
||||
|
||||
if (this.metadata.hasMagic() && mainPose != ArmPose.EMPTY) {
|
||||
|
||||
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;
|
||||
swingArm(mainRight ? this.unicornArmRight : this.unicornArmLeft, f22, f33, f28);
|
||||
} else {
|
||||
ModelRenderer bipedArm = this.getArmForSide(mainSide);
|
||||
ModelRenderer steveArm = mainRight ? this.steveRightArm : this.steveLeftArm;
|
||||
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;
|
||||
swingArm(this.getArmForSide(mainSide), f22, f33, f28);
|
||||
swingArm(mainRight ? this.steveRightArm : this.steveLeftArm, f22, f33, f28);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
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.rightArmPose != ArmPose.EMPTY && !this.isSleeping) {
|
||||
|
||||
if (this.metadata.hasMagic()) {
|
||||
this.unicornArmRight.rotateAngleZ += cosTickFactor;
|
||||
this.unicornArmRight.rotateAngleX += sinTickFactor;
|
||||
} else {
|
||||
this.bipedRightArm.rotateAngleZ += cosTickFactor;
|
||||
this.bipedRightArm.rotateAngleX += sinTickFactor;
|
||||
|
||||
this.steveRightArm.rotateAngleZ += cosTickFactor;
|
||||
this.steveRightArm.rotateAngleX += sinTickFactor;
|
||||
}
|
||||
}
|
||||
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()) {
|
||||
this.unicornArmLeft.rotateAngleZ += cosTickFactor;
|
||||
this.unicornArmLeft.rotateAngleX += sinTickFactor;
|
||||
} else {
|
||||
this.bipedLeftArm.rotateAngleZ += cosTickFactor;
|
||||
this.bipedLeftArm.rotateAngleX += sinTickFactor;
|
||||
|
||||
this.steveLeftArm.rotateAngleZ += cosTickFactor;
|
||||
this.steveLeftArm.rotateAngleX += sinTickFactor;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void adjustBody(float rotateAngleX, float rotationPointY, float rotationPointZ) {
|
||||
|
@ -422,30 +394,28 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
this.bipedBody.rotationPointY = rotationPointY;
|
||||
this.bipedBody.rotationPointZ = rotationPointZ;
|
||||
|
||||
int k3;
|
||||
for (k3 = 0; k3 < this.Bodypiece.length; ++k3) {
|
||||
this.Bodypiece[k3].rotateAngleX = rotateAngleX;
|
||||
this.Bodypiece[k3].rotationPointY = rotationPointY;
|
||||
this.Bodypiece[k3].rotationPointZ = rotationPointZ;
|
||||
for (PlaneRenderer i : Bodypiece) {
|
||||
i.rotateAngleX = rotateAngleX;
|
||||
i.rotationPointY = rotationPointY;
|
||||
i.rotationPointZ = rotationPointZ;
|
||||
}
|
||||
}
|
||||
|
||||
protected void adjustNeck(float rotateAngleX, float rotationPointY, float rotationPointZ) {
|
||||
BodypieceNeck.rotateAngleX = NECK_ROT_X + rotateAngleX;
|
||||
BodypieceNeck.rotationPointY = rotationPointY;
|
||||
BodypieceNeck.rotationPointZ = rotationPointZ;
|
||||
BodypieceNeck.setRotationPoint(NECK_ROT_X + rotateAngleX, rotationPointY, rotationPointZ);
|
||||
}
|
||||
|
||||
protected void sneakLegs() {
|
||||
this.steveRightArm.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT;
|
||||
|
||||
this.unicornArmRight.rotateAngleX += SNEAK_LEG_X_ROTATION_ADJUSTMENT;
|
||||
this.unicornArmLeft.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.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() {
|
||||
|
@ -453,17 +423,17 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
this.bipedLeftArm.rotateAngleX = ROTATE_270;
|
||||
this.bipedRightLeg.rotateAngleX = ROTATE_90;
|
||||
this.bipedLeftLeg.rotateAngleX = ROTATE_90;
|
||||
float headPosX;
|
||||
float headPosY;
|
||||
float headPosZ;
|
||||
|
||||
float headPosX, headPosY, headPosZ;
|
||||
|
||||
if (this.isSneak) {
|
||||
headPosY = 2.0F;
|
||||
headPosZ = -1.0F;
|
||||
headPosX = 1.0F;
|
||||
headPosY = 2;
|
||||
headPosZ = -1;
|
||||
headPosX = 1;
|
||||
} else {
|
||||
headPosY = 2.0F;
|
||||
headPosZ = 1.0F;
|
||||
headPosX = 1.0F;
|
||||
headPosY = 2;
|
||||
headPosZ = 1;
|
||||
headPosX = 1;
|
||||
}
|
||||
|
||||
this.setHead(headPosX, headPosY, headPosZ);
|
||||
|
@ -624,7 +594,6 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
this.Bodypiece[12] = new PlaneRenderer(this, 32, 0);
|
||||
this.Bodypiece[13] = new PlaneRenderer(this, 32, 0);
|
||||
|
||||
// neck
|
||||
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, -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.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.rotateAngleX = NECK_ROT_X;
|
||||
|
@ -745,8 +714,6 @@ public class ModelPlayerPony extends AbstractPonyModel {
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
|
@ -1,8 +1,10 @@
|
|||
package com.minelittlepony.model.pony;
|
||||
package com.minelittlepony.model.ponies;
|
||||
|
||||
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.entity.Entity;
|
||||
|
@ -19,6 +21,11 @@ public class ModelSkeletonPony extends ModelMobPony {
|
|||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PonyArmor createArmour() {
|
||||
return new PonyArmor(new ModelSkeletonPonyArmor(), new ModelSkeletonPonyArmor());
|
||||
}
|
||||
|
||||
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
|
||||
rightArmPose = ModelBiped.ArmPose.EMPTY;
|
||||
leftArmPose = ModelBiped.ArmPose.EMPTY;
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
package com.minelittlepony.model.pony;
|
||||
package com.minelittlepony.model.ponies;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
package com.minelittlepony.model.pony.armor;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -3,7 +3,7 @@ package com.minelittlepony.pony.data;
|
|||
import com.google.common.base.MoreObjects;
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.ducks.IDownloadImageData;
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.voxelmodpack.hdskins.DynamicTextureImage;
|
||||
import com.voxelmodpack.hdskins.ThreadDownloadImageETag;
|
||||
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());
|
||||
}
|
||||
|
||||
public PlayerModel getModel(boolean ignorePony) {
|
||||
public ModelWrapper getModel(boolean ignorePony) {
|
||||
return getRace(ignorePony).getModel().getModel(smallArms);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.minelittlepony.pony.data;
|
||||
|
||||
import com.minelittlepony.model.PlayerModels;
|
||||
import com.minelittlepony.model.player.PlayerModels;
|
||||
|
||||
public enum PonyRace implements ITriggerPixelMapped<PonyRace> {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
@ -29,6 +29,18 @@ public class BasePonyRenderer<T extends BasePonyRenderer<T>> extends ModelRender
|
|||
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
|
||||
public T addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth) {
|
||||
partName = boxName + "." + partName;
|
|
@ -1,8 +1,9 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render;
|
||||
|
||||
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;
|
||||
|
||||
public class HornGlowRenderer extends BasePonyRenderer<HornGlowRenderer> {
|
||||
|
@ -33,7 +34,7 @@ public class HornGlowRenderer extends BasePonyRenderer<HornGlowRenderer> {
|
|||
|
||||
@Override
|
||||
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
|
|
@ -1,12 +1,12 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.renderer.layer.LayerHeldPonyItem;
|
||||
import com.minelittlepony.renderer.layer.LayerPonyArmor;
|
||||
import com.minelittlepony.renderer.layer.LayerPonyCustomHead;
|
||||
import com.minelittlepony.renderer.layer.LayerPonyElytra;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.minelittlepony.render.layer.LayerHeldPonyItem;
|
||||
import com.minelittlepony.render.layer.LayerPonyArmor;
|
||||
import com.minelittlepony.render.layer.LayerPonyCustomHead;
|
||||
import com.minelittlepony.render.layer.LayerPonyElytra;
|
||||
import com.voxelmodpack.hdskins.HDSkinManager;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
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 {
|
||||
|
||||
protected PlayerModel playerModel;
|
||||
protected ModelWrapper playerModel;
|
||||
|
||||
public RenderPonyMob(RenderManager renderManager, PlayerModel playerModel) {
|
||||
public RenderPonyMob(RenderManager renderManager, ModelWrapper playerModel) {
|
||||
super(renderManager, playerModel.getModel(), 0.5F);
|
||||
this.playerModel = playerModel;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
|
|||
}
|
||||
|
||||
@Override
|
||||
public PlayerModel getPlayerModel() {
|
||||
public ModelWrapper getPlayerModel() {
|
||||
return playerModel;
|
||||
}
|
||||
|
|
@ -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.renderer.entity.RenderLivingBase;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
|
@ -1,8 +1,9 @@
|
|||
package com.minelittlepony.renderer.layer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import com.minelittlepony.ForgeProxy;
|
||||
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.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
|
@ -1,10 +1,10 @@
|
|||
package com.minelittlepony.renderer.layer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import com.minelittlepony.ducks.IRenderItem;
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
import com.minelittlepony.model.BodyPart;
|
||||
import com.minelittlepony.model.pony.ModelPlayerPony;
|
||||
import com.minelittlepony.model.ponies.ModelPlayerPony;
|
||||
import com.minelittlepony.pony.data.IPonyData;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
|
@ -1,4 +1,4 @@
|
|||
package com.minelittlepony.renderer.layer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
|
@ -1,11 +1,12 @@
|
|||
package com.minelittlepony.renderer.layer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.minelittlepony.ForgeProxy;
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.model.pony.armor.ModelPonyArmor;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.minelittlepony.model.armour.ModelPonyArmor;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
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<ResourceLocation, ResourceLocation> PONY_ARMORS = Maps.newHashMap();
|
||||
|
||||
private PlayerModel pony;
|
||||
private ModelWrapper pony;
|
||||
|
||||
public LayerPonyArmor(RenderLivingBase<? extends EntityLivingBase> renderer) {
|
||||
super(renderer, new LayerBipedArmor(renderer));
|
|
@ -1,8 +1,9 @@
|
|||
package com.minelittlepony.renderer.layer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
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.renderer.entity.RenderLivingBase;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
|
@ -24,7 +25,7 @@ public class LayerPonyCape extends AbstractPonyLayer<AbstractClientPlayer> {
|
|||
|
||||
@Override
|
||||
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()
|
||||
&& clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null
|
||||
&& clientPlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() != Items.ELYTRA) {
|
|
@ -1,10 +1,10 @@
|
|||
package com.minelittlepony.renderer.layer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
import com.minelittlepony.model.BodyPart;
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.model.pony.ModelPlayerPony;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.minelittlepony.model.ponies.ModelPlayerPony;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
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();
|
||||
}
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
package com.minelittlepony.renderer.layer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
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.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
||||
|
@ -21,7 +22,7 @@ import javax.annotation.Nonnull;
|
|||
public class LayerPonyElytra extends AbstractPonyLayer<EntityLivingBase> {
|
||||
|
||||
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) {
|
||||
super(rp, new LayerElytra(rp));
|
|
@ -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.renderer.entity.RenderLivingBase;
|
||||
import net.minecraft.entity.monster.EntityStray;
|
|
@ -1,6 +1,6 @@
|
|||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.layer;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
package com.minelittlepony.gui;
|
||||
package com.minelittlepony.render;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.minelittlepony.renderer.plane;
|
||||
package com.minelittlepony.render.plane;
|
||||
|
||||
enum Face {
|
||||
WEST, EAST,
|
|
@ -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.PositionTextureVertex;
|
|
@ -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;
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
package com.minelittlepony.renderer.player;
|
||||
package com.minelittlepony.render.player;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.ducks.IRenderManager;
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.AbstractPonyModel;
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.model.pony.ModelPlayerPony;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.minelittlepony.model.ponies.ModelPlayerPony;
|
||||
import com.minelittlepony.pony.data.Pony;
|
||||
import com.minelittlepony.renderer.layer.LayerEntityOnPonyShoulder;
|
||||
import com.minelittlepony.renderer.layer.LayerHeldPonyItem;
|
||||
import com.minelittlepony.renderer.layer.LayerPonyArmor;
|
||||
import com.minelittlepony.renderer.layer.LayerPonyCape;
|
||||
import com.minelittlepony.renderer.layer.LayerPonyCustomHead;
|
||||
import com.minelittlepony.renderer.layer.LayerPonyElytra;
|
||||
import com.minelittlepony.render.layer.LayerEntityOnPonyShoulder;
|
||||
import com.minelittlepony.render.layer.LayerHeldPonyItem;
|
||||
import com.minelittlepony.render.layer.LayerPonyArmor;
|
||||
import com.minelittlepony.render.layer.LayerPonyCape;
|
||||
import com.minelittlepony.render.layer.LayerPonyCustomHead;
|
||||
import com.minelittlepony.render.layer.LayerPonyElytra;
|
||||
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -25,13 +25,13 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
|
|||
|
||||
protected final boolean smallArms;
|
||||
|
||||
private PlayerModel playerModel;
|
||||
private ModelWrapper playerModel;
|
||||
|
||||
protected AbstractPonyModel ponyModel;
|
||||
|
||||
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);
|
||||
smallArms = useSmallArms;
|
||||
|
||||
|
@ -126,11 +126,11 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
|
|||
}
|
||||
|
||||
@Override
|
||||
public PlayerModel getPlayerModel() {
|
||||
public ModelWrapper getPlayerModel() {
|
||||
return playerModel;
|
||||
}
|
||||
|
||||
protected void setPlayerModel(PlayerModel model) {
|
||||
protected void setPlayerModel(ModelWrapper model) {
|
||||
playerModel = model;
|
||||
mainModel = ponyModel = playerModel.getModel();
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
package com.minelittlepony.renderer.player;
|
||||
package com.minelittlepony.render.player;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
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.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.model.pony.ModelIllagerPony;
|
||||
import com.minelittlepony.renderer.layer.LayerHeldPonyItem;
|
||||
import com.minelittlepony.model.ponies.ModelIllagerPony;
|
||||
import com.minelittlepony.render.RenderPonyMob;
|
||||
import com.minelittlepony.render.layer.LayerHeldPonyItem;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
|
@ -1,8 +1,10 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.model.pony.ModelIllagerPony;
|
||||
import com.minelittlepony.renderer.layer.LayerHeldPonyItem;
|
||||
import com.minelittlepony.model.ponies.ModelIllagerPony;
|
||||
import com.minelittlepony.render.RenderPonyMob;
|
||||
import com.minelittlepony.render.layer.LayerHeldPonyItem;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
|
@ -1,6 +1,8 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.render.RenderPonyMob;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.util.ResourceLocation;
|
|
@ -1,7 +1,9 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
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.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
|
|
@ -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.entity.RenderBiped;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
|
@ -1,6 +1,8 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.render.RenderPonyMob;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
|
@ -1,8 +1,10 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.model.pony.ModelIllagerPony;
|
||||
import com.minelittlepony.renderer.layer.LayerHeldPonyItem;
|
||||
import com.minelittlepony.model.ponies.ModelIllagerPony;
|
||||
import com.minelittlepony.render.RenderPonyMob;
|
||||
import com.minelittlepony.render.layer.LayerHeldPonyItem;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
|
@ -1,6 +1,7 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.render.RenderPonyMob;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
|
@ -1,6 +1,8 @@
|
|||
package com.minelittlepony.renderer;
|
||||
package com.minelittlepony.render.ponies;
|
||||
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.render.RenderPonyMob;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.monster.EntityZombieVillager;
|
||||
import net.minecraft.util.ResourceLocation;
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author Chris Albers
|
||||
*
|
||||
*/
|
||||
package com.minelittlepony.render.ponies;
|
|
@ -1,7 +0,0 @@
|
|||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
package com.minelittlepony.renderer.layer;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
Loading…
Reference in a new issue