diff --git a/src/minecraft/biomesoplenty/items/ItemDartBlower.java b/src/minecraft/biomesoplenty/items/ItemDartBlower.java index 3326ff26f..a0b289885 100644 --- a/src/minecraft/biomesoplenty/items/ItemDartBlower.java +++ b/src/minecraft/biomesoplenty/items/ItemDartBlower.java @@ -42,8 +42,7 @@ public class ItemDartBlower extends Item if (flag || par3EntityPlayer.inventory.hasItem(Items.dart.get().itemID)) { - //EntityArrow entitydart = new EntityArrow(par2World, par3EntityPlayer, 2.0F); - EntityDart entityDart = new EntityDart(par2World); + EntityDart entityDart = new EntityDart(par2World, par3EntityPlayer, 1.0F); itemStack.damageItem(1, par3EntityPlayer); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 2.0F / (1.0F * 0.4F + 1.2F) + 1.0F * 0.5F); @@ -72,7 +71,8 @@ public class ItemDartBlower extends Item } } - if (!par2World.isRemote) { + if (!par2World.isRemote) + { par2World.spawnEntityInWorld(entityDart); } diff --git a/src/minecraft/biomesoplenty/items/projectiles/EntityDart.java b/src/minecraft/biomesoplenty/items/projectiles/EntityDart.java index 77b2663fc..695e0e94f 100644 --- a/src/minecraft/biomesoplenty/items/projectiles/EntityDart.java +++ b/src/minecraft/biomesoplenty/items/projectiles/EntityDart.java @@ -5,6 +5,7 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityArrow; @@ -41,9 +42,9 @@ public class EntityDart extends EntityArrow super(par1World); } - public EntityDart(World par1World, EntityLiving par2EntityLiving, float par3) + public EntityDart(World par1World, EntityLivingBase par2EntityLivingBase, float par3) { - super(par1World, par2EntityLiving, par3); + super(par1World, par2EntityLivingBase, par3); } public EntityDart(World par1World, double par2, double par4, double par6) diff --git a/src/minecraft/biomesoplenty/items/projectiles/RenderDart.java b/src/minecraft/biomesoplenty/items/projectiles/RenderDart.java index 3960f0b7c..3b26202f3 100644 --- a/src/minecraft/biomesoplenty/items/projectiles/RenderDart.java +++ b/src/minecraft/biomesoplenty/items/projectiles/RenderDart.java @@ -15,89 +15,81 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderDart extends Render { + public void renderDart(EntityDart par1EntityDart, double par2, double par4, double par6, float par8, float par9) + { + this.func_110777_b(par1EntityDart); + GL11.glPushMatrix(); + GL11.glTranslatef((float)par2, (float)par4, (float)par6); + GL11.glRotatef(par1EntityDart.prevRotationYaw + (par1EntityDart.rotationYaw - par1EntityDart.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(par1EntityDart.prevRotationPitch + (par1EntityDart.rotationPitch - par1EntityDart.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); + Tessellator tessellator = Tessellator.instance; + byte b0 = 0; + float f2 = 0.0F; + float f3 = 0.5F; + float f4 = (float)(0 + b0 * 10) / 32.0F; + float f5 = (float)(5 + b0 * 10) / 32.0F; + float f6 = 0.0F; + float f7 = 0.15625F; + float f8 = (float)(5 + b0 * 10) / 32.0F; + float f9 = (float)(10 + b0 * 10) / 32.0F; + float f10 = 0.05625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f11 = (float)par1EntityDart.arrowShake - par9; - public void renderArrow(EntityDart par1EntityArrow, double par2, double par4, double par6, float par8, float par9) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float)par2, (float)par4, (float)par6); - GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); - Tessellator tessellator = Tessellator.instance; - byte b0 = 0; - float f2 = 0.0F; - float f3 = 0.5F; - float f4 = (0 + b0 * 10) / 32.0F; - float f5 = (5 + b0 * 10) / 32.0F; - float f6 = 0.0F; - float f7 = 0.15625F; - float f8 = (5 + b0 * 10) / 32.0F; - float f9 = (10 + b0 * 10) / 32.0F; - float f10 = 0.05625F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float f11 = par1EntityArrow.arrowShake - par9; + if (f11 > 0.0F) + { + float f12 = -MathHelper.sin(f11 * 3.0F) * f11; + GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F); + } - if (f11 > 0.0F) - { - float f12 = -MathHelper.sin(f11 * 3.0F) * f11; - GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F); - } + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(f10, f10, f10); + GL11.glTranslatef(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9); + tessellator.draw(); + GL11.glNormal3f(-f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9); + tessellator.draw(); - GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); - GL11.glScalef(f10, f10, f10); - GL11.glTranslatef(-4.0F, 0.0F, 0.0F); - GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f8); - tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f8); - tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f9); - tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f9); - tessellator.draw(); - GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f8); - tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f8); - tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f9); - tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f9); - tessellator.draw(); + for (int i = 0; i < 4; ++i) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, f10); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4); + tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4); + tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5); + tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5); + tessellator.draw(); + } - for (int i = 0; i < 4; ++i) - { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, f2, f4); - tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, f3, f4); - tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, f3, f5); - tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, f2, f5); - tessellator.draw(); - } + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - - /** - * 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 0.0F) - { - float f12 = -MathHelper.sin(f11 * 3.0F) * f11; - GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F); - } - - GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); - GL11.glScalef(f10, f10, f10); - GL11.glTranslatef(-4.0F, 0.0F, 0.0F); - GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f8); - tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f8); - tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f9); - tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f9); - tessellator.draw(); - GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f8); - tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f8); - tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f9); - tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f9); - tessellator.draw(); - - for (int i = 0; i < 4; ++i) - { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, f2, f4); - tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, f3, f4); - tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, f3, f5); - tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, f2, f5); - tessellator.draw(); - } - - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - - /** - * 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