Esempio n. 1
0
  public void a(OContainer paramOCraftingInventoryCB, int paramInt, OItemStack paramOItemStack) {
    if ((paramOCraftingInventoryCB.b(paramInt) instanceof OSlotCrafting)) return;

    if (h) return;

    a.b(new OPacket103SetSlot(paramOCraftingInventoryCB.f, paramInt, paramOItemStack));
  }
Esempio n. 2
0
  public void a(boolean paramBoolean) {
    super.p_();

    if ((paramBoolean) && (!f.isEmpty())) {
      OChunkCoordIntPair localOChunkCoordIntPair = (OChunkCoordIntPair) f.get(0);

      if (localOChunkCoordIntPair != null) {
        int i = 0;

        if (a.b() < 2) i = 1;

        if (i != 0) {
          f.remove(localOChunkCoordIntPair);
          a.b(
              new OPacket51MapChunk(
                  localOChunkCoordIntPair.a * 16,
                  0,
                  localOChunkCoordIntPair.b * 16,
                  16,
                  128,
                  16,
                  b.e));
          List localList =
              b.e.d(
                  localOChunkCoordIntPair.a * 16,
                  0,
                  localOChunkCoordIntPair.b * 16,
                  localOChunkCoordIntPair.a * 16 + 16,
                  128,
                  localOChunkCoordIntPair.b * 16 + 16);
          for (int j = 0; j < localList.size(); j++) a((OTileEntity) localList.get(j));
        }
      }
    }

    // CanaryMod: Update the health
    if (X != bF) {
      // updates your health when it is changed.
      if (!etc.getInstance().isHealthEnabled()) {
        X = 20;
        ag = false;
      } else if ((Boolean) manager.callHook(PluginLoader.Hook.HEALTH_CHANGE, getPlayer(), bF, X))
        X = bF;
      else a.b(new OPacket8UpdateHealth(X));
      bF = X;
    }
  }
Esempio n. 3
0
 @Override
 public void b(int paramInt1, int paramInt2, int paramInt3) {
   af();
   a.b(new OPacket100OpenWindow(bI, 1, "Crafting", 9));
   k = new OContainerWorkbench(i, aH, paramInt1, paramInt2, paramInt3);
   k.f = bI;
   // CanaryMod: Make sure this gets cast correctly, or mutant puppies will
   // spawn and eat your items.
   k.a((OICrafting) this);
 }
Esempio n. 4
0
  private void a(OTileEntity paramOTileEntity) {
    if (paramOTileEntity != null) {
      // CanaryMod: Let plugins know we're showing a sign
      if (paramOTileEntity instanceof OTileEntitySign) {
        Sign sign = new Sign((OTileEntitySign) paramOTileEntity);
        manager.callHook(PluginLoader.Hook.SIGN_SHOW, getPlayer(), sign);
      }

      OPacket localOPacket = paramOTileEntity.e();
      if (localOPacket != null) a.b(localOPacket);
    }
  }
Esempio n. 5
0
  @Override
  public void a(OTileEntityDispenser paramOTileEntityDispenser) {
    Dispenser dis = new Dispenser(paramOTileEntityDispenser);
    String name = paramOTileEntityDispenser.c();
    if ((Boolean) manager.callHook(PluginLoader.Hook.OPEN_INVENTORY, getPlayer(), dis)) return;

    if (dis != null) name = dis.getName();

    af();
    a.b(new OPacket100OpenWindow(bI, 3, name, paramOTileEntityDispenser.a()));
    k = new OContainerDispenser(i, paramOTileEntityDispenser);
    k.f = bI;
    // CanaryMod: Make sure this gets cast correctly, or mutant puppies will
    // spawn and eat your items.
    k.a((OICrafting) this);
  }
Esempio n. 6
0
  @Override
  public void a(OTileEntityFurnace paramOTileEntityFurnace) {
    // CanaryMod: Check if we can open this
    Inventory inv = new Furnace(paramOTileEntityFurnace);
    String name = paramOTileEntityFurnace.c();
    if ((Boolean) manager.callHook(PluginLoader.Hook.OPEN_INVENTORY, getPlayer(), inv)) return;

    if (inv != null) name = inv.getName();

    af();
    a.b(new OPacket100OpenWindow(bI, 2, name, paramOTileEntityFurnace.a()));
    k = new OContainerFurnace(i, paramOTileEntityFurnace);
    k.f = bI;
    // CanaryMod: Make sure this gets cast correctly, or mutant puppies will
    // spawn and eat your items.
    k.a((OICrafting) this);
  }
Esempio n. 7
0
  @Override
  public void a(OIInventory paramOIInventory) {
    // CanaryMod: Check if we can open this
    Inventory inv = null;
    String name = paramOIInventory.c();
    if (paramOIInventory instanceof OTileEntityChest) {
      inv = new Chest((OTileEntityChest) paramOIInventory);
      if ((Boolean) manager.callHook(PluginLoader.Hook.OPEN_INVENTORY, getPlayer(), inv)) return;
    } else if (paramOIInventory instanceof OInventoryLargeChest) {
      inv = new DoubleChest((OInventoryLargeChest) paramOIInventory);
      if ((Boolean) manager.callHook(PluginLoader.Hook.OPEN_INVENTORY, getPlayer(), inv)) return;
    }

    if (inv != null) name = inv.getName();

    af();
    a.b(new OPacket100OpenWindow(bI, 0, name, paramOIInventory.a()));
    k = new OContainerChest(i, paramOIInventory);
    k.f = bI;
    // CanaryMod: Make sure this gets cast correctly, or mutant puppies will
    // spawn and eat your items.
    k.a((OICrafting) this);
  }
Esempio n. 8
0
 public void y() {
   if (h) return;
   a.b(new OPacket103SetSlot(-1, -1, i.j()));
 }
Esempio n. 9
0
 @Override
 public void x() {
   a.b(new OPacket101CloseWindow(k.f));
   z();
 }
Esempio n. 10
0
 public void a(OContainer paramOCraftingInventoryCB, int paramInt1, int paramInt2) {
   a.b(new OPacket105UpdateProgressbar(paramOCraftingInventoryCB.f, paramInt1, paramInt2));
 }
Esempio n. 11
0
 public void a(OContainer paramOCraftingInventoryCB, List paramList) {
   a.b(new OPacket104WindowItems(paramOCraftingInventoryCB.f, paramList));
   a.b(new OPacket103SetSlot(-1, -1, i.j()));
 }
Esempio n. 12
0
 @Override
 public void b(OEntity paramOEntity) {
   super.b(paramOEntity);
   a.b(new OPacket39AttachEntity(this, aG));
   a.a(aL, aM, aN, aR, aS);
 }
Esempio n. 13
0
 @Override
 public void a(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) {
   if (I()) b.k.b(this, new OPacket18Animation(this, 3));
   super.a(paramBoolean1, paramBoolean2, paramBoolean3);
   a.a(aL, aM, aN, aR, aS);
 }