Example #1
0
 public void a(TileEntityBeacon tileentitybeacon) {
   // TODO: Beacon
   this.ct();
   this.a.b(
       new Packet100OpenWindow(
           this.cu, 7, tileentitybeacon.b(), tileentitybeacon.j_(), tileentitybeacon.c()));
   this.bM = new ContainerBeacon(this.bK, tileentitybeacon);
   this.bM.d = this.cu;
   this.bM.a((ICrafting) this);
 }
  public void openBeacon(TileEntityBeacon tileentitybeacon) {
    // CraftBukkit start - inventory open hook
    Container container =
        CraftEventFactory.callInventoryOpenEvent(
            this, new ContainerBeacon(this.inventory, tileentitybeacon));
    if (container == null) return;
    // CraftBukkit end

    this.nextContainerCounter();
    this.playerConnection.sendPacket(
        new Packet100OpenWindow(
            this.containerCounter, 7, tileentitybeacon.getName(), tileentitybeacon.getSize()));
    this.activeContainer = container; // CraftBukkit - Use container passed to event
    this.activeContainer.windowId = this.containerCounter;
    this.activeContainer.addSlotListener(this);
  }
Example #3
0
  public ContainerBeacon(
      InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon) {
    this.theBeacon = par2TileEntityBeacon;
    this.addSlotToContainer(
        this.beaconSlot = new SlotBeacon(this, par2TileEntityBeacon, 0, 136, 110));
    byte var3 = 36;
    short var4 = 137;
    int var5;

    for (var5 = 0; var5 < 3; ++var5) {
      for (int var6 = 0; var6 < 9; ++var6) {
        this.addSlotToContainer(
            new Slot(par1InventoryPlayer, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18));
      }
    }

    for (var5 = 0; var5 < 9; ++var5) {
      this.addSlotToContainer(new Slot(par1InventoryPlayer, var5, var3 + var5 * 18, 58 + var4));
    }

    this.field_82865_g = par2TileEntityBeacon.getLevels();
    this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect();
    this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect();
  }