for thanksgiving i give minecraft a turkey

Ya its been done before but i'm trying to get into the holiday spirit
with my mods.  Most of my mods care less what day it is but farm tech
will now have turkeys
This commit is contained in:
Robert 2013-11-28 07:12:49 -05:00
parent 54b4b91c94
commit 97557cdbe8
7 changed files with 269 additions and 4 deletions

BIN
models/Chicken.tcn Normal file

Binary file not shown.

BIN
models/Turkey.tcn Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -1,11 +1,24 @@
package dark.farmtech.client;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.Item;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.core.client.renders.RenderTestCar;
import dark.core.prefab.vehicles.EntityTestCar;
import dark.farmtech.CommonProxy;
import dark.farmtech.client.renders.RenderTurkey;
import dark.farmtech.entities.EntityFarmEgg;
import dark.farmtech.entities.EntityTurkey;
@SideOnly(Side.CLIENT)
public class ClientProxy extends CommonProxy
{
@Override
public void init()
{
RenderingRegistry.registerEntityRenderingHandler(EntityTurkey.class, new RenderTurkey());
RenderingRegistry.registerEntityRenderingHandler(EntityFarmEgg.class, new RenderSnowball(Item.egg));
}
}

View file

@ -0,0 +1,169 @@
// Date: 11/28/2013 6:18:31 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package dark.farmtech.client.models;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
public class ModelTurkey extends ModelBase
{
//fields
ModelRenderer head;
ModelRenderer bill;
ModelRenderer chin;
ModelRenderer body;
ModelRenderer body2;
ModelRenderer rightLeg;
ModelRenderer leftLeg;
ModelRenderer rightWing;
ModelRenderer leftWing;
ModelRenderer neck;
ModelRenderer fan;
public ModelTurkey()
{
textureWidth = 128;
textureHeight = 128;
head = new ModelRenderer(this, 0, 0);
head.addBox(0F, -1F, -4F, 4, 6, 3);
head.setRotationPoint(-2F, 6F, -3F);
head.setTextureSize(128, 128);
head.mirror = true;
setRotation(head, 0F, 0F, 0F);
bill = new ModelRenderer(this, 14, 0);
bill.addBox(0F, -1F, -4F, 4, 2, 2);
bill.setRotationPoint(-2F, 8F, -5F);
bill.setTextureSize(128, 128);
bill.mirror = true;
setRotation(bill, 0F, 0F, 0F);
chin = new ModelRenderer(this, 14, 4);
chin.addBox(0F, -1F, -4F, 2, 2, 2);
chin.setRotationPoint(-1F, 10F, -4F);
chin.setTextureSize(128, 128);
chin.mirror = true;
setRotation(chin, 0F, 0F, 0F);
body = new ModelRenderer(this, 0, 9);
body.addBox(0F, 0F, 0F, 8, 10, 9);
body.setRotationPoint(-4F, 9F, -3F);
body.setTextureSize(128, 128);
body.mirror = true;
setRotation(body, 0F, 0F, 0F);
body2 = new ModelRenderer(this, 54, 9);
body2.addBox(0F, 0F, 0F, 8, 8, 2);
body2.setRotationPoint(-4F, 11F, -5F);
body2.setTextureSize(128, 128);
body2.mirror = true;
setRotation(body2, 0.1396263F, 0F, 0F);
rightLeg = new ModelRenderer(this, 0, 32);
rightLeg.addBox(2F, 3F, 1F, 2, 5, 2);
rightLeg.setRotationPoint(-1F, 16F, -2F);
rightLeg.setTextureSize(128, 128);
rightLeg.mirror = true;
setRotation(rightLeg, 0F, 0F, 0F);
leftLeg = new ModelRenderer(this, 0, 32);
leftLeg.addBox(-2F, 3F, 1F, 2, 5, 2);
leftLeg.setRotationPoint(-1F, 16F, -2F);
leftLeg.setTextureSize(128, 128);
leftLeg.mirror = true;
setRotation(leftLeg, 0F, 0F, 0F);
rightWing = new ModelRenderer(this, 36, 13);
rightWing.addBox(-5F, -6F, 0F, 1, 7, 7);
rightWing.setRotationPoint(0F, 16F, -2F);
rightWing.setTextureSize(128, 128);
rightWing.mirror = true;
setRotation(rightWing, -0.1745329F, 0F, 0F);
leftWing = new ModelRenderer(this, 36, 13);
leftWing.addBox(5F, -6F, 0F, 1, 7, 7);
leftWing.setRotationPoint(-1F, 16F, -2F);
leftWing.setTextureSize(128, 128);
leftWing.mirror = true;
setRotation(leftWing, -0.1745329F, 0F, 0F);
neck = new ModelRenderer(this, 34, 0);
neck.addBox(0F, 0F, -4F, 3, 4, 4);
neck.setRotationPoint(-1.5F, 8F, -2F);
neck.setTextureSize(128, 128);
neck.mirror = true;
setRotation(neck, 0F, 0F, 0F);
fan = new ModelRenderer(this, 0, 43);
fan.addBox(0F, 0F, 0.05F, 12, 11, 0);
fan.setRotationPoint(-6F, 4F, 6F);
fan.setTextureSize(128, 128);
fan.mirror = true;
setRotation(fan, 0F, 0F, 0F);
}
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
{
this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
if (this.isChild)
{
float f6 = 2.0F;
GL11.glPushMatrix();
GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7);
this.head.render(par7);
this.bill.render(par7);
this.chin.render(par7);
this.neck.render(par7);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
this.body.render(par7);
this.body2.render(par7);
this.fan.render(par7);
this.rightLeg.render(par7);
this.leftLeg.render(par7);
this.rightWing.render(par7);
this.leftWing.render(par7);
GL11.glPopMatrix();
}
else
{
this.head.render(par7);
this.bill.render(par7);
this.chin.render(par7);
this.body.render(par7);
this.body2.render(par7);
this.rightLeg.render(par7);
this.leftLeg.render(par7);
this.rightWing.render(par7);
this.leftWing.render(par7);
}
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)
{
this.head.rotateAngleX = par5 / (180F / (float)Math.PI);
this.head.rotateAngleY = par4 / (180F / (float)Math.PI);
this.bill.rotateAngleX = this.head.rotateAngleX;
this.bill.rotateAngleY = this.head.rotateAngleY;
this.chin.rotateAngleX = this.head.rotateAngleX;
this.chin.rotateAngleY = this.head.rotateAngleY;
this.body.rotateAngleX = ((float)Math.PI / 2F);
this.body2.rotateAngleX = ((float)Math.PI / 2F);
this.fan.rotateAngleX = ((float)Math.PI / 2F);
this.neck.rotateAngleX = ((float)Math.PI / 2F);
this.rightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
this.leftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
this.rightWing.rotateAngleZ = par3;
this.leftWing.rotateAngleZ = -par3;
}
}

