/// <summary> /// The render method used in RenderBoat that renders the boat model. /// </summary> public virtual void DoRenderBoat(EntityBoat par1EntityBoat, double par2, double par4, double par6, float par8, float par9) { //GL.PushMatrix(); //GL.Translate((float)par2, (float)par4, (float)par6); //GL.Rotate(180F - par8, 0.0F, 1.0F, 0.0F); float f = (float)par1EntityBoat.GetTimeSinceHit() - par9; float f1 = (float)par1EntityBoat.GetDamageTaken() - par9; if (f1 < 0.0F) { f1 = 0.0F; } if (f > 0.0F) { //GL.Rotate(((MathHelper.Sin(f) * f * f1) / 10F) * (float)par1EntityBoat.GetForwardDirection(), 1.0F, 0.0F, 0.0F); } LoadTexture("/terrain.png"); float f2 = 0.75F; //GL.Scale(f2, f2, f2); //GL.Scale(1.0F / f2, 1.0F / f2, 1.0F / f2); LoadTexture("/item/boat.png"); //GL.Scale(-1F, -1F, 1.0F); ModelBoat.Render(par1EntityBoat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); //GL.PopMatrix(); }
public override void HandleVehicleSpawn(Packet23VehicleSpawn par1Packet23VehicleSpawn) { float d = par1Packet23VehicleSpawn.XPosition / 3F; float d1 = par1Packet23VehicleSpawn.YPosition / 3F; float d2 = par1Packet23VehicleSpawn.ZPosition / 3F; Entity obj = null; if (par1Packet23VehicleSpawn.Type == 10) { obj = new EntityMinecart(WorldClient, d, d1, d2, 0); } else if (par1Packet23VehicleSpawn.Type == 11) { obj = new EntityMinecart(WorldClient, d, d1, d2, 1); } else if (par1Packet23VehicleSpawn.Type == 12) { obj = new EntityMinecart(WorldClient, d, d1, d2, 2); } else if (par1Packet23VehicleSpawn.Type == 90) { obj = new EntityFishHook(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 60) { obj = new EntityArrow(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 61) { obj = new EntitySnowball(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 65) { obj = new EntityEnderPearl(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 72) { obj = new EntityEnderEye(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 63) { obj = new EntityFireball(WorldClient, d, d1, d2, par1Packet23VehicleSpawn.SpeedX / 8000F, par1Packet23VehicleSpawn.SpeedY / 8000F, par1Packet23VehicleSpawn.SpeedZ / 8000F); par1Packet23VehicleSpawn.ThrowerEntityId = 0; } else if (par1Packet23VehicleSpawn.Type == 64) { obj = new EntitySmallFireball(WorldClient, d, d1, d2, par1Packet23VehicleSpawn.SpeedX / 8000F, par1Packet23VehicleSpawn.SpeedY / 8000F, par1Packet23VehicleSpawn.SpeedZ / 8000F); par1Packet23VehicleSpawn.ThrowerEntityId = 0; } else if (par1Packet23VehicleSpawn.Type == 62) { obj = new EntityEgg(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 73) { obj = new EntityPotion(WorldClient, d, d1, d2, par1Packet23VehicleSpawn.ThrowerEntityId); par1Packet23VehicleSpawn.ThrowerEntityId = 0; } else if (par1Packet23VehicleSpawn.Type == 75) { obj = new EntityExpBottle(WorldClient, d, d1, d2); par1Packet23VehicleSpawn.ThrowerEntityId = 0; } else if (par1Packet23VehicleSpawn.Type == 1) { obj = new EntityBoat(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 50) { obj = new EntityTNTPrimed(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 51) { obj = new EntityEnderCrystal(WorldClient, d, d1, d2); } else if (par1Packet23VehicleSpawn.Type == 70) { obj = new EntityFallingSand(WorldClient, d, d1, d2, Block.Sand.BlockID); } else if (par1Packet23VehicleSpawn.Type == 71) { obj = new EntityFallingSand(WorldClient, d, d1, d2, Block.Gravel.BlockID); } else if (par1Packet23VehicleSpawn.Type == 74) { obj = new EntityFallingSand(WorldClient, d, d1, d2, Block.DragonEgg.BlockID); } if (obj != null) { obj.ServerPosX = par1Packet23VehicleSpawn.XPosition; obj.ServerPosY = par1Packet23VehicleSpawn.YPosition; obj.ServerPosZ = par1Packet23VehicleSpawn.ZPosition; obj.RotationYaw = 0.0F; obj.RotationPitch = 0.0F; Entity[] aentity = ((Entity)(obj)).GetParts(); if (aentity != null) { int i = par1Packet23VehicleSpawn.EntityId - ((Entity)(obj)).EntityId; for (int j = 0; j < aentity.Length; j++) { aentity[j].EntityId += i; } } obj.EntityId = par1Packet23VehicleSpawn.EntityId; WorldClient.AddEntityToWorld(par1Packet23VehicleSpawn.EntityId, ((Entity)(obj))); if (par1Packet23VehicleSpawn.ThrowerEntityId > 0) { if (par1Packet23VehicleSpawn.Type == 60) { Entity entity = GetEntityByID(par1Packet23VehicleSpawn.ThrowerEntityId); if (entity is EntityLiving) { ((EntityArrow)obj).ShootingEntity = (EntityLiving)entity; } } ((Entity)(obj)).SetVelocity(par1Packet23VehicleSpawn.SpeedX / 8000F, par1Packet23VehicleSpawn.SpeedY / 8000F, par1Packet23VehicleSpawn.SpeedZ / 8000F); } } }