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() ); }
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; }
private boolean clearPattern( final ItemStack stack, final EntityPlayer player ) { if( player.isSneaking() ) { if( Platform.isClient() ) { return false; } final InventoryPlayer inv = player.inventory; ItemStack is = AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.getCount() ).orElse( ItemStack.EMPTY ); if( !is.isEmpty() ) { for( int s = 0; s < player.inventory.getSizeInventory(); s++ ) { if( inv.getStackInSlot( s ) == stack ) { inv.setInventorySlotContents( s, is ); return true; } } } } return false; }
return materials.blankPattern().isSameAs( i ); return materials.blankPattern().isSameAs( i );