示例#1
0
  public void a(Packet106Transaction packet106transaction) {
    // CraftBukkit start
    if (this.player.dead) {
      return;
    }
    // CraftBukkit end

    Short oshort = (Short) this.n.get(Integer.valueOf(this.player.activeContainer.f));

    if (oshort != null
        && packet106transaction.b == oshort.shortValue()
        && this.player.activeContainer.f == packet106transaction.a
        && !this.player.activeContainer.c(this.player)) {
      this.player.activeContainer.a(this.player, true);
    }
  }
示例#2
0
  public void a(Packet102WindowClick packet102windowclick) {
    // CraftBukkit start
    if (this.player.dead) {
      return;
    }
    // CraftBukkit end

    if (this.player.activeContainer.f == packet102windowclick.a
        && this.player.activeContainer.c(this.player)) {
      ItemStack itemstack =
          this.player.activeContainer.a(
              packet102windowclick.b, packet102windowclick.c, packet102windowclick.f, this.player);

      if (ItemStack.equals(packet102windowclick.e, itemstack)) {
        this.player.netServerHandler.sendPacket(
            new Packet106Transaction(packet102windowclick.a, packet102windowclick.d, true));
        this.player.h = true;
        this.player.activeContainer.a();
        this.player.y();
        this.player.h = false;
      } else {
        this.n.put(
            Integer.valueOf(this.player.activeContainer.f), Short.valueOf(packet102windowclick.d));
        this.player.netServerHandler.sendPacket(
            new Packet106Transaction(packet102windowclick.a, packet102windowclick.d, false));
        this.player.activeContainer.a(this.player, false);
        ArrayList arraylist = new ArrayList();

        for (int i = 0; i < this.player.activeContainer.e.size(); ++i) {
          arraylist.add(((Slot) this.player.activeContainer.e.get(i)).getItem());
        }

        this.player.a(this.player.activeContainer, arraylist);
      }
    }
  }