Tabnine Logo
IDefinitions.materials
Code IndexAdd Tabnine to your IDE (free)

How to use
materials
method
in
appeng.api.definitions.IDefinitions

Best Java code snippets using appeng.api.definitions.IDefinitions.materials (Showing top 20 results out of 315)

origin: AppliedEnergistics/Applied-Energistics-2

@Override
public Item getItemDropped( final IBlockState state, final Random rand, final int fortune )
{
  return AEApi.instance()
      .definitions()
      .materials()
      .certusQuartzCrystal()
      .maybeItem()
      .orElseThrow( () -> new MissingDefinitionException( "Tried to access certus quartz crystal, even though they are disabled" ) );
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public ItemStack getContainerItem( final ItemStack itemStack )
{
  return AEApi.instance()
      .definitions()
      .materials()
      .emptyStorageCell()
      .maybeStack( 1 )
      .orElseThrow( () -> new MissingDefinitionException( "Tried to use empty storage cells while basic storage cells are defined." ) );
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public Item getItemDropped( final IBlockState state, final Random rand, final int fortune )
{
  return AEApi.instance()
      .definitions()
      .materials()
      .certusQuartzCrystalCharged()
      .maybeItem()
      .orElseThrow( () -> new MissingDefinitionException( "Tried to access charged certus quartz crystal, even though they are disabled" ) );
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public int damageDropped( final IBlockState state )
{
  return AEApi.instance()
      .definitions()
      .materials()
      .certusQuartzCrystalCharged()
      .maybeStack( 1 )
      .orElseThrow( () -> new MissingDefinitionException( "Tried to access charged certus quartz crystal, even though they are disabled" ) )
      .getItemDamage();
}
origin: AppliedEnergistics/Applied-Energistics-2

  @Override
  public int damageDropped( final IBlockState state )
  {
    return AEApi.instance()
        .definitions()
        .materials()
        .certusQuartzCrystal()
        .maybeStack( 1 )
        .orElseThrow( () -> new MissingDefinitionException( "Tried to access certus quartz crystal, even though they are disabled" ) )
        .getItemDamage();
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

private ItemStack getOutput()
{
  final IMaterials materials = AEApi.instance().definitions().materials();
  switch( (CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT ) )
  {
    case MATTER_BALLS:
      return materials.matterBall().maybeStack( 1 ).orElse( ItemStack.EMPTY );
    case SINGULARITY:
      return materials.singularity().maybeStack( 1 ).orElse( ItemStack.EMPTY );
    case TRASH:
    default:
      return ItemStack.EMPTY;
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

private List<ItemStack> getViableStorageComponents( CondenserOutputWrapper recipeWrapper )
{
  CondenserOutput condenserOutput = recipeWrapper.getCondenserOutput();
  IMaterials materials = AEApi.instance().definitions().materials();
  List<ItemStack> viableComponents = new ArrayList<>();
  materials.cell1kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
  materials.cell4kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
  materials.cell16kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
  materials.cell64kPart().maybeStack( 1 ).ifPresent( itemStack -> this.addViableComponent( condenserOutput, viableComponents, itemStack ) );
  return viableComponents;
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public boolean allowInsert( IItemHandler inv, final int i, final ItemStack itemstack )
{
  final IItemDefinition cert = AEApi.instance().definitions().materials().certusQuartzCrystal();
  return Platform.isChargeable( itemstack ) || cert.isSameAs( itemstack );
}
origin: AppliedEnergistics/Applied-Energistics-2

  @Override
  protected void dropEmptyStorageCellCase( final InventoryAdaptor ia, final EntityPlayer player )
  {
    AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).ifPresent( is ->
    {
      final ItemStack extraA = ia.addItems( is );
      if( !extraA.isEmpty() )
      {
        player.dropItem( extraA, false );
      }
    } );
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

  @Override
  protected void dropEmptyStorageCellCase( final InventoryAdaptor ia, final EntityPlayer player )
  {
    AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).ifPresent( is ->
    {
      final ItemStack extraA = ia.addItems( is );
      if( !extraA.isEmpty() )
      {
        player.dropItem( extraA, false );
      }
    } );
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

public DisassembleRecipe()
{
  final IDefinitions definitions = AEApi.instance().definitions();
  final IBlocks blocks = definitions.blocks();
  final IItems items = definitions.items();
  final IMaterials mats = definitions.materials();
  this.cellMappings = new HashMap<>( 4 );
  this.nonCellMappings = new HashMap<>( 5 );
  this.cellMappings.put( items.cell1k(), mats.cell1kPart() );
  this.cellMappings.put( items.cell4k(), mats.cell4kPart() );
  this.cellMappings.put( items.cell16k(), mats.cell16kPart() );
  this.cellMappings.put( items.cell64k(), mats.cell64kPart() );
  this.nonCellMappings.put( items.encodedPattern(), mats.blankPattern() );
  this.nonCellMappings.put( blocks.craftingStorage1k(), mats.cell1kPart() );
  this.nonCellMappings.put( blocks.craftingStorage4k(), mats.cell4kPart() );
  this.nonCellMappings.put( blocks.craftingStorage16k(), mats.cell16kPart() );
  this.nonCellMappings.put( blocks.craftingStorage64k(), mats.cell64kPart() );
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public ItemStack getStack()
{
  final IItemHandler baseInv = this.getItemHandler();
  final ItemStack input = baseInv.getStackInSlot( 0 );
  if( input == ItemStack.EMPTY )
  {
    return ItemStack.EMPTY;
  }
  if( SlotRestrictedInput.isMetalIngot( input ) )
  {
    if( ContainerQuartzKnife.this.myName.length() > 0 )
    {
      return AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).map( namePressStack ->
      {
        final NBTTagCompound compound = Platform.openNbtData( namePressStack );
        compound.setString( "InscribeName", ContainerQuartzKnife.this.myName );
        return namePressStack;
      } ).orElse( ItemStack.EMPTY );
    }
  }
  return ItemStack.EMPTY;
}
origin: AppliedEnergistics/Applied-Energistics-2

public TileWireless()
{
  this.inv.setFilter( new AEItemDefinitionFilter( AEApi.instance().definitions().materials().wirelessBooster() ) );
  this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL );
  this.getProxy().setValidSides( EnumSet.noneOf( EnumFacing.class ) );
}
origin: AppliedEnergistics/Applied-Energistics-2

  public static boolean isRecipePrioritized( final ItemStack what )
  {
    final IMaterials materials = AEApi.instance().definitions().materials();

    boolean isPurified = materials.purifiedCertusQuartzCrystal().isSameAs( what );
    isPurified |= materials.purifiedFluixCrystal().isSameAs( what );
    isPurified |= materials.purifiedNetherQuartzCrystal().isSameAs( what );

    return isPurified;
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

private boolean isPattern( final ItemStack output )
{
  if( output.isEmpty() )
  {
    return false;
  }
  final IDefinitions definitions = AEApi.instance().definitions();
  boolean isPattern = definitions.items().encodedPattern().isSameAs( output );
  isPattern |= definitions.materials().blankPattern().isSameAs( output );
  return isPattern;
}
origin: AppliedEnergistics/Applied-Energistics-2

public static boolean canRepair( final AEFeature type, final ItemStack a, final ItemStack b )
{
  if( b.isEmpty() || a.isEmpty() )
  {
    return false;
  }
  if( type == AEFeature.CERTUS_QUARTZ_TOOLS )
  {
    final IItemDefinition certusQuartzCrystal = AEApi.instance().definitions().materials().certusQuartzCrystal();
    return certusQuartzCrystal.isSameAs( b );
  }
  if( type == AEFeature.NETHER_QUARTZ_TOOLS )
  {
    return Items.QUARTZ == b.getItem();
  }
  return false;
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public void applyTurn()
{
  this.injectExternalPower( PowerUnits.AE, POWER_PER_CRANK_TURN, Actionable.MODULATE );
  final ItemStack myItem = this.inv.getStackInSlot( 0 );
  if( this.getInternalCurrentPower() > POWER_THRESHOLD )
  {
    final IMaterials materials = AEApi.instance().definitions().materials();
    if( materials.certusQuartzCrystal().isSameAs( myItem ) )
    {
      this.extractAEPower( this.getInternalMaxPower(), Actionable.MODULATE, PowerMultiplier.CONFIG );
      materials.certusQuartzCrystalCharged().maybeStack( myItem.getCount() ).ifPresent( charged -> this.inv.setStackInSlot( 0, charged ) );
    }
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

  @Override
  public boolean allowExtract( IItemHandler inv, final int slotIndex, int amount )
  {
    ItemStack extractedItem = inv.getStackInSlot( slotIndex );
    if( Platform.isChargeable( extractedItem ) )
    {
      final IAEItemPowerStorage ips = (IAEItemPowerStorage) extractedItem.getItem();
      if( ips.getAECurrentPower( extractedItem ) >= ips.getAEMaxPower( extractedItem ) )
      {
        return true;
      }
    }
    return AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( extractedItem );
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

public void activate( final EntityPlayer player )
{
  if( !Platform.hasPermissions( new DimensionalCoord( this ), player ) )
  {
    return;
  }
  final ItemStack myItem = this.inv.getStackInSlot( 0 );
  if( myItem.isEmpty() )
  {
    ItemStack held = player.inventory.getCurrentItem();
    if( AEApi.instance().definitions().materials().certusQuartzCrystal().isSameAs( held ) || Platform.isChargeable( held ) )
    {
      held = player.inventory.decrStackSize( player.inventory.currentItem, 1 );
      this.inv.setStackInSlot( 0, held );
    }
  }
  else
  {
    final List<ItemStack> drops = new ArrayList<>();
    drops.add( myItem );
    this.inv.setStackInSlot( 0, ItemStack.EMPTY );
    Platform.spawnDrops( this.world, this.pos.offset( this.getForward() ), drops );
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public ItemStack getIconItemStack()
{
  final IDefinitions definitions = AEApi.instance().definitions();
  final IBlocks blocks = definitions.blocks();
  final IItems items = definitions.items();
  final IMaterials materials = definitions.materials();
  return this.findFirst( blocks.controller(), blocks.chest(), blocks.cellWorkbench(), blocks.fluixBlock(), items.cell1k(), items.networkTool(),
      materials.fluixCrystal(), materials.certusQuartzCrystal(), materials.skyDust() );
}
appeng.api.definitionsIDefinitionsmaterials

Popular methods of IDefinitions

  • blocks
  • items
  • parts

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Reference (javax.naming)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now