Package appeng.api

Examples of appeng.api.IAppEngApi


        //Move the block on top of the mobilizer
        if (!worldObj.isRemote) {

          TileEntity passenger = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
          IAppEngApi api = AEApi.instance();

          //Prevent the passenger from popping off. Not sent to clients.
          worldObj.setBlock(targetX, yCoord, targetZ, Block.getBlockFromName("stone"), 0, 0);
          //Move non-TE blocks
          Block passengerId = worldObj.getBlock(xCoord, yCoord + 1, zCoord);

          if (worldObj.isAirBlock(xCoord, yCoord + 1, zCoord) || passengerId.canPlaceBlockAt(worldObj, targetX, yCoord + 1, targetZ)) {

            if (passenger == null) {
              if (passengerId != Block.getBlockFromName("bedrock") && passengerId != Block.getBlockFromName("")) {
                worldObj.setBlock(targetX, yCoord + 1, targetZ, passengerId, worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), 3);
                if (passengerId != Block.getBlockFromName("air") && passengerId != Block.getBlockFromName("piston_head")) {
                  worldObj.setBlock(xCoord, yCoord + 1, zCoord, Block.getBlockFromName("air"), 0, 2);
                }
              }
              //If AE is installed, use its handler
            } else if (api != null) {
              if (api.registries().moveable().askToMove(passenger)) {
                worldObj.setBlock(targetX, yCoord + 1, targetZ, worldObj.getBlock(xCoord, yCoord + 1, zCoord), worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), 3);
                passenger.invalidate();
                worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord);
                api.registries().moveable().getHandler(passenger).moveTile(passenger, worldObj, targetX, yCoord + 1, targetZ);
                api.registries().moveable().doneMoving(passenger);
                passenger.validate();
              }

              //Handler IMovableTiles and vanilla TEs without AE
            } else if (passenger instanceof IMovableTile || passenger.getClass().getName().startsWith("net.minecraft.tileentity")) {
View Full Code Here


      return false;

    if ( !inventory.isItemValidForSlot( this.getSlotIndex(), i ) )
      return false;

    IAppEngApi api = AEApi.instance();

    if ( !allowEdit )
      return false;

    switch (which)
    {
    case ENCODED_CRAFTING_PATTERN:
      if ( i.getItem() instanceof ICraftingPatternItem )
      {
        ICraftingPatternItem b = (ICraftingPatternItem) i.getItem();
        ICraftingPatternDetails de = b.getPatternForItem( i, p.player.worldObj );
        if ( de != null )
          return de.isCraftable();
      }
      return false;
    case VALID_ENCODED_PATTERN_W_OUTPUT:
    case ENCODED_PATTERN_W_OUTPUT:
    case ENCODED_PATTERN: {
      if ( i.getItem() instanceof ICraftingPatternItem )
        return true;
      // ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem)
      // i.getItem()).getPatternForItem( i ) : null;
      return false;// pattern != null;
    }
    case BLANK_PATTERN:
      return AEApi.instance().materials().materialBlankPattern.sameAsStack( i );
    case PATTERN:

      if ( i.getItem() instanceof ICraftingPatternItem )
        return true;

      return AEApi.instance().materials().materialBlankPattern.sameAsStack( i );

    case INSCRIBER_PLATE:

      if ( AEApi.instance().materials().materialNamePress.sameAsStack( i ) )
        return true;

      for (ItemStack is : Inscribe.plates)
        if ( Platform.isSameItemPrecise( is, i ) )
          return true;

      return false;

    case INSCRIBER_INPUT:
      return true;/*
             * for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return true;
             *
             * return false;
             */

    case METAL_INGOTS:

      return isMetalIngot( i );

    case VIEW_CELL:
      return AEApi.instance().items().itemViewCell.sameAsStack( i );
    case ORE:
      return appeng.api.AEApi.instance().registries().grinder().getRecipeForInput( i ) != null;
    case FUEL:
      return TileEntityFurnace.getItemBurnTime( i ) > 0;
    case POWERED_TOOL:
      return Platform.isChargeable( i );
    case QE_SINGULARITY:
      return api.materials().materialQESingularity.sameAsStack( i );
    case RANGE_BOOSTER:
      return api.materials().materialWirelessBooster.sameAsStack( i );
    case SPATIAL_STORAGE_CELLS:
      return i.getItem() instanceof ISpatialStorageCell && ((ISpatialStorageCell) i.getItem()).isSpatialStorage( i );
    case STORAGE_CELLS:
      return AEApi.instance().registries().cell().isCellHandled( i );
    case WORKBENCH_CELL:
View Full Code Here

TOP

Related Classes of appeng.api.IAppEngApi

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.