Example #1
0
  @Override
  public void detectAndSendChanges() {
    for (int var1 = 0; var1 < this.inventorySlots.size(); ++var1) {
      ItemStack var2 = ((Slot) this.inventorySlots.get(var1)).getStack();
      ItemStack var3 = (ItemStack) this.inventoryItemStacks.get(var1);

      if (!ItemStack.areItemStacksEqual(var3, var2)) {
        var3 = var2 == null ? null : var2.copy();
        this.inventoryItemStacks.set(var1, var3);

        for (int var4 = 0; var4 < this.crafters.size(); ++var4) {
          ((ICrafting) this.crafters.get(var4)).sendSlotContents(this, var1, var3);
        }
      }
    }
    for (int var1 = 0; var1 < this.crafters.size(); ++var1) {
      ICrafting var2 = (ICrafting) this.crafters.get(var1);
      if (this.soilamt != this.sluice.soilAmount) {
        var2.sendProgressBarUpdate(this, 0, this.sluice.soilAmount);
      }
      if (this.progress != this.sluice.processTimeRemaining) {
        var2.sendProgressBarUpdate(this, 1, this.sluice.processTimeRemaining);
      }
    }

    soilamt = this.sluice.soilAmount;
    progress = this.sluice.processTimeRemaining;
  }
 @Override
 public void addCraftingToCrafters(ICrafting par1ICrafting) {
   super.addCraftingToCrafters(par1ICrafting);
   par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime);
   par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime);
   par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime);
 }
  public void updateCraftingResults() {
    super.updateCraftingResults();
    Iterator var1 = this.crafters.iterator();

    while (var1.hasNext()) {
      ICrafting var2 = (ICrafting) var1.next();

      if (this.lastCookTime != this.furnace.furnaceCookTime) {

        var2.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime);
      }

      if (this.lastBurnTime != this.furnace.furnaceBurnTime) {
        var2.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime);
      }

      if (this.lastItemBurnTime != this.furnace.currentItemBurnTime) {
        var2.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime);
      }
    }

    this.lastCookTime = this.furnace.furnaceCookTime;
    this.lastBurnTime = this.furnace.furnaceBurnTime;
    this.lastItemBurnTime = this.furnace.currentItemBurnTime;
  }
 @Override
 public void onCraftGuiOpened(ICrafting crafting) {
   super.onCraftGuiOpened(crafting);
   crafting.sendProgressBarUpdate(this, 0, this.scribe.processTime);
   crafting.sendProgressBarUpdate(this, 1, this.scribe.bookTime);
   crafting.sendProgressBarUpdate(this, 2, this.scribe.currentBookBuffer);
 }
 @Override
 public void addCraftingToCrafters(ICrafting icrafting) {
   super.addCraftingToCrafters(icrafting);
   icrafting.sendProgressBarUpdate(this, 0, robit.furnaceCookTime);
   icrafting.sendProgressBarUpdate(this, 1, robit.furnaceBurnTime);
   icrafting.sendProgressBarUpdate(this, 2, robit.currentItemBurnTime);
 }
  @Override
  public void detectAndSendChanges() {
    for (int i = 0; i < this.crafters.size(); ++i) {
      ICrafting icrafting = (ICrafting) this.crafters.get(i);

      if (this.lastFuel != tile.fuel) {
        icrafting.sendProgressBarUpdate(this, 0, tile.fuel);
      }

      if (this.lastFuelMax != tile.maxFuel) {
        icrafting.sendProgressBarUpdate(this, 1, tile.maxFuel);
      }
    }
    this.lastFuel = tile.fuel;
    this.lastFuelMax = tile.maxFuel;

    for (int i = 0; i < this.inventorySlots.size(); ++i) {
      ItemStack itemstack = ((Slot) this.inventorySlots.get(i)).getStack();
      ItemStack itemstack1 = (ItemStack) this.inventoryItemStacks.get(i);

      if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) {
        if (isGuiContainer) {
          tile.onInventoryChanged();
        }

        itemstack1 = itemstack == null ? null : itemstack.copy();
        this.inventoryItemStacks.set(i, itemstack1);

        for (int j = 0; j < this.crafters.size(); ++j) {
          ((ICrafting) this.crafters.get(j)).sendSlotContents(this, i, itemstack1);
        }
      }
    }
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();
    byte isSending = (byte) (fluid.isSending ? 1 : 0);
    int fID = fluid.tank.getFluid() != null ? fluid.tank.getFluid().fluidID : -1,
        fAmt = fluid.tank.getFluidAmount();

    for (int i = 0; i < crafters.size(); i++) {
      ICrafting icrafting = (ICrafting) crafters.get(i);

      if (wasSending != isSending) {
        icrafting.sendProgressBarUpdate(this, 0, isSending);
      }

      if (fluidID != fID) {
        icrafting.sendProgressBarUpdate(this, 1, fID);
      }

      if (fluidAmt != fAmt) {
        icrafting.sendProgressBarUpdate(this, 2, fAmt);
      }

      wasSending = isSending;
      fluidID = fID;
      fluidAmt = fAmt;
    }
  }
  @Override
  public void addCraftingToCrafters(ICrafting iCrafting) {
    super.addCraftingToCrafters(iCrafting);

    iCrafting.sendProgressBarUpdate(this, 0, campfireEnt.furnaceCookTime);
    iCrafting.sendProgressBarUpdate(this, 1, campfireEnt.furnaceBurnTime);
    iCrafting.sendProgressBarUpdate(this, 2, campfireEnt.currentItemBurnTime);
  }
 @Override
 public void addCraftingToCrafters(ICrafting iCrafting) {
   super.addCraftingToCrafters(iCrafting);
   iCrafting.sendProgressBarUpdate(this, 0, this.tileEntityResearchStation.itemLearnTime);
   if (this.tileEntityResearchStation.isItemKnown) {
     iCrafting.sendProgressBarUpdate(this, 1, 1);
   } else {
     iCrafting.sendProgressBarUpdate(this, 1, 0);
   }
 }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    boolean allFieldsHaveChanged = false;
    boolean fieldHasChanged[] = new boolean[te.getFieldCount()];
    if (cachedFields == null) {
      cachedFields = new int[te.getFieldCount()];
      allFieldsHaveChanged = true;
    }
    for (int i = 0; i < cachedFields.length; i++) {
      if (allFieldsHaveChanged || cachedFields[i] != te.getField(i)) {
        cachedFields[i] = te.getField(i);
        fieldHasChanged[i] = true;
      }
    }

    for (int i = 0; i < this.crafters.size(); i++) {
      ICrafting icrafting = (ICrafting) this.crafters.get(i);
      for (int fieldID = 0; fieldID < te.getFieldCount(); fieldID++) {
        if (fieldHasChanged[fieldID]) {
          icrafting.sendProgressBarUpdate(this, fieldID, cachedFields[fieldID]);
        }
      }
    }
  }
 public void addCraftingToCrafters(ICrafting par1ICrafting) {
   super.addCraftingToCrafters(par1ICrafting);
   for (int i = 0; i < 15; i++) {
     par1ICrafting.sendProgressBarUpdate(this, i, this.deconstructor.progress[i]);
     lastProgressTime[i] = this.deconstructor.progress[i];
   }
 }
  @Override
  public void onCraftGuiOpened(ICrafting listener) {
    super.onCraftGuiOpened(listener);

    for (int i = 0; i < oldHeats.length; i++) {
      listener.sendProgressBarUpdate(this, i, tile.getTemperature(i));
    }
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();
    for (int i = 0; i < this.crafters.size(); ++i) {
      ICrafting crafting = this.crafters.get(i);

      if (this.lastUseTime != this.scribe.processTime)
        crafting.sendProgressBarUpdate(this, 0, this.scribe.processTime);
      if (this.fuelTime != this.scribe.bookTime)
        crafting.sendProgressBarUpdate(this, 1, this.scribe.bookTime);
      if (this.lastFuelTime != this.scribe.currentBookBuffer)
        crafting.sendProgressBarUpdate(this, 2, this.scribe.currentBookBuffer);
    }
    this.lastUseTime = this.scribe.processTime;
    this.fuelTime = this.scribe.bookTime;
    this.lastFuelTime = this.scribe.currentBookBuffer;
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int i = 0; i < crafters.size(); i++) {
      ICrafting icrafting = (ICrafting) crafters.get(i);

      if (prevBrewTime != tile.getBrewTime())
        icrafting.sendProgressBarUpdate(this, 0, tile.getBrewTime());
      if (prevFuel != tile.getFuel()) icrafting.sendProgressBarUpdate(this, 1, tile.getFuel());
      if (prevCurrentFuel != tile.getCurrentFuel())
        icrafting.sendProgressBarUpdate(this, 2, tile.getCurrentFuel());
    }
    prevBrewTime = tile.getBrewTime();
    prevFuel = tile.getFuel();
    prevCurrentFuel = tile.getCurrentFuel();
  }
 @Override
 public void detectAndSendChanges() {
   super.detectAndSendChanges();
   for (int i = 0; i < crafters.size(); i++) {
     ICrafting crafting = (ICrafting) crafters.get(i);
     if (oldFuel != planter.fuel) crafting.sendProgressBarUpdate(this, 0, planter.fuel);
   }
   oldFuel = planter.fuel;
 }
  /** Looks for changes made in the container, sends them to every listener. */
  @Override
  public void detectAndSendChanges() {

    super.detectAndSendChanges();

    for (Object crafter : crafters) {
      ICrafting icrafting = (ICrafting) crafter;

      if (filterColor != tileRegulator.color.ordinal()) {
        icrafting.sendProgressBarUpdate(this, 0, tileRegulator.color.ordinal());
      }
      if (mode != tileRegulator.mode) {
        icrafting.sendProgressBarUpdate(this, 2, tileRegulator.mode);
      }
    }
    filterColor = tileRegulator.color.ordinal();
    mode = tileRegulator.mode;
  }
