@Override
  public <T> void watch(int i, T t0) {

    if (i == ENTITY_FLAGS_ID) {
      byte newFlags = ((Number) t0).byteValue();
      if ((newFlags & SNEAK_FLAG) == SNEAK_FLAG) {
        _isDismountPressed = true;

        if (!_canDismount) return;
      } else {
        _isDismountPressed = false;
      }
    } else if (i == ARROW_STICK_ID) {
      if (!_canArrowsStick && ((Number) t0).byteValue() != 0) return;
    }
    _watcher.watch(i, t0);
  }
Пример #2
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);
  }
 @Override
 public <T> void a(int i, T t0) {
   _watcher.a(i, t0);
 }
 @Override
 public void e() {
   _watcher.e();
 }
 @Override
 public void removeArrows() {
   _watcher.watch(ARROW_STICK_ID, (byte) 0);
 }
 @Override
 public List<DataWatcher.WatchableObject> c() {
   return _watcher.c();
 }
 @Override
 public boolean d() {
   return _watcher.d();
 }
 @Override
 public boolean a() {
   return _watcher.a();
 }
 @Override
 public void a(PacketDataSerializer packetdataserializer) throws IOException {
   _watcher.a(packetdataserializer);
 }
 @Override
 public void add(int i, int j) {
   _watcher.add(i, j);
 }
 @Override
 public void update(int i) {
   _watcher.update(i);
 }
 @Override
 public ItemStack getItemStack(int i) {
   return _watcher.getItemStack(i);
 }
 @Override
 public Vector3f h(int i) {
   return _watcher.h(i);
 }
 @Override
 public String getString(int i) {
   return _watcher.getString(i);
 }
 @Override
 public float getFloat(int i) {
   return _watcher.getFloat(i);
 }
 @Override
 public int getInt(int i) {
   return _watcher.getInt(i);
 }
 @Override
 public short getShort(int i) {
   return _watcher.getShort(i);
 }
 @Override
 public byte getByte(int i) {
   return _watcher.getByte(i);
 }