Exemple #1
0
  @Override
  public void sendMetaData(Player player, FakeEntity entity) {
    DataWatcher watcher = new DataWatcher(getHandle(entity.getEntity()));
    watcher.a(5, 32);
    watcher.a(6, entity.getHealth());
    watcher.a(7, Integer.valueOf(0));
    watcher.a(8, (byte) 0);
    watcher.a(10, entity.getName());
    watcher.a(11, (byte) 1);

    PacketPlayOutEntityMetadata packet =
        new PacketPlayOutEntityMetadata(entity.getId(), watcher, true);
    sendPacket(player, packet);
  }
Exemple #2
0
 @Override
 public void sendSpawnPacket(Player player, FakeEntity fakeEntity) {
   EntityEnderDragon dragon = new EntityEnderDragon(getHandle(fakeEntity.getWorld()));
   dragon.setLocation(
       fakeEntity.getX(),
       fakeEntity.getY(),
       fakeEntity.getZ(),
       fakeEntity.getPitch(),
       fakeEntity.getYaw());
   dragon.setInvisible(true);
   dragon.setCustomName(fakeEntity.getName());
   dragon.setHealth(fakeEntity.getHealth());
   dragon.motX = fakeEntity.getMotX();
   dragon.motY = fakeEntity.getMotY();
   dragon.motZ = fakeEntity.getMotZ();
   fakeEntity.setId(dragon.getId());
   fakeEntity.setEntity(dragon.getBukkitEntity());
   PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(dragon);
   sendPacket(player, packet);
   return;
 }