Example #17
0
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int i = 0; i < this.crafters.size(); ++i) {
      ICrafting crafter = (ICrafting) this.crafters.get(i);

      if (this.lastTankMeter != this.core.getTankMeter()) {
        crafter.sendProgressBarUpdate(this, 0, this.core.getTankMeter());
      }
      if (this.lastWorkMeter != this.core.getWorkMeter()) {
        crafter.sendProgressBarUpdate(this, 1, this.core.getWorkMeter());
      }
    }

    this.lastTankMeter = this.core.getTankMeter();
    this.lastWorkMeter = this.core.getWorkMeter();
  }
  /** Updates crafting matrix; called from onCraftMatrixChanged. Args: none */
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int var1 = 0; var1 < crafters.size(); ++var1) {
      final ICrafting var2 = (ICrafting) crafters.get(var1);

      if (lastCookTime != furnace.furnaceCookTime) {
        var2.sendProgressBarUpdate(this, 0, furnace.furnaceCookTime);
      }

      if (lastItemBurnTime != furnace.currentItemBurnTime) {
        var2.sendProgressBarUpdate(this, 1, furnace.currentItemBurnTime);
      }
    }

    lastCookTime = furnace.furnaceCookTime;
    lastItemBurnTime = furnace.currentItemBurnTime;
  }
 @Override
 public void detectAndSendChanges() {
   super.detectAndSendChanges();
   if (lastMana != te.getCurrentMana()) {
     for (ICrafting crafter : (List<ICrafting>) crafters) {
       crafter.sendProgressBarUpdate(this, 0, te.getCurrentMana());
     }
     lastMana = te.getCurrentMana();
   }
 }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();
    for (int i = 0; i < crafters.size(); i++) {
      ICrafting icrafting = (ICrafting) crafters.get(i);
      if (progress != logic.progress) {
        icrafting.sendProgressBarUpdate(this, 0, logic.progress);
      }
      if (fuel != logic.fuel) {
        icrafting.sendProgressBarUpdate(this, 1, logic.fuel);
      }
      if (fuelGague != logic.fuelGague) {
        icrafting.sendProgressBarUpdate(this, 2, logic.fuelGague);
      }
    }

    progress = logic.progress;
    fuel = logic.fuel;
    fuelGague = logic.fuelGague;
  }
 @Override
 public void detectAndSendChanges() {
   super.detectAndSendChanges();
   for (int i = 0; i < crafters.size(); i++) {
     ICrafting crafter = (ICrafting) crafters.get(i);
     if (lastColourFamily != tileEntityColourMixer.getColourFamily()) {
       crafter.sendProgressBarUpdate(this, 0, tileEntityColourMixer.getColourFamily().ordinal());
     }
   }
   lastColourFamily = tileEntityColourMixer.getColourFamily();
 }
  public void detectAndSendChanges() {
    super.detectAndSendChanges();
    for (Object crafter : this.crafters) {
      ICrafting icrafting = (ICrafting) crafter;
      if (this.lastCookTime != this.tileEntity.cookTime) {
        icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.cookTime);
      }
    }

    this.lastCookTime = this.tileEntity.cookTime;
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int i = 0; i < this.crafters.size(); ++i) {
      ICrafting craft = (ICrafting) this.crafters.get(i);
      if (this.lastInternalStorage != this.incinerator.getEnergyStored(null)) {
        craft.sendProgressBarUpdate(this, 0, this.incinerator.getEnergyStored(null));
      }
    }

    this.lastInternalStorage = this.incinerator.getEnergyStored(null);
  }
