Added zebras and finished witches

This commit is contained in:
Sollace 2018-04-30 14:10:30 +02:00
parent 1e73c5d2bf
commit 3da7853265
9 changed files with 111 additions and 14 deletions

View file

@ -58,6 +58,7 @@ public class PonyRenderManager {
registerPlayerSkin(manager, PlayerModels.EARTH);
registerPlayerSkin(manager, PlayerModels.PEGASUS);
registerPlayerSkin(manager, PlayerModels.ALICORN);
registerPlayerSkin(manager, PlayerModels.ZEBRA);
}
private void registerPlayerSkin(RenderManager manager, PlayerModels playerModel) {

View file

@ -3,6 +3,7 @@ package com.minelittlepony.model;
import com.minelittlepony.model.player.ModelAlicorn;
import com.minelittlepony.model.player.ModelEarthPony;
import com.minelittlepony.model.player.ModelPegasus;
import com.minelittlepony.model.player.ModelZebra;
import com.minelittlepony.model.ponies.ModelIllagerPony;
import com.minelittlepony.model.ponies.ModelSkeletonPony;
import com.minelittlepony.model.ponies.ModelVillagerPony;
@ -30,6 +31,9 @@ public final class PMAPI {
public static final ModelWrapper alicorn = new ModelWrapper(new ModelAlicorn(false));
public static final ModelWrapper alicornSmall = new ModelWrapper(new ModelAlicorn(true));
public static final ModelWrapper zebra = new ModelWrapper(new ModelZebra(false));
public static final ModelWrapper zebraSmall = new ModelWrapper(new ModelZebra(true));
public static final ModelWrapper zombie = new ModelWrapper(new ModelZombiePony());
public static final ModelWrapper skeleton = new ModelWrapper(new ModelSkeletonPony());
public static final ModelWrapper villager = new ModelWrapper(new ModelVillagerPony());

View file

@ -20,6 +20,11 @@ public class PonySnout {
pony.bipedHead.addChild(mare);
}
public void rotate(float x, float y, float z) {
mare.rotate(x, y, z);
stallion.rotate(x, y, z);
}
public void init(float yOffset, float stretch) {
mare.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)

View file

@ -0,0 +1,50 @@
package com.minelittlepony.model.player;
import com.minelittlepony.render.PonyRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
public class ModelZebra extends ModelEarthPony {
public PonyRenderer bristles;
public ModelZebra(boolean useSmallArms) {
super(useSmallArms);
}
@Override
protected void renderHead(Entity entity, float move, float swing, float age, float headYaw, float headPitch, float scale) {
GlStateManager.translate(0, -0.1F, 0);
super.renderHead(entity, move, swing, age, headYaw, headPitch, scale);
}
@Override
protected void renderNeck() {
GlStateManager.scale(1, 1.1F, 1);
super.renderNeck();
}
@Override
protected void initHeadTextures() {
super.initHeadTextures();
bristles = new PonyRenderer(this, 56, 32);
bipedHead.addChild(bristles);
}
@Override
protected void initHeadPositions(float yOffset, float stretch) {
super.initHeadPositions(yOffset, stretch);
bristles.offset(-1, -1, -3)
.box(0, -10, 2, 2, 6, 2, scale)
.box(0, -10, 4, 2, 8, 2, scale)
.box(0, -8, 6, 2, 6, 2, scale)
.rotateAngleX = 0.3F;
bristles.child(0).offset(-1.01F, 2, -7) //0.01 to prevent z-fighting
.box(0, -10, 4, 2, 8, 2, scale)
.box(0, -8, 6, 2, 6, 2, scale)
.rotateAngleX = -1F;
}
}

View file

@ -10,7 +10,8 @@ public enum PlayerModels {
@Deprecated HUMAN("default", "slim", () -> PMAPI.pony, () -> PMAPI.ponySmall),
EARTH("earthpony", "slimearthpony", () -> PMAPI.earthpony, () -> PMAPI.earthponySmall),
PEGASUS("pegasus", "slimpegasus", () -> PMAPI.pegasus, () -> PMAPI.pegasusSmall),
ALICORN("alicorn", "slimalicorn", () -> PMAPI.alicorn, () -> PMAPI.alicornSmall);
ALICORN("alicorn", "slimalicorn", () -> PMAPI.alicorn, () -> PMAPI.alicornSmall),
ZEBRA("zebra", "slimzebra", () -> PMAPI.zebra, () -> PMAPI.zebraSmall);
private final ModelResolver normal, slim;

View file

@ -3,38 +3,73 @@ package com.minelittlepony.model.ponies;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.HEAD_RP_X;
import static com.minelittlepony.model.PonyModelConstants.HEAD_RP_Y;
import static com.minelittlepony.model.PonyModelConstants.HEAD_RP_Z;
import static com.minelittlepony.model.PonyModelConstants.PI;
import com.minelittlepony.model.player.ModelZebra;
import com.minelittlepony.render.PonyRenderer;
public class ModelWitchPony extends ModelVillagerPony {
public class ModelWitchPony extends ModelZebra {
private static final ResourceLocation WITCH_TEXTURES = new ResourceLocation("textures/entity/witch.png");
private PonyRenderer witchHat;
public ModelWitchPony() {
super();
super(false);
}
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
EntityWitch witch = ((EntityWitch) entity);
leftArmPose = ArmPose.EMPTY;
rightArmPose = witch.getHeldItemMainhand().isEmpty() ? ArmPose.EMPTY : ArmPose.ITEM;
}
@Override
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
rightArmPose = ArmPose.EMPTY;
leftArmPose = ((EntityWitch) entity).getHeldItemMainhand().isEmpty() ? ArmPose.EMPTY : ArmPose.ITEM;
super.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);
if (leftArmPose != ArmPose.EMPTY) {
if (!canCast()) {
bipedRightArm.rotateAngleX = -2 * (float)Math.PI/3;
if (((EntityWitch)entity).isDrinkingPotion()) {
float noseRot = MathHelper.sin(entity.ticksExisted);
snout.rotate(noseRot * 4.5F * 0.02F, 0, noseRot * 2.5F * 0.02F);
} else {
snout.rotate(0, 0, 0);
}
if (rightArmPose != ArmPose.EMPTY) {
float rot = (float)(Math.tan(ticks / 7) + Math.sin(ticks / 3));
if (rot > 1) rot = 1;
if (rot < -1) rot = -1;
float legDrinkingAngle = -1 * PI/3 + rot;
bipedRightArm.rotateAngleX = legDrinkingAngle;
bipedRightArmwear.rotateAngleX = legDrinkingAngle;
bipedRightArm.rotateAngleY = 0.1F;
bipedRightArmwear.rotateAngleY = 0.1F;
bipedRightArm.offsetZ = 0.1f;
bipedRightArmwear.offsetZ = 0.1f;
if (rot > 0) rot = 0;
bipedHead.rotateAngleX = -rot / 2;
bipedHeadwear.rotateAngleX = -rot / 2;
} else {
bipedRightArm.offsetZ = 0;
bipedRightArmwear.offsetZ = 0;
}
unicornArmRight.offsetZ = -0.1f;
}
}
@Override

View file

@ -10,7 +10,7 @@ public enum PonyRace implements ITriggerPixelMapped<PonyRace> {
UNICORN(0xd19fe4, PlayerModels.ALICORN, false, true),
ALICORN(0xfef9fc, PlayerModels.ALICORN, true, true),
CHANGELING(0x282b29, PlayerModels.ALICORN, true, true),
ZEBRA(0xd0cccf, PlayerModels.EARTH, false, false),
ZEBRA(0xd0cccf, PlayerModels.ZEBRA, false, false),
REFORMED_CHANGELING(0xcaed5a, PlayerModels.ALICORN, true, true),
GRIFFIN(0xae9145, PlayerModels.PEGASUS, true, false),
HIPPOGRIFF(0xd6ddac, PlayerModels.PEGASUS, true, false);

View file

@ -30,7 +30,8 @@ public class RenderPonyWitch extends RenderPonyMob<EntityWitch> {
GlStateManager.translate(-0.1F, 0.7F, 0);
GlStateManager.rotate(110, 1, 0, 0);
} else {
GlStateManager.translate(-0.2F, -0.3F, -0.7F);
GlStateManager.translate(0, -0.3F, -0.8F);
GlStateManager.rotate(10, 1, 0, 0);
}
}
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 769 B