Basic bee modelling done, now onto the AI

This commit is contained in:
Adubbz 2013-10-27 17:20:58 +11:00
parent 37d7ec898e
commit 5df963c5b2
6 changed files with 210 additions and 114 deletions

View File

@ -20,6 +20,7 @@ import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.entities.EntityPhantom;
import biomesoplenty.entities.EntityRosester;
import biomesoplenty.entities.EntityWasp;
import biomesoplenty.entities.projectiles.EntityDart;
import biomesoplenty.entities.projectiles.EntityMudball;
import biomesoplenty.entities.render.RenderDart;
@ -27,6 +28,7 @@ import biomesoplenty.entities.render.RenderGlob;
import biomesoplenty.entities.render.RenderJungleSpider;
import biomesoplenty.entities.render.RenderPhantom;
import biomesoplenty.entities.render.RenderRosester;
import biomesoplenty.entities.render.RenderWasp;
import biomesoplenty.particles.EntityDandelionFX;
import biomesoplenty.particles.EntitySteamFX;
import cpw.mods.fml.client.registry.RenderingRegistry;
@ -70,6 +72,11 @@ public class ClientProxy extends CommonProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityPhantom.class, new RenderPhantom());
}
if (BOPConfigurationIDs.waspID > 0)
{
RenderingRegistry.registerEntityRenderingHandler(EntityWasp.class, new RenderWasp());
}
RenderingRegistry.registerBlockHandler(new FoliageRenderer());
RenderingRegistry.registerBlockHandler(new PlantsRenderer());
RenderingRegistry.registerBlockHandler(new SmallBlockRenderer());

View File

@ -11,11 +11,11 @@ import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.entities.EntityPhantom;
import biomesoplenty.entities.EntityRosester;
import biomesoplenty.entities.EntityWasp;
import biomesoplenty.entities.projectiles.EntityDart;
import biomesoplenty.entities.projectiles.EntityMudball;
import biomesoplenty.entities.projectiles.EntityPoisonDart;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
public class BOPEntities {
@ -91,5 +91,12 @@ public class BOPEntities {
EntityRegistry.addSpawn(EntityPhantom.class, 8, 1, 1, EnumCreatureType.monster, Biomes.netherBone.get(), Biomes.netherDesert.get());
}
}
if (BOPConfigurationIDs.waspID > 0)
{
EntityRegistry.registerModEntity(EntityWasp.class, "Wasp", BOPConfigurationIDs.waspID, BiomesOPlenty.instance, 80, 3, true);
registerEntityEgg(EntityWasp.class, 4472140, 2499368);
}
}
}

View File

@ -293,6 +293,7 @@ public class BOPConfigurationIDs
public static int rosesterID;
public static int globID;
public static int phantomID;
public static int waspID;
public static void init(File configFile)
{
@ -468,6 +469,7 @@ public class BOPConfigurationIDs
rosesterID = config.get("Mob IDs", "Rosester ID", 102, null).getInt();
globID = config.get("Mob IDs", "Glob ID", 106, null).getInt();
phantomID = config.get("Mob IDs", "Phantom ID", 107, null).getInt();
waspID = config.get("Mob IDs", "Wasp ID", 108, null).getInt();
//Projectile IDs
entityMudballID = config.get("Entity IDs", "Mudball ID", 103, null).getInt();;

View File

@ -0,0 +1,30 @@
package biomesoplenty.entities;
import org.lwjgl.opengl.GL11;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.passive.EntityAmbientCreature;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class EntityWasp extends EntityLiving
{
public EntityWasp(World world)
{
super(world);
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
}
public boolean isAIEnabled()
{
return true;
}
@Override
public boolean allowLeashing()
{
return false;
}
}

View File

@ -1,151 +1,177 @@
package biomesoplenty.entities.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 ModelWasp extends ModelBase
{
//fields
/*Head*/
ModelRenderer Head;
ModelRenderer Right_Antenna;
ModelRenderer Left_Antenna;
ModelRenderer Nose;
/*Wings*/
ModelRenderer Left_Wing;
ModelRenderer Right_Wing;
/*Body*/
ModelRenderer Thorax;
ModelRenderer Abdomen;
ModelRenderer Stinger;
ModelRenderer Left_Leg_Back;
ModelRenderer Left_Leg_Middle;
ModelRenderer Left_Leg_Front;
ModelRenderer Right_Leg_Back;
ModelRenderer Right_Leg_Middle;
ModelRenderer Right_Leg_Front;
ModelRenderer Left_Wing;
ModelRenderer Right_Wing;
ModelRenderer Head;
ModelRenderer Nose;
ModelRenderer Left_Antenna;
ModelRenderer Right_Antenna;
/*Stinger*/
ModelRenderer Abdomen;
ModelRenderer Stinger;
public ModelWasp()
{
textureWidth = 64;
textureHeight = 32;
Thorax = new ModelRenderer(this, 0, 0);
Thorax.addBox(0F, 0F, 0F, 5, 5, 8);
Thorax.setRotationPoint(0F, 0F, 0F);
Thorax.setTextureSize(64, 32);
Thorax.mirror = true;
setRotation(Thorax, 0F, 0F, 0F);
Abdomen = new ModelRenderer(this, 0, 13);
Abdomen.addBox(0F, 0F, 0F, 3, 3, 2);
Abdomen.setRotationPoint(1F, 2F, -2F);
Abdomen.setTextureSize(64, 32);
Abdomen.mirror = true;
setRotation(Abdomen, 0F, 0F, 0F);
Stinger = new ModelRenderer(this, 0, 18);
Stinger.addBox(0F, 0F, 0F, 1, 1, 3);
Stinger.setRotationPoint(2F, 4F, -5F);
Stinger.setTextureSize(64, 32);
Stinger.mirror = true;
setRotation(Stinger, 0F, 0F, 0F);
Left_Leg_Back = new ModelRenderer(this, 13, 23);
Left_Leg_Back.addBox(0F, 0F, 0F, 1, 4, 1);
Left_Leg_Back.setRotationPoint(-1F, 4F, 1F);
Left_Leg_Back.setTextureSize(64, 32);
Left_Leg_Back.mirror = true;
setRotation(Left_Leg_Back, 0F, 0F, 0F);
Left_Leg_Middle = new ModelRenderer(this, 13, 23);
Left_Leg_Middle.addBox(0F, 0F, 0F, 1, 3, 1);
Left_Leg_Middle.setRotationPoint(-1F, 4F, 4F);
Left_Leg_Middle.setTextureSize(64, 32);
Left_Leg_Middle.mirror = true;
setRotation(Left_Leg_Middle, 0F, 0F, 0F);
Left_Leg_Front = new ModelRenderer(this, 13, 23);
Left_Leg_Front.addBox(0F, 0F, 0F, 1, 4, 1);
Left_Leg_Front.setRotationPoint(-1F, 4F, 6F);
Left_Leg_Front.setTextureSize(64, 32);
Left_Leg_Front.mirror = true;
setRotation(Left_Leg_Front, 0F, 0F, 0F);
Right_Leg_Back = new ModelRenderer(this, 13, 23);
Right_Leg_Back.addBox(0F, 0F, 0F, 1, 4, 1);
Right_Leg_Back.setRotationPoint(5F, 4F, 1F);
Right_Leg_Back.setTextureSize(64, 32);
Right_Leg_Back.mirror = true;
setRotation(Right_Leg_Back, 0F, 0F, 0F);
Right_Leg_Middle = new ModelRenderer(this, 13, 23);
Right_Leg_Middle.addBox(0F, 0F, 0F, 1, 3, 1);
Right_Leg_Middle.setRotationPoint(5F, 4F, 4F);
Right_Leg_Middle.setTextureSize(64, 32);
Right_Leg_Middle.mirror = true;
setRotation(Right_Leg_Middle, 0F, 0F, 0F);
Right_Leg_Front = new ModelRenderer(this, 13, 23);
Right_Leg_Front.addBox(0F, 0F, 0F, 1, 4, 1);
Right_Leg_Front.setRotationPoint(5F, 4F, 6F);
Right_Leg_Front.setTextureSize(64, 32);
Right_Leg_Front.mirror = true;
setRotation(Right_Leg_Front, 0F, 0F, 0F);
Left_Wing = new ModelRenderer(this, 24, 26);
Left_Wing.addBox(0F, 0F, 0F, 8, 1, 5);
Left_Wing.setRotationPoint(-7F, -1F, 2F);
Left_Wing.setTextureSize(64, 32);
Left_Wing.mirror = true;
setRotation(Left_Wing, 0F, 0F, 0F);
Right_Wing = new ModelRenderer(this, 24, 20);
Right_Wing.addBox(0F, 0F, 0F, 8, 1, 5);
Right_Wing.setRotationPoint(4F, -1F, 2F);
Right_Wing.setTextureSize(64, 32);
Right_Wing.mirror = true;
setRotation(Right_Wing, 0F, 0F, 0F);
/*Head*/
Head = new ModelRenderer(this, 46, 0);
Head.addBox(0F, 0F, 0F, 5, 5, 4);
Head.setRotationPoint(0F, -2F, 8F);
Head.setTextureSize(64, 32);
Head.mirror = true;
setRotation(Head, 0F, 0F, 0F);
Nose = new ModelRenderer(this, 54, 9);
Nose.addBox(0F, 0F, 0F, 3, 4, 2);
Nose.setRotationPoint(1F, 0F, 11F);
Nose.setTextureSize(64, 32);
Nose.mirror = true;
setRotation(Nose, 0F, 0F, 0F);
Left_Antenna = new ModelRenderer(this, 54, 27);
Left_Antenna.addBox(0F, 0F, 0F, 1, 1, 4);
Left_Antenna.setRotationPoint(1F, -3F, 10F);
Left_Antenna.setTextureSize(64, 32);
Left_Antenna.mirror = true;
setRotation(Left_Antenna, 0F, 0F, 0F);
Right_Antenna = new ModelRenderer(this, 54, 27);
Right_Antenna.addBox(0F, 0F, 0F, 1, 1, 4);
Right_Antenna.addBox(0F, 2F, -8F, 1, 1, 4);
Right_Antenna.setRotationPoint(3F, -3F, 10F);
Right_Antenna.setTextureSize(64, 32);
Right_Antenna.mirror = true;
setRotation(Right_Antenna, 0F, 0F, 0F);
Head.addChild(Right_Antenna);
Left_Antenna = new ModelRenderer(this, 54, 27);
Left_Antenna.addBox(0F, 2F, -8F, 1, 1, 4);
Left_Antenna.setRotationPoint(1F, -3F, 10F);
Left_Antenna.setTextureSize(64, 32);
Left_Antenna.mirror = true;
Head.addChild(Left_Antenna);
Nose = new ModelRenderer(this, 54, 9);
Nose.addBox(0F, 2F, -8F, 3, 4, 2);
Nose.setRotationPoint(1F, 0F, 11F);
Nose.setTextureSize(64, 32);
Nose.mirror = true;
Head.addChild(Nose);
/*Wings*/
Left_Wing = new ModelRenderer(this, 24, 26);
Left_Wing.addBox(-7F, 0F, 0F, 8, 1, 5);
Left_Wing.setRotationPoint(0F, -1F, 2F);
Left_Wing.setTextureSize(64, 32);
Right_Wing = new ModelRenderer(this, 24, 20);
Right_Wing.addBox(0F, 0F, 0F, 8, 1, 5);
Right_Wing.setRotationPoint(4F, -1F, 2F);
Right_Wing.setTextureSize(64, 32);
/*Body*/
Thorax = new ModelRenderer(this, 0, 0);
Thorax.addBox(0F, 0F, 0F, 5, 5, 8);
Thorax.setRotationPoint(0F, 0F, 0F);
Thorax.setTextureSize(64, 32);
Left_Leg_Back = new ModelRenderer(this, 13, 23);
Left_Leg_Back.addBox(0F, 0F, 0F, 1, 4, 1);
Left_Leg_Back.setRotationPoint(-1F, 4F, 1F);
Left_Leg_Back.setTextureSize(64, 32);
Thorax.addChild(Left_Leg_Back);
Left_Leg_Middle = new ModelRenderer(this, 13, 23);
Left_Leg_Middle.addBox(0F, 0F, 0F, 1, 3, 1);
Left_Leg_Middle.setRotationPoint(-1F, 4F, 4F);
Left_Leg_Middle.setTextureSize(64, 32);
Thorax.addChild(Left_Leg_Middle);
Left_Leg_Front = new ModelRenderer(this, 13, 23);
Left_Leg_Front.addBox(0F, 0F, 0F, 1, 4, 1);
Left_Leg_Front.setRotationPoint(-1F, 4F, 6F);
Left_Leg_Front.setTextureSize(64, 32);
Thorax.addChild(Left_Leg_Front);
Right_Leg_Back = new ModelRenderer(this, 13, 23);
Right_Leg_Back.addBox(0F, 0F, 0F, 1, 4, 1);
Right_Leg_Back.setRotationPoint(5F, 4F, 1F);
Right_Leg_Back.setTextureSize(64, 32);
Thorax.addChild(Right_Leg_Back);
Right_Leg_Middle = new ModelRenderer(this, 13, 23);
Right_Leg_Middle.addBox(0F, 0F, 0F, 1, 3, 1);
Right_Leg_Middle.setRotationPoint(5F, 4F, 4F);
Right_Leg_Middle.setTextureSize(64, 32);
Thorax.addChild(Right_Leg_Middle);
Right_Leg_Front = new ModelRenderer(this, 13, 23);
Right_Leg_Front.addBox(0F, 0F, 0F, 1, 4, 1);
Right_Leg_Front.setRotationPoint(5F, 4F, 6F);
Right_Leg_Front.setTextureSize(64, 32);
Thorax.addChild(Right_Leg_Front);
/*Stinger*/
Abdomen = new ModelRenderer(this, 0, 13);
Abdomen.addBox(0F, 0F, 0F, 3, 3, 2);
Abdomen.setRotationPoint(1F, 2F, -2F);
Abdomen.setTextureSize(64, 32);
Stinger = new ModelRenderer(this, 0, 18);
Stinger.addBox(-1F, -3F, 2F, 1, 1, 3);
Stinger.setRotationPoint(2F, 4F, -5F);
Stinger.setTextureSize(64, 32);
Abdomen.addChild(Stinger);
}
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);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Thorax.render(f5);
Abdomen.render(f5);
Stinger.render(f5);
Left_Leg_Back.render(f5);
Left_Leg_Middle.render(f5);
Left_Leg_Front.render(f5);
Right_Leg_Back.render(f5);
Right_Leg_Middle.render(f5);
Right_Leg_Front.render(f5);
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
/*Head*/
float headspeed = 0.1F * (float)(entity.entityId % 10);
Head.rotateAngleX = MathHelper.sin((float)entity.ticksExisted * headspeed) * 2.5F * (float)Math.PI / 180.0F;
Head.rotateAngleY = 0.0F;
Head.rotateAngleZ = MathHelper.cos((float)entity.ticksExisted * headspeed) * 1.5F * (float)Math.PI / 180.0F;
Head.render(f5);
/*Wings*/
Right_Wing.rotateAngleY = MathHelper.cos(f2 * 1.7F) * (float)Math.PI * 0.25F;
Left_Wing.rotateAngleY = -Right_Wing.rotateAngleY;
Right_Wing.rotateAngleZ = Right_Wing.rotateAngleY;
Left_Wing.rotateAngleZ = -Right_Wing.rotateAngleY;
Left_Wing.render(f5);
Right_Wing.render(f5);
Head.render(f5);
Nose.render(f5);
Left_Antenna.render(f5);
Right_Antenna.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
/*Body*/
float thoraxspeed = 0.05F * (float)(entity.entityId % 10);
Thorax.rotateAngleX = MathHelper.sin((float)entity.ticksExisted * thoraxspeed) * 2.5F * (float)Math.PI / 180.0F;
Thorax.rotateAngleY = 0.0F;
Thorax.rotateAngleZ = MathHelper.cos((float)entity.ticksExisted * thoraxspeed) * 1.5F * (float)Math.PI / 180.0F;
Thorax.render(f5);
/*float nosespeed = 0.5F * (float)(entity.entityId % 10);
Nose.rotateAngleX = MathHelper.sin((float)entity.ticksExisted * nosespeed) * 2.5F * (float)Math.PI / 180.0F;
Nose.rotateAngleY = 0.0F;
Nose.rotateAngleZ = MathHelper.cos((float)entity.ticksExisted * nosespeed) * 1.5F * (float)Math.PI / 180.0F;*/
/*Stinger*/
float abdomenspeed = 0.6F * (float)(entity.entityId % 10);
Abdomen.rotateAngleX = MathHelper.sin((float)entity.ticksExisted * abdomenspeed) * 2.5F * (float)Math.PI / 180.0F;
Abdomen.rotateAngleY = 0.0F;
Abdomen.rotateAngleZ = MathHelper.cos((float)entity.ticksExisted * abdomenspeed) * 1.5F * (float)Math.PI / 180.0F;
Abdomen.render(f5);
}
@Override

View File

@ -0,0 +1,24 @@
package biomesoplenty.entities.render;
import org.lwjgl.opengl.GL11;
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.ResourceLocation;
import biomesoplenty.entities.models.ModelWasp;
public class RenderWasp extends RenderLiving
{
public RenderWasp()
{
super(new ModelWasp(), 0.25F);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity)
{
return new ResourceLocation("biomesoplenty:textures/mobs/wasp.png");
}
}