Example #24
0
  /** Looks for changes made in the container, sends them to every listener. */
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int i = 0; i < this.crafters.size(); ++i) {
      ICrafting icrafting = (ICrafting) this.crafters.get(i);

      if (this.lastCookTime != this.altar.furnaceCookTime) {
        icrafting.sendProgressBarUpdate(this, 0, this.altar.furnaceCookTime);
      }
    }

    this.lastCookTime = this.altar.furnaceCookTime;
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (ICrafting iCrafting : (List<ICrafting>) crafters) {
      if (lastCookTime != campfireEnt.furnaceCookTime) {
        iCrafting.sendProgressBarUpdate(this, 0, campfireEnt.furnaceCookTime);
      }

      if (lastBurnTime != campfireEnt.furnaceBurnTime) {
        iCrafting.sendProgressBarUpdate(this, 1, campfireEnt.furnaceBurnTime);
      }

      if (lastItemBurnTime != campfireEnt.currentItemBurnTime) {
        iCrafting.sendProgressBarUpdate(this, 2, campfireEnt.currentItemBurnTime);
      }
    }

    lastCookTime = campfireEnt.furnaceCookTime;
    lastBurnTime = campfireEnt.furnaceBurnTime;
    lastItemBurnTime = campfireEnt.currentItemBurnTime;
  }
  /** Updates crafting matrix; called from onCraftMatrixChanged. Args: none */
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int var1 = 0; var1 < this.crafters.size(); ++var1) {
      ICrafting var2 = (ICrafting) this.crafters.get(var1);

      for (int i = 0; i < 15; i++) {
        if (this.deconstructor.progress[i] != this.lastProgressTime[i])
          var2.sendProgressBarUpdate(this, i, this.deconstructor.progress[i]);
      }
    }

    for (int i = 0; i < 15; i++) lastProgressTime[i] = this.deconstructor.progress[i];
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (Object crafter : this.crafters) {
      ICrafting iCrafting = (ICrafting) crafter;

      if (this.lastItemLearnTime != this.tileEntityResearchStation.itemLearnTime) {
        iCrafting.sendProgressBarUpdate(this, 0, this.tileEntityResearchStation.itemLearnTime);
      }

      if (this.isItemStackKnown != this.tileEntityResearchStation.isItemKnown) {
        if (this.tileEntityResearchStation.isItemKnown) {
          iCrafting.sendProgressBarUpdate(this, 1, 1);
        } else {
          iCrafting.sendProgressBarUpdate(this, 1, 0);
        }
      }
    }

    this.lastItemLearnTime = this.tileEntityResearchStation.itemLearnTime;
    this.isItemStackKnown = this.tileEntityResearchStation.isItemKnown;
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int i = 0; i < this.crafters.size(); ++i) {
      ICrafting icrafting = (ICrafting) this.crafters.get(i);

      if (this.energy != this.tileEntity.getEnergyStored(ForgeDirection.SOUTH)) {
        icrafting.sendProgressBarUpdate(
            this, 0, this.tileEntity.getEnergyStored(ForgeDirection.SOUTH));
      }
    }

    this.energy = this.tileEntity.getEnergyStored(ForgeDirection.SOUTH);
  }
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    // send changed heats
    for (int i = 0; i < oldHeats.length; i++) {
      int temp = tile.getTemperature(i);
      if (temp != oldHeats[i]) {
        oldHeats[i] = temp;
        for (ICrafting crafter : this.listeners) {
          crafter.sendProgressBarUpdate(this, i, temp);
        }
      }
    }
  }
  /** Looks for changes made in the container, sends them to every listener. */
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (int i = 0; i < this.crafters.size(); ++i) {
      ICrafting icrafting = (ICrafting) this.crafters.get(i);

      if (this.lastCookTime != this.furnace.furnaceCookTime) {
        icrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime);
      }

      if (this.lastBurnTime != this.furnace.furnaceBurnTime) {
        icrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime);
      }

      if (this.lastItemBurnTime != this.furnace.currentItemBurnTime) {
        icrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime);
      }
    }

    this.lastCookTime = this.furnace.furnaceCookTime;
    this.lastBurnTime = this.furnace.furnaceBurnTime;
    this.lastItemBurnTime = this.furnace.currentItemBurnTime;
  }