View file

@ -0,0 +1,79 @@
package dark.farmtech.client.renders;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.farmtech.FarmTech;
import dark.farmtech.client.models.ModelTurkey;
import dark.farmtech.entities.EntityTurkey;
@SideOnly(Side.CLIENT)
public class RenderTurkey extends RenderLiving
{
private static final ResourceLocation TEXTURE = new ResourceLocation(FarmTech.instance.DOMAIN, FarmTech.MODEL_DIRECTORY + "Turkey.png");
public RenderTurkey()
{
super(new ModelTurkey(), 0.3f);
}
public void renderChicken(EntityTurkey par1EntityChicken, double par2, double par4, double par6, float par8, float par9)
{
super.doRenderLiving(par1EntityChicken, par2, par4, par6, par8, par9);
}
protected ResourceLocation getChickenTextures(EntityTurkey par1EntityChicken)
{
return TEXTURE;
}
protected float getWingRotation(EntityTurkey par1EntityChicken, float par2)
{
float f1 = par1EntityChicken.field_70888_h + (par1EntityChicken.field_70886_e - par1EntityChicken.field_70888_h) * par2;
float f2 = par1EntityChicken.field_70884_g + (par1EntityChicken.destPos - par1EntityChicken.field_70884_g) * par2;
return (MathHelper.sin(f1) + 1.0F) * f2;
}
@Override
public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
{
this.renderChicken((EntityTurkey) par1EntityLiving, par2, par4, par6, par8, par9);
}
/** Defines what float the third param in setRotationAngles of ModelBase is */
@Override
protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2)
{
return this.getWingRotation((EntityTurkey) par1EntityLivingBase, par2);
}
@Override
public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)
{
this.renderChicken((EntityTurkey) par1EntityLivingBase, par2, par4, par6, par8, par9);
}
/** Returns the location of an entity's texture. Doesn't seem to be called unless you call
* Render.bindEntityTexture. */
@Override
protected ResourceLocation getEntityTexture(Entity par1Entity)
{
return this.getChickenTextures((EntityTurkey) par1Entity);
}
/** Actually renders the given argument. This is a synthetic bridge method, always casting down
* its argument and then handing it off to a worker function which does the actual work. In all
* probabilty, the class Render is generic (Render<T extends Entity) and this method has
* signature public void doRender(T entity, double d, double d1, double d2, float f, float f1).
* But JAD is pre 1.5 so doesn't do that. */
@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
this.renderChicken((EntityTurkey) par1Entity, par2, par4, par6, par8, par9);
}
}

View file

@ -1,8 +1,12 @@
package dark.farmtech.entities;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import cpw.mods.fml.common.registry.EntityRegistry;
import dark.farmtech.FarmTech;
/** Enum of different birds that can be spawned by an egg or in the world threw normal spawning
*
@ -30,9 +34,9 @@ public enum EnumBird
@Override
public void register()
{
//EntityRegistry.registerGlobalEntityID(EntityTurkey.class, "FTTurkey", EntityRegistry.findGlobalUniqueEntityId());
//EntityRegistry.registerModEntity(EntityTurkey.class, "FTTurkey", FarmTech.entitiesIds++, this, 64, 1, true);
//EntityRegistry.addSpawn(EntityTurkey.class, 3, 1, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.river);
EntityRegistry.registerGlobalEntityID(EntityTurkey.class, "FTTurkey", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(EntityTurkey.class, "FTTurkey", FarmTech.entitiesIds++, this, 64, 1, true);
EntityRegistry.addSpawn(EntityTurkey.class, 3, 1, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.river);
}
@Override