Package buildcraft.transport

Examples of buildcraft.transport.Gate


    return gate != null ? gate.getRedstoneOutput() : 0;
  }

  private int getRedstoneOutputSide(ForgeDirection dir) {
    Gate gate = gates[dir.ordinal()];

    return gate != null ? gate.getSidedRedstoneOutput() : 0;
  }
View Full Code Here


    return wireSet;
  }

  @Override
  public ItemStack getGateItem(int side) {
    Gate gate = gates[side];
    return gate != null ? gate.getGateItem() : null;
  }
View Full Code Here

      final ItemGate.GatePluggable gatePluggable = coreState.gates[i];
      if (gatePluggable == null) {
        wrapper.gates[i] = gates[i] = null;
        continue;
      }
      Gate gate = gates[i];
      if (gate == null || gate.logic != gatePluggable.logic || gate.material != gatePluggable.material) {
        wrapper.gates[i] = gates[i] = GateFactory.makeGate(this.wrapper, gatePluggable.material, gatePluggable.logic, ForgeDirection.getOrientation(i));
      }
    }
   
View Full Code Here

  }

  private void syncGateExpansions() {
    resyncGateExpansions = false;
    for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
      Gate gate = gates[i];
      ItemGate.GatePluggable gatePluggable = coreState.gates[i];
      if (gate != null && gatePluggable.expansions.length > 0) {
        for (IGateExpansion expansion : gatePluggable.expansions) {
          if (expansion != null) {
            if (!gate.expansions.containsKey(expansion)) {
              gate.addGateExpansion(expansion);
            }
          } else {
            resyncGateExpansions = true;
          }
        }
View Full Code Here

      }
    }

    // Gate Textures and movement
    for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
      final Gate gate = (Gate) pipe.pipe.bcPipePart.getGate(direction.ordinal());
      bcRenderState.gateMatrix.setIsGateExists(gate != null, direction);
      bcRenderState.gateMatrix.setIsGateLit(gate != null && gate.isGateActive(), direction);
      bcRenderState.gateMatrix.setIsGatePulsing(gate != null && gate.isGatePulsing(), direction);
    }
    // Facades
    for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
      IPipePluggable pluggable = sideProperties.pluggables[direction.ordinal()];
      if (!(pluggable instanceof ItemFacade.FacadePluggable)) {
View Full Code Here

      data.setBoolean("wireSet[" + i + "]", wireSet[i]);
    }
    // Save gate if any
    for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
      final String key = "Gate[" + i + "]";
      Gate gate = gates[i];
      if (gate != null) {
        NBTTagCompound gateNBT = new NBTTagCompound();
        gate.writeToNBT(gateNBT);
        data.setTag(key, gateNBT);
      } else {
        data.removeTag(key);
      }
    }
View Full Code Here

  }

  @Override
  public void resetGate() {
    for (int i = 0; i < gates.length; i++) {
      Gate gate = gates[i];
      if (gate != null) {
        gate.resetGate();
      }
      gates[i] = null;
    }

    this.container.pipe.internalUpdateScheduled = true;
View Full Code Here

   
    return output;
  }

  private int getRedstoneOutput(ForgeDirection dir) {
    Gate gate = gates[dir.ordinal()];

    return gate != null ? gate.getRedstoneOutput() : 0;
  }
View Full Code Here

    return new ActionParameterSignal();
  }

  @Override
  public void actionActivate(IStatementContainer container, IStatementParameter[] parameters) {
    Gate gate = (Gate) container;

    gate.broadcastSignal(color);

    for (IStatementParameter param : parameters) {
      if (param != null) {
        ActionParameterSignal signal = (ActionParameterSignal) param;

        if (signal.color != null) {
          gate.broadcastSignal(signal.color);
        }
      }
    }
  }
View Full Code Here

    @Override
    public void onAttachedPipe(IPipeTile pipe, ForgeDirection direction) {
      TileGenericPipe pipeReal = (TileGenericPipe) pipe;
      if (!pipeReal.getWorld().isRemote) {
        Gate gate = pipeReal.pipe.gates[direction.ordinal()];
        if (gate == null || gate.material != material || gate.logic != logic) {
          pipeReal.pipe.gates[direction.ordinal()] = GateFactory.makeGate(pipeReal.pipe, material, logic, direction);
          pipeReal.scheduleRenderUpdate();
        }
      }
View Full Code Here

TOP

Related Classes of buildcraft.transport.Gate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.