add foxes, complete texture
This commit is contained in:
parent
ad930fcbdc
commit
339a7679f7
16 changed files with 138 additions and 67 deletions
|
@ -47,6 +47,7 @@ import client.renderer.entity.RenderWolf;
|
|||
import client.renderer.entity.RenderXpOrb;
|
||||
import client.renderer.model.ModelChicken;
|
||||
import client.renderer.model.ModelCow;
|
||||
import client.renderer.model.ModelFox;
|
||||
import client.renderer.model.ModelHorse;
|
||||
import client.renderer.model.ModelMouse;
|
||||
import client.renderer.model.ModelOcelot;
|
||||
|
@ -118,7 +119,7 @@ public abstract class RenderRegistry {
|
|||
map.put(EntityCow.class, new RenderCow(mgr, new ModelCow()));
|
||||
map.put(EntityMooshroom.class, new RenderMooshroom(mgr, new ModelCow()));
|
||||
map.put(EntityWolf.class, new RenderWolf(mgr, new ModelWolf()));
|
||||
map.put(EntityFox.class, new RenderFox(mgr, new ModelWolf()));
|
||||
map.put(EntityFox.class, new RenderFox(mgr, new ModelFox()));
|
||||
map.put(EntityChicken.class, new RenderChicken(mgr, new ModelChicken()));
|
||||
map.put(EntityOcelot.class, new RenderOcelot(mgr, new ModelOcelot()));
|
||||
map.put(EntityRabbit.class, new RenderRabbit(mgr, new ModelRabbit()));
|
||||
|
|
|
@ -10,10 +10,6 @@ public class RenderFox extends RenderLiving<EntityFox> {
|
|||
super(renderManagerIn, modelBaseIn);
|
||||
}
|
||||
|
||||
protected float handleRotationFloat(EntityFox livingBase, float partialTicks) {
|
||||
return (float)Math.PI / 5F;
|
||||
}
|
||||
|
||||
protected String getEntityTexture(EntityFox entity) {
|
||||
return FOX_TEXTURE;
|
||||
}
|
||||
|
|
97
client/src/main/java/client/renderer/model/ModelFox.java
Normal file
97
client/src/main/java/client/renderer/model/ModelFox.java
Normal file
|
@ -0,0 +1,97 @@
|
|||
package client.renderer.model;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import common.entity.Entity;
|
||||
import common.util.ExtMath;
|
||||
|
||||
public class ModelFox extends ModelBase
|
||||
{
|
||||
private final ModelRenderer head;
|
||||
private final ModelRenderer body;
|
||||
private final ModelRenderer wolfLeg1;
|
||||
private final ModelRenderer wolfLeg2;
|
||||
private final ModelRenderer wolfLeg3;
|
||||
private final ModelRenderer wolfLeg4;
|
||||
private final ModelRenderer tail;
|
||||
|
||||
public ModelFox()
|
||||
{
|
||||
float f = 0.0F;
|
||||
this.head = new ModelRenderer(this, 0, 0);
|
||||
this.head.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, f);
|
||||
this.head.setRotationPoint(-1.0F, 15.5F, -7.0F);
|
||||
this.body = new ModelRenderer(this, 24, 0);
|
||||
this.body.addBox(-3.5F, -2.0F, -2.0F, 5, 13, 5, f);
|
||||
this.body.setRotationPoint(0.0F, 16.0F, -4.0F);
|
||||
this.wolfLeg1 = new ModelRenderer(this, 0, 18);
|
||||
this.wolfLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 6, 2, f);
|
||||
this.wolfLeg1.setRotationPoint(-2.49F, 18.0F, 5.0F);
|
||||
this.wolfLeg2 = new ModelRenderer(this, 0, 18);
|
||||
this.wolfLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 6, 2, f);
|
||||
this.wolfLeg2.setRotationPoint(0.49F, 18.0F, 5.0F);
|
||||
this.wolfLeg3 = new ModelRenderer(this, 0, 18);
|
||||
this.wolfLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 6, 2, f);
|
||||
this.wolfLeg3.setRotationPoint(-2.49F, 18.0F, -4.0F);
|
||||
this.wolfLeg4 = new ModelRenderer(this, 0, 18);
|
||||
this.wolfLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 6, 2, f);
|
||||
this.wolfLeg4.setRotationPoint(0.49F, 18.0F, -4.0F);
|
||||
this.tail = new ModelRenderer(this, 9, 18);
|
||||
this.tail.addBox(-1.5F, 0.0F, -1.0F, 3, 10, 3, f);
|
||||
this.tail.setRotationPoint(-1.0F, 15.0F, 6.0F);
|
||||
this.head.setTextureOffset(16, 14).addBox(-3.15F, -4.35F, 0.0F, 2, 2, 1, f);
|
||||
this.head.setTextureOffset(16, 14).addBox(1.15F, -4.35F, 0.0F, 2, 2, 1, f);
|
||||
this.head.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 2, 4, f);
|
||||
this.head.setTextureOffset(16, 11).addBox(-3.15F, -5.35F, 0.0F, 1, 1, 1, f);
|
||||
this.head.setTextureOffset(16, 11).addBox(2.15F, -5.35F, 0.0F, 1, 1, 1, f);
|
||||
}
|
||||
|
||||
public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
|
||||
{
|
||||
super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
|
||||
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn);
|
||||
|
||||
if (this.isChild)
|
||||
{
|
||||
float f = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 3.5F * scale, 2.0F * scale);
|
||||
this.head.renderWithRotation(scale);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.0F / f, 1.0F / f, 1.0F / f);
|
||||
GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F);
|
||||
this.body.render(scale);
|
||||
this.wolfLeg1.render(scale);
|
||||
this.wolfLeg2.render(scale);
|
||||
this.wolfLeg3.render(scale);
|
||||
this.wolfLeg4.render(scale);
|
||||
this.tail.renderWithRotation(scale);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.head.renderWithRotation(scale);
|
||||
this.body.render(scale);
|
||||
this.wolfLeg1.render(scale);
|
||||
this.wolfLeg2.render(scale);
|
||||
this.wolfLeg3.render(scale);
|
||||
this.wolfLeg4.render(scale);
|
||||
this.tail.renderWithRotation(scale);
|
||||
}
|
||||
}
|
||||
|
||||
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.tail.rotateAngleY = ExtMath.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.body.rotateAngleX = ((float)Math.PI / 2F);
|
||||
this.wolfLeg1.rotateAngleX = ExtMath.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.wolfLeg2.rotateAngleX = ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
|
||||
this.wolfLeg3.rotateAngleX = ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
|
||||
this.wolfLeg4.rotateAngleX = ExtMath.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
|
||||
this.head.rotateAngleX = headPitch / (180F / (float)Math.PI);
|
||||
this.head.rotateAngleY = netHeadYaw / (180F / (float)Math.PI);
|
||||
this.tail.rotateAngleX = (float)Math.PI / 2.5F;
|
||||
}
|
||||
}
|
|
@ -112,9 +112,9 @@ public class ModelWolf extends ModelBase
|
|||
*/
|
||||
public void setLivingAnimations(EntityLiving living, float p_78086_2_, float p_78086_3_, float partialTickTime)
|
||||
{
|
||||
EntityWolf wolf = living instanceof EntityWolf ? (EntityWolf)living : null;
|
||||
EntityWolf wolf = (EntityWolf)living;
|
||||
|
||||
if (wolf != null && wolf.isAngry())
|
||||
if (wolf.isAngry())
|
||||
{
|
||||
this.wolfTail.rotateAngleY = 0.0F;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ public class ModelWolf extends ModelBase
|
|||
this.wolfTail.rotateAngleY = ExtMath.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
|
||||
}
|
||||
|
||||
if (wolf != null && wolf.isSitting())
|
||||
if (wolf.isSitting())
|
||||
{
|
||||
this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F);
|
||||
this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F);
|
||||
|
@ -157,12 +157,10 @@ public class ModelWolf extends ModelBase
|
|||
this.wolfLeg4.rotateAngleX = ExtMath.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
|
||||
}
|
||||
|
||||
if(wolf != null) {
|
||||
this.wolfHeadMain.rotateAngleZ = wolf.getInterestedAngle(partialTickTime) + wolf.getShakeAngle(partialTickTime, 0.0F);
|
||||
this.wolfMane.rotateAngleZ = wolf.getShakeAngle(partialTickTime, -0.08F);
|
||||
this.wolfBody.rotateAngleZ = wolf.getShakeAngle(partialTickTime, -0.16F);
|
||||
this.wolfTail.rotateAngleZ = wolf.getShakeAngle(partialTickTime, -0.2F);
|
||||
}
|
||||
this.wolfHeadMain.rotateAngleZ = wolf.getInterestedAngle(partialTickTime) + wolf.getShakeAngle(partialTickTime, 0.0F);
|
||||
this.wolfMane.rotateAngleZ = wolf.getShakeAngle(partialTickTime, -0.08F);
|
||||
this.wolfBody.rotateAngleZ = wolf.getShakeAngle(partialTickTime, -0.16F);
|
||||
this.wolfTail.rotateAngleZ = wolf.getShakeAngle(partialTickTime, -0.2F);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
BIN
client/src/main/resources/sounds/fox_death.ogg
Normal file
BIN
client/src/main/resources/sounds/fox_death.ogg
Normal file
Binary file not shown.
BIN
client/src/main/resources/sounds/fox_hurt1.ogg
Normal file
BIN
client/src/main/resources/sounds/fox_hurt1.ogg
Normal file
Binary file not shown.
BIN
client/src/main/resources/sounds/fox_hurt2.ogg
Normal file
BIN
client/src/main/resources/sounds/fox_hurt2.ogg
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Loading…
Add table
Add a link
Reference in a new issue