@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" ) ); }
@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(); }
@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 ) ); } } }
@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 ); } }
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getInternalInventory().getStackInSlot( 0 ) ) )
materials.certusQuartzCrystalCharged().maybeStack( myItem.getCount() ).ifPresent( charged -> this.inv.setStackInSlot( 0, charged ) );
final IMaterials materials = AEApi.instance().definitions().materials(); if( materials.certusQuartzCrystalCharged().isSameAs( item ) )
this.addDescription( registry, materials.certusQuartzCrystalCharged(), message );
certusQuartz.add(AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack(1).orElse(ItemStack.EMPTY)); certusQuartz.add(AEApi.instance().definitions().materials().purifiedCertusQuartzCrystal().maybeStack(1).orElse(ItemStack.EMPTY));