Package net.minecraftforge.common.util

Examples of net.minecraftforge.common.util.ForgeDirection


   * @param y
   * @param z
   */
  protected void checkForConnections(IBlockAccess world, int x, int y, int z) {
    boolean wasConnected = (rfNetwork != null);
    ForgeDirection out = getOutwardsDir();
    if(out == ForgeDirection.UNKNOWN) {
      wasConnected = false;
      rfNetwork = null;
    }
    else {
View Full Code Here


  public int onProvidePower(int units) {
    if(rfNetwork == null) {
      return units;
    }

    ForgeDirection approachDirection = getOutwardsDir().getOpposite();
    int energyConsumed = rfNetwork.receiveEnergy(approachDirection, (int)units, false);
    units -= energyConsumed;
   
    return units;
  }
View Full Code Here

      TileEntity te = world.getTileEntity(x, y, z);
        if (te instanceof TileEntityReactorRedstonePort)
        {
          TileEntityReactorRedstonePort port = (TileEntityReactorRedstonePort)te;
          if(port.isRedstoneActive()) {
                ForgeDirection out = port.getOutwardsDir();
               
                if(out != ForgeDirection.UNKNOWN) {
                    double particleX, particleY, particleZ;
                    particleY = y + 0.45D + par5Random.nextFloat() * 0.1D;

 
View Full Code Here

   * @param y
   * @param z
   */
  protected void checkForConnections(IBlockAccess world, int x, int y, int z) {
    boolean wasConnected = (rfNetwork != null);
    ForgeDirection out = getOutwardsDir();
    if(out == ForgeDirection.UNKNOWN) {
      wasConnected = false;
      rfNetwork = null;
    }
    else {
View Full Code Here

  public int onProvidePower(int units) {
    if(rfNetwork == null) {
      return units;
    }
   
    ForgeDirection approachDirection = getOutwardsDir().getOpposite();
    int energyConsumed = rfNetwork.receiveEnergy(approachDirection, (int)units, false);
    units -= energyConsumed;
   
    return units;
  }
View Full Code Here

 
  public void onNeighborBlockChange(int x, int y, int z, Block neighborBlock) {
    if(!this.isConnected()) { return; }

    if(this.isInput()) {
      ForgeDirection out = getOutwardsDir();
      boolean nowPowered = isReceivingRedstonePowerFrom(worldObj, xCoord+out.offsetX, yCoord+out.offsetY, zCoord+out.offsetZ, out, neighborBlock);

      if(this.isExternallyPowered != nowPowered) {
        this.isExternallyPowered = nowPowered;
        this.onRedstoneInputUpdated();
View Full Code Here

    else if(TileEntityReactorRedNetPort.isOutput(this.circuitType)) { this.activeOnPulse = false; }
   
    // Do updates
    if(this.isInput()) {
      // Update inputs so we don't pulse/change automatically
      ForgeDirection out = getOutwardsDir();
      this.isExternallyPowered = isReceivingRedstonePowerFrom(worldObj, xCoord+out.offsetX, yCoord+out.offsetY, zCoord+out.offsetZ, out);
      if(!this.isInputActiveOnPulse()) {
        onRedstoneInputUpdated();
      }
    }
View Full Code Here

            super(tileEntity, "energy_handler");
        }

        @Callback(doc = "function([direction:number=6]):number --  Returns the amount of stored energy for the given side.")
        public Object[] getEnergyStored(final Context context, final Arguments args) {
            final ForgeDirection side = args.count() > 0 ? ForgeDirection.getOrientation(args.checkInteger(0)) : ForgeDirection.UNKNOWN;
            return new Object[]{tileEntity.getEnergyStored(side)};
        }
View Full Code Here

            return new Object[]{tileEntity.getEnergyStored(side)};
        }

        @Callback(doc = "function([direction:number=6]):number --  Returns the maximum amount of stored energy for the given side.")
        public Object[] getMaxEnergyStored(final Context context, final Arguments args) {
            final ForgeDirection side = args.count() > 0 ? ForgeDirection.getOrientation(args.checkInteger(0)) : ForgeDirection.UNKNOWN;
            return new Object[]{tileEntity.getMaxEnergyStored(side)};
        }
View Full Code Here

            super(tileEntity, "fluid_handler");
        }

        @Callback(doc = "function([side:number=6]):table -- Get some information about the tank accessible from the specified side.")
        public Object[] getTankInfo(final Context context, final Arguments args) {
            ForgeDirection side = args.count() > 0 ? ForgeDirection.getOrientation(args.checkInteger(0)) : ForgeDirection.UNKNOWN;
            return tileEntity.getTankInfo(side);
        }
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.util.ForgeDirection

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.