Add breezies as the vex.

This commit is contained in:
Matthew Messinger 2016-11-16 23:45:04 -05:00
parent 38ccaf8e2d
commit 9fd9a1b7ec
10 changed files with 314 additions and 3 deletions

View file

@ -9,6 +9,7 @@ import javax.annotation.Nullable;
import org.apache.commons.io.IOUtils;
import com.google.common.base.Throwables;
import com.voxelmodpack.hdskins.DynamicTextureImage;
import com.voxelmodpack.hdskins.ImageBufferDownloadHD;
@ -52,7 +53,7 @@ public class ImageLoader implements Callable<ResourceLocation> {
IOUtils.closeQuietly(in);
}
} catch (IOException e) {
e.printStackTrace();
Throwables.propagate(e);
}
return null;
}

View file

@ -8,6 +8,7 @@ import com.minelittlepony.hdskins.gui.GuiSkinsMineLP;
import com.minelittlepony.hdskins.gui.RenderPonyModel;
import com.minelittlepony.renderer.RenderPonyPigman;
import com.minelittlepony.renderer.RenderPonySkeleton;
import com.minelittlepony.renderer.RenderPonyVex;
import com.minelittlepony.renderer.RenderPonyVillager;
import com.minelittlepony.renderer.RenderPonyZombie;
import com.minelittlepony.renderer.RenderPonyZombieVillager;
@ -25,6 +26,7 @@ import net.minecraft.entity.monster.EntityHusk;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityStray;
import net.minecraft.entity.monster.EntityVex;
import net.minecraft.entity.monster.EntityWitherSkeleton;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.monster.EntityZombieVillager;
@ -103,6 +105,10 @@ public class MineLittlePony {
MineLPLogger.info("Skeletons are now ponies.");
}
if (this.config.illagers) {
ModUtilities.addRenderer(EntityVex.class, new RenderPonyVex(rm));
}
}
void onTick(Minecraft minecraft, boolean inGame) {

View file

@ -26,6 +26,8 @@ public class PonyConfig implements Exposable {
public boolean pigzombies = true;
@Expose
public boolean skeletons = true;
@Expose
public boolean illagers = true;
public PonyLevel getPonyLevel() {
if (ponylevel == null)

View file

@ -0,0 +1,216 @@
package com.minelittlepony.model.pony;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.math.MathHelper;
public class ModelBreezie extends ModelBiped {
ModelRenderer neck;
ModelRenderer snuzzle;
ModelRenderer leftEar;
ModelRenderer rightEar;
ModelRenderer leftAntenna;
ModelRenderer rightAntenna;
ModelRenderer tail;
ModelRenderer tailStub;
ModelRenderer leftWing;
ModelRenderer rightWing;
public ModelBreezie() {
textureWidth = 64;
textureHeight = 64;
this.bipedHeadwear.showModel = false;
bipedHead = new ModelRenderer(this, 0, 0);
bipedHead.addBox(0F, 0F, 0F, 6, 6, 6).setRotationPoint(-3F, -7F, -7F);
bipedBody = new ModelRenderer(this, 2, 12);
bipedBody.addBox(0F, 0F, 0F, 6, 7, 14).setRotationPoint(-3F, 1F, -3F);
setRotation(bipedBody, -0.5235988F, 0F, 0F);
bipedRightArm = new ModelRenderer(this, 36, 12);
bipedRightArm.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(-3F, 8F, -5F);
bipedLeftArm = new ModelRenderer(this, 28, 12);
bipedLeftArm.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(1F, 8F, -5F);
bipedLeftLeg = new ModelRenderer(this, 8, 12);
bipedLeftLeg.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(1F, 12F, 3F);
bipedRightLeg = new ModelRenderer(this, 0, 12);
bipedRightLeg.addBox(0F, 0F, 0F, 2, 12, 2).setRotationPoint(-3F, 12F, 3F);
neck = new ModelRenderer(this, 40, 0);
neck.addBox(0F, 0F, 0F, 2, 5, 2).setRotationPoint(-1F, -2F, -4F);
setRotation(neck, 0.0872665F, 0F, 0F);
leftEar = new ModelRenderer(this, 28, 0);
leftEar.addBox(0F, 0F, 0F, 1, 1, 1).setRotationPoint(2F, -8F, -3F);
rightEar = new ModelRenderer(this, 24, 0);
rightEar.addBox(0F, 0F, 0F, 1, 1, 1).setRotationPoint(-3F, -8F, -3F);
leftAntenna = new ModelRenderer(this, 28, 2);
leftAntenna.addBox(0F, 0F, 0F, 1, 6, 1).setRotationPoint(1F, -12F, -4F);
setRotation(leftAntenna, -0.2617994F, 0F, 0F);
rightAntenna = new ModelRenderer(this, 24, 2);
rightAntenna.addBox(0F, 0F, 0F, 1, 6, 1).setRotationPoint(-2F, -12F, -4F);
setRotation(rightAntenna, -0.2617994F, 0F, 0F);
snuzzle = new ModelRenderer(this, 24, 9);
snuzzle.addBox(0F, 0F, 0F, 2, 2, 1).setRotationPoint(-1F, -3F, -8F);
tailStub = new ModelRenderer(this, 40, 7);
tailStub.addBox(0F, 0F, 0F, 1, 1, 3).setRotationPoint(-0.5F, 8F, 8F);
tail = new ModelRenderer(this, 32, 0);
tail.addBox(0F, 0F, 1F, 2, 9, 2).setRotationPoint(-1F, 7F, 10F);
leftWing = new ModelRenderer(this, 0, 40);
leftWing.addBox(0F, -12F, 0F, 24, 24, 0);
leftWing.setRotationPoint(2F, 3F, 1F);
leftWing.setTextureSize(64, 32);
setRotation(leftWing, 0F, -0.6981317F, 0F);
rightWing = new ModelRenderer(this, 0, 40);
rightWing.addBox(-24F, -12F, 0F, 24, 24, 0);
rightWing.setRotationPoint(-2F, 3F, 1F);
rightWing.setTextureSize(64, 32);
rightWing.mirror = true;
setRotation(rightWing, 0F, 0.6981317F, 0F);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
super.render(entity, f, f1, f2, f3, f4, f5);
neck.render(f5);
leftEar.render(f5);
rightEar.render(f5);
leftAntenna.render(f5);
rightAntenna.render(f5);
snuzzle.render(f5);
tailStub.render(f5);
tail.render(f5);
leftWing.render(f5);
rightWing.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@SuppressWarnings("incomplete-switch")
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
// this.bipedRightArm.rotationPointZ = 0.0F;
// this.bipedRightArm.rotationPointX = -5.0F;
// this.bipedLeftArm.rotationPointZ = 0.0F;
// this.bipedLeftArm.rotationPointX = 5.0F;
this.bipedRightArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 2.0F * limbSwingAmount * 0.5F;
this.bipedLeftArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F;
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
this.bipedLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount;
this.bipedRightLeg.rotateAngleY = 0.0F;
this.bipedLeftLeg.rotateAngleY = 0.0F;
this.bipedRightLeg.rotateAngleZ = 0.0F;
this.bipedLeftLeg.rotateAngleZ = 0.0F;
if (this.isRiding) {
this.bipedRightArm.rotateAngleX += -((float) Math.PI / 5F);
this.bipedLeftArm.rotateAngleX += -((float) Math.PI / 5F);
this.bipedRightLeg.rotateAngleX = -1.4137167F;
this.bipedRightLeg.rotateAngleY = ((float) Math.PI / 10F);
this.bipedRightLeg.rotateAngleZ = 0.07853982F;
this.bipedLeftLeg.rotateAngleX = -1.4137167F;
this.bipedLeftLeg.rotateAngleY = -((float) Math.PI / 10F);
this.bipedLeftLeg.rotateAngleZ = -0.07853982F;
}
this.bipedRightArm.rotateAngleY = 0;
this.bipedRightArm.rotateAngleZ = 0F;
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 = 0.5235988F;
break;
case ITEM:
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
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 = -0.5235988F;
break;
case ITEM:
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
this.bipedRightArm.rotateAngleY = 0.0F;
}
if (this.swingProgress > 0.0F) {
EnumHandSide enumhandside = this.getMainHand(entityIn);
ModelRenderer modelrenderer = this.getArmForSide(enumhandside);
float f1 = this.swingProgress;
this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt(f1) * ((float) Math.PI * 2F)) * 0.2F;
if (enumhandside == EnumHandSide.LEFT) {
this.bipedBody.rotateAngleY *= -1.0F;
}
this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
f1 = 1.0F - this.swingProgress;
f1 = f1 * f1;
f1 = f1 * f1;
f1 = 1.0F - f1;
float f2 = MathHelper.sin(f1 * (float) Math.PI);
float f3 = MathHelper.sin(this.swingProgress * (float) Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
modelrenderer.rotateAngleX = (float) (modelrenderer.rotateAngleX - (f2 * 1.2D + f3));
modelrenderer.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
modelrenderer.rotateAngleZ += MathHelper.sin(this.swingProgress * (float) Math.PI) * -0.4F;
}
this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
if (this.rightArmPose == ModelBiped.ArmPose.BOW_AND_ARROW) {
this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY;
this.bipedLeftArm.rotateAngleY = 0.1F + this.bipedHead.rotateAngleY + 0.4F;
this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
} else if (this.leftArmPose == ModelBiped.ArmPose.BOW_AND_ARROW) {
this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY - 0.4F;
this.bipedLeftArm.rotateAngleY = 0.1F + this.bipedHead.rotateAngleY;
this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
}
}
}

View file

@ -67,6 +67,7 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends Rende
public Stray(RenderManager rm) {
super(rm);
this.addLayer(new LayerPonyStrayOverlay(this));
}
@Override
@ -79,7 +80,6 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeleton> extends Rende
public Wither(RenderManager rm) {
super(rm);
this.addLayer(new LayerPonyStrayOverlay(this));
}
@Override

View file

@ -0,0 +1,33 @@
package com.minelittlepony.renderer;
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;
import net.minecraft.entity.monster.EntityVex;
import net.minecraft.util.ResourceLocation;
/**
* AKA a breezie :D
*/
public class RenderPonyVex extends RenderBiped<EntityVex> {
private static final ResourceLocation VEX = new ResourceLocation("minelittlepony", "textures/entity/illager/vex_pony.png");
private static final ResourceLocation VEX_CHARGING = new ResourceLocation("minelittlepony", "textures/entity/illager/vex_charging_pony.png");
public RenderPonyVex(RenderManager renderManagerIn) {
super(renderManagerIn, new ModelBreezie(), 0.3F);
}
@Override
protected void preRenderCallback(EntityVex entitylivingbaseIn, float partialTickTime) {
GlStateManager.scale(0.4F, 0.4F, 0.4F);
}
@Override
protected ResourceLocation getEntityTexture(EntityVex entity) {
return entity.func_190647_dj() ? VEX_CHARGING : VEX;
}
}

View file

@ -17,7 +17,7 @@ import net.minecraft.util.ResourceLocation;
public class RenderPonyZombie<Zombie extends EntityZombie> extends RenderPonyMob<Zombie> {
private static final ResourceLocation ZOMBIE = new ResourceLocation("minelittlepony", "textures/entity/zombie/zombie_pony.png");
private static final ResourceLocation HUSK = new ResourceLocation("minelittlepony", "textures/entity/zombie/zombie_husk_pony.png");
private static final ResourceLocation HUSK = new ResourceLocation("minelittlepony", "textures/entity/zombie/husk_pony.png");
public RenderPonyZombie(RenderManager rendermanager) {
super(rendermanager, PMAPI.zombie);

View file

@ -0,0 +1,53 @@
package com.minelittlepony.renderer;
import com.minelittlepony.model.PMAPI;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityZombieVillager;
import net.minecraft.util.ResourceLocation;
public class RenderPonyZombieVillager extends RenderPonyMob<EntityZombieVillager> {
private static final ResourceLocation GENERIC = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_villager_pony.png");
private static final ResourceLocation FARMER = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_farmer_pony.png");
private static final ResourceLocation LIBRARIAN = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_librarian_pony.png");
private static final ResourceLocation PRIEST = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_priest_pony.png");
private static final ResourceLocation SMITH = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_smith_pony.png");
private static final ResourceLocation BUTCHER = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_butcher_pony.png");
public RenderPonyZombieVillager(RenderManager renderManager) {
super(renderManager, PMAPI.villager);
}
@Override
protected ResourceLocation getEntityTexture(EntityZombieVillager villager) {
return getTexture(getTextureForVillager(villager));
}
private ResourceLocation getTextureForVillager(EntityZombieVillager villager) {
switch (villager.func_190736_dl()) {
case 0:
return FARMER; // applejack
case 1:
return LIBRARIAN; // twilight sparkle
case 2:
return PRIEST; // fluttershy
case 3:
return SMITH; // rarity
case 4:
return BUTCHER; // rainbow dash
case 5:
default:
return GENERIC; // pinkie pie
}
}
@Override
protected void rotateCorpse(EntityZombieVillager villager, float p_77043_2_, float p_77043_3_, float partialTicks) {
if (villager.isConverting()) {
p_77043_3_ += (float) (Math.cos(villager.ticksExisted * 3.25D) * Math.PI * 0.25D);
}
super.rotateCorpse(villager, p_77043_2_, p_77043_3_, partialTicks);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB