Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 4.32 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ...    
  2.  
  3. private Packet b() {
  4.         if (this.tracker instanceof EntityItem) {
  5.             EntityItem entityitem = (EntityItem) this.tracker;
  6.             Packet21PickupSpawn packet21pickupspawn = new Packet21PickupSpawn(entityitem);
  7.  
  8.             entityitem.locX = (double) packet21pickupspawn.b / 32.0D;
  9.             entityitem.locY = (double) packet21pickupspawn.c / 32.0D;
  10.             entityitem.locZ = (double) packet21pickupspawn.d / 32.0D;
  11.             return packet21pickupspawn;
  12.         } else if (this.tracker instanceof EntityPlayer) {
  13.             // CraftBukkit start - limit name length to 16 characters
  14.             if (((EntityHuman) this.tracker).name.length() > 16) {
  15.                 ((EntityHuman) this.tracker).name = ((EntityHuman) this.tracker).name.substring(0, 16);
  16.             }
  17.             // CraftBukkit end
  18.             return new Packet20NamedEntitySpawn((EntityHuman) this.tracker);
  19.         } else {
  20.             if (this.tracker instanceof EntityMinecart) {
  21.                 EntityMinecart entityminecart = (EntityMinecart) this.tracker;
  22.  
  23.                 if (entityminecart.type == 0) {
  24.                     return new Packet23VehicleSpawn(this.tracker, 10);
  25.                 }
  26.  
  27.                 if (entityminecart.type == 1) {
  28.                     return new Packet23VehicleSpawn(this.tracker, 11);
  29.                 }
  30.  
  31.                 if (entityminecart.type == 2) {
  32.                     return new Packet23VehicleSpawn(this.tracker, 12);
  33.                 }
  34.             }
  35.  
  36.             if (this.tracker instanceof EntityBoat) {
  37.                 return new Packet23VehicleSpawn(this.tracker, 1);
  38.             } else if (this.tracker instanceof IAnimal) {
  39.                 return new Packet24MobSpawn((EntityLiving) this.tracker);
  40.             } else if (this.tracker instanceof EntityFish) {
  41.                 return new Packet23VehicleSpawn(this.tracker, 90);
  42.             } else if (this.tracker instanceof EntityArrow) {
  43.                 EntityLiving entityliving = ((EntityArrow) this.tracker).shooter;
  44.  
  45.                 return new Packet23VehicleSpawn(this.tracker, 60, entityliving != null ? entityliving.id : this.tracker.id);
  46.             } else if (this.tracker instanceof EntitySnowball) {
  47.                 return new Packet23VehicleSpawn(this.tracker, 61);
  48.             } else if (this.tracker instanceof EntityFireball) {
  49.                 EntityFireball entityfireball = (EntityFireball) this.tracker;
  50.                 // CraftBukkit start - added check for null shooter
  51.                 int shooter = ((EntityFireball) this.tracker).shooter != null ? ((EntityFireball) this.tracker).shooter.id : 1;
  52.                 Packet23VehicleSpawn packet23vehiclespawn = new Packet23VehicleSpawn(this.tracker, 63, shooter);
  53.                 // CraftBukkit end
  54.  
  55.                 packet23vehiclespawn.e = (int) (entityfireball.c * 8000.0D);
  56.                 packet23vehiclespawn.f = (int) (entityfireball.d * 8000.0D);
  57.                 packet23vehiclespawn.g = (int) (entityfireball.e * 8000.0D);
  58.                 return packet23vehiclespawn;
  59.             } else if (this.tracker instanceof EntityEgg) {
  60.                 return new Packet23VehicleSpawn(this.tracker, 62);
  61.             } else if (this.tracker instanceof EntityTNTPrimed) {
  62.                 return new Packet23VehicleSpawn(this.tracker, 50);
  63.             } else {
  64.                 if (this.tracker instanceof EntityFallingSand) {
  65.                     EntityFallingSand entityfallingsand = (EntityFallingSand) this.tracker;
  66.                     //<shamebot
  67.                     return new Packet23VehicleSpawn(this.tracker, entityfallingsand.a == Block.GRAVEL.id ? 71 : 70, entityfallingsand.frozen ? entityfallingsand.a | 0x100 : entityfallingsand.a);
  68.                     /*if (entityfallingsand.a == Block.SAND.id) {
  69.                         return new Packet23VehicleSpawn(this.tracker, 70);
  70.                     }
  71.  
  72.                     if (entityfallingsand.a == Block.GRAVEL.id) {
  73.                         return new Packet23VehicleSpawn(this.tracker, 71);
  74.                     }*/
  75.                     //</shamebot>
  76.                 }
  77.  
  78.                 if (this.tracker instanceof EntityPainting) {
  79.                     return new Packet25EntityPainting((EntityPainting) this.tracker);
  80.                 } else {
  81.                     throw new IllegalArgumentException("Don\'t know how to add " + this.tracker.getClass() + "!");
  82.                 }
  83.             }
  84.         }
  85.     }
  86. ...