@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 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);
 }
  @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]);
        }
      }
    }
  }
Пример #4
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;
  }
  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;
  }
Пример #6
0
 @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);
 }
Пример #7
0
 @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 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);
  }
Пример #10
0
 @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;
 }
 @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();
   if (lastMana != te.getCurrentMana()) {
     for (ICrafting crafter : (List<ICrafting>) crafters) {
       crafter.sendProgressBarUpdate(this, 0, te.getCurrentMana());
     }
     lastMana = te.getCurrentMana();
   }
 }
  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 < crafters.size(); i++) {
     ICrafting crafter = (ICrafting) crafters.get(i);
     if (lastColourFamily != tileEntityColourMixer.getColourFamily()) {
       crafter.sendProgressBarUpdate(this, 0, tileEntityColourMixer.getColourFamily().ordinal());
     }
   }
   lastColourFamily = tileEntityColourMixer.getColourFamily();
 }
  @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);
  }
Пример #16
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;
  }
Пример #17
0
  /** 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 (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);
        }
      }
    }
  }
 @Override
 public void detectAndSendChanges() {
   super.detectAndSendChanges();
   for (Object obj : crafters) {
     ICrafting crafter = (ICrafting) obj;
     for (int i = 0; i < lastDistData.length; i++) {
       if (lastDistData[i] != pipe.logic.distData[i]) {
         crafter.sendProgressBarUpdate(this, i, pipe.logic.distData[i]);
       }
     }
   }
   for (int i = 0; i < lastDistData.length; i++) {
     lastDistData[i] = pipe.logic.distData[i];
   }
 }
Пример #21
0
 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 onSlotChange(final Slot s) {
    if (s == this.patternSlotOUT && Platform.isServer()) {
      for (final Object crafter : this.crafters) {
        final ICrafting icrafting = (ICrafting) crafter;

        for (final Object g : this.inventorySlots) {
          if (g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix) {
            final Slot sri = (Slot) g;
            icrafting.sendSlotContents(this, sri.slotNumber, sri.getStack());
          }
        }
        ((EntityPlayerMP) icrafting).isChangingQuantityOnly = false;
      }
      this.detectAndSendChanges();
    }
  }
Пример #24
0
  @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();
  }
Пример #26
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();
  }
 public void detectAndSendChanges() {
   super.detectAndSendChanges();
   if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
     return;
   }
   this.mTargetSlots = new int[9];
   for (int i = 0; i < 9; i++) {
     this.mTargetSlots[i] =
         ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[i];
   }
   Iterator var2 = this.crafters.iterator();
   while (var2.hasNext()) {
     ICrafting var1 = (ICrafting) var2.next();
     for (int i = 0; i < 9; i++) {
       var1.sendProgressBarUpdate(this, 100 + i, this.mTargetSlots[i]);
     }
   }
 }
  /** 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;
  }
Пример #29
0
 public void detectAndSendChanges() {
   super.detectAndSendChanges();
   if (lastTimer != te.getTimer()) {
     for (ICrafting crafter : (List<ICrafting>) this.crafters) {
       crafter.sendProgressBarUpdate(this, 0, te.getTimer());
     }
     lastTimer = te.getTimer();
   }
   if (!lastTarget.equals(te.getTarget())) {
     for (Object crafter : (List<ICrafting>) this.crafters) {
       if (crafter instanceof EntityPlayerMP) {
         NetworkHandler.sendTo(
             new MessageHandleTextUpdate(te, 0, te.getTarget()), (EntityPlayerMP) crafter);
       }
     }
     lastTarget = te.getTarget();
   }
 }
  /** 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;
  }