Fixed the Glob, Jungle Spiders and Rosesters

This commit is contained in:
Adubbz 2013-07-02 21:05:59 +10:00
parent 36dd91e92f
commit c02fafbd34
7 changed files with 157 additions and 56 deletions

View file

@ -1,6 +1,7 @@
package biomesoplenty;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelChicken;
import net.minecraft.client.model.ModelSlime;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.particle.EntityFX;
@ -19,7 +20,11 @@ import biomesoplenty.blocks.renderers.RenderUtils;
import biomesoplenty.blocks.renderers.SmallBlockRenderer;
import biomesoplenty.blocks.renderers.TileEntityGraveRenderer;
import biomesoplenty.entities.EntityGlob;
import biomesoplenty.entities.RenderGlob;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.entities.EntityRosester;
import biomesoplenty.entities.render.RenderGlob;
import biomesoplenty.entities.render.RenderJungleSpider;
import biomesoplenty.entities.render.RenderRosester;
import biomesoplenty.items.projectiles.EntityDart;
import biomesoplenty.items.projectiles.EntityMudball;
import biomesoplenty.items.projectiles.RenderDart;
@ -50,6 +55,8 @@ public class ClientProxy extends CommonProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, new RenderDart());
RenderingRegistry.registerEntityRenderingHandler(EntityGlob.class, new RenderGlob(new ModelSlime(16), new ModelSlime(0), 0.25F));
RenderingRegistry.registerEntityRenderingHandler(EntityJungleSpider.class, new RenderJungleSpider());
RenderingRegistry.registerEntityRenderingHandler(EntityRosester.class, new RenderRosester(new ModelChicken(), 0.3F));
RenderingRegistry.registerBlockHandler(new FoliageRenderer());
RenderingRegistry.registerBlockHandler(new PlantsRenderer());
@ -67,13 +74,20 @@ public class ClientProxy extends CommonProxy {
{
EntityFX entityfx = null;
if (string == "mud") {
if (string == "mud")
{
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get());
} else if (string == "dart") {
}
else if (string == "dart")
{
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.dart.get());
} else if (string == "dandelion") {
}
else if (string == "dandelion")
{
entityfx = new EntityDandelionFX(mc.theWorld, x, y, z, 2.0F);
} else if (string == "steam") {
}
else if (string == "steam")
{
entityfx = new EntitySteamFX(mc.theWorld, x, y, z, 0.0D, 0.0D, 0.0D);
}

View file

@ -43,25 +43,19 @@ public class EntityGlob extends EntityLiving implements IMob
protected void setGlobSize(int par1)
{
dataWatcher.updateObject(16, new Byte((byte)par1));
this.setSize(0.6F * par1, 0.6F * par1);
this.setPosition(posX, posY, posZ);
this.dataWatcher.updateObject(16, new Byte((byte)par1));
this.setSize(0.6F * (float)par1, 0.6F * (float)par1);
this.setPosition(this.posX, this.posY, this.posZ);
this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a((double)(par1 * par1));
this.setEntityHealth(this.func_110138_aP());
experienceValue = par1;
this.experienceValue = par1;
}
/**
* Returns the size of the Glob.
*/
public int getGlobSize()
{
return dataWatcher.getWatchableObjectByte(16);
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
@Override
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
@ -69,9 +63,6 @@ public class EntityGlob extends EntityLiving implements IMob
par1NBTTagCompound.setInteger("Size", this.getGlobSize() - 1);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
@Override
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{
@ -79,9 +70,6 @@ public class EntityGlob extends EntityLiving implements IMob
this.setGlobSize(par1NBTTagCompound.getInteger("Size") + 1);
}
/**
* Returns the name of the sound played when the Glob jumps.
*/
protected String getJumpSound()
{
return "mob.slime." + (this.getGlobSize() > 1 ? "big" : "small");
@ -346,3 +334,5 @@ public class EntityGlob extends EntityLiving implements IMob
return this.getGlobSize() > 2;
}
}

View file

@ -2,6 +2,7 @@ package biomesoplenty.entities;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -12,30 +13,17 @@ public class EntityJungleSpider extends EntitySpider
public EntityJungleSpider(World par1World)
{
super(par1World);
//texture = "/mods/BiomesOPlenty/textures/mobs/junglespider.png";
this.setSize(0.4F, 0.3F);
//moveSpeed = 1.1F;
}
/*@Override
public int getMaxHealth()
{
return 8;
}*/
/**
* How large the spider should be scaled.
*/
/*@Override
public float spiderScaleAmount()
{
return 0.4F;
}*/
@Override
public float getShadowSize()
protected void func_110147_ax()
{
return 0.0F;
super.func_110147_ax();
//Max health
this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(8.0D);
//Movement speed
this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(1.1D);
}
@Override
@ -69,10 +57,4 @@ public class EntityJungleSpider extends EntitySpider
} else
return false;
}
/**
* Initialize this creature.
*/
/*@Override
public void initCreature() {}*/
}

View file

@ -1,6 +1,7 @@
package biomesoplenty.entities;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
@ -54,11 +55,13 @@ public class EntityRosester extends EntityChicken
return true;
}
/*@Override
public int getMaxHealth()
@Override
protected void func_110147_ax()
{
return 4;
}*/
super.func_110147_ax();
//Max health
this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(4.0D);
}
/**
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons

View file

@ -1,12 +1,14 @@
package biomesoplenty.entities;
package biomesoplenty.entities.render;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.resources.ResourceLocation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import org.lwjgl.opengl.GL11;
import biomesoplenty.entities.EntityGlob;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -56,9 +58,21 @@ public class RenderGlob extends RenderLiving
GL11.glScalef(f3 * f1, 1.0F / f3 * f1, f3 * f1);
}
@Override
protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2)
{
this.scaleGlob((EntityGlob)par1EntityLivingBase, par2);
}
@Override
protected ResourceLocation func_110775_a(Entity entity)
{
return new ResourceLocation("mods/BiomesOPlenty/textures/mobs/glob.png");
return new ResourceLocation("BiomesOPlenty:textures/mobs/glob.png");
}
@Override
protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3)
{
return this.shouldGlobRenderPass((EntityGlob)par1EntityLivingBase, par2, par3);
}
}

View file

@ -0,0 +1,38 @@
package biomesoplenty.entities.render;
import net.minecraft.client.renderer.entity.RenderSpider;
import net.minecraft.client.resources.ResourceLocation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import org.lwjgl.opengl.GL11;
import biomesoplenty.entities.EntityJungleSpider;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderJungleSpider extends RenderSpider
{
public RenderJungleSpider()
{
this.shadowSize *= 0.0F;
}
protected void scaleSpider(EntityJungleSpider entityjunglespider, float par2)
{
GL11.glScalef(0.4F, 0.4F, 0.3F);
}
@Override
protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2)
{
this.scaleSpider((EntityJungleSpider)par1EntityLivingBase, par2);
}
@Override
protected ResourceLocation func_110775_a(Entity entity)
{
return new ResourceLocation("BiomesOPlenty:textures/mobs/junglespider.png");
}
}

View file

@ -0,0 +1,60 @@
package biomesoplenty.entities.render;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.resources.ResourceLocation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import biomesoplenty.entities.EntityRosester;
public class RenderRosester extends RenderLiving
{
public RenderRosester(ModelBase par1ModelBase, float par2)
{
super(par1ModelBase, par2);
}
public void renderRosester(EntityRosester par1EntityRosester, double par2, double par4, double par6, float par8, float par9)
{
super.doRenderLiving(par1EntityRosester, par2, par4, par6, par8, par9);
}
protected float getWingRotation(EntityRosester par1EntityRosester, float par2)
{
float f1 = par1EntityRosester.field_70888_h + (par1EntityRosester.field_70886_e - par1EntityRosester.field_70888_h) * par2;
float f2 = par1EntityRosester.field_70884_g + (par1EntityRosester.destPos - par1EntityRosester.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.renderRosester((EntityRosester)par1EntityLiving, par2, par4, par6, par8, par9);
}
@Override
protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2)
{
return this.getWingRotation((EntityRosester)par1EntityLivingBase, par2);
}
@Override
public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)
{
this.renderRosester((EntityRosester)par1EntityLivingBase, par2, par4, par6, par8, par9);
}
@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
this.renderRosester((EntityRosester)par1Entity, par2, par4, par6, par8, par9);
}
@Override
protected ResourceLocation func_110775_a(Entity entity)
{
return new ResourceLocation("BiomesOPlenty:textures/mobs/rosester.png");
}
}