public QnbFormedBakedModel( VertexFormat vertexFormat, IBakedModel baseModel, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter ) { this.vertexFormat = vertexFormat; this.baseModel = baseModel; this.linkTexture = bakedTextureGetter.apply( TEXTURE_LINK ); this.ringTexture = bakedTextureGetter.apply( TEXTURE_RING ); this.glassCableTexture = bakedTextureGetter.apply( TEXTURE_CABLE_GLASS ); this.coveredCableTexture = bakedTextureGetter.apply( TEXTURE_COVERED_CABLE ); this.lightTexture = bakedTextureGetter.apply( TEXTURE_RING_LIGHT ); this.lightCornerTexture = bakedTextureGetter.apply( TEXTURE_RING_LIGHT_CORNER ); this.linkBlock = AEApi.instance().definitions().blocks().quantumLink().maybeBlock().orElse( null ); }
@Override public ItemStack getItemStackRepresentation() { return AEApi.instance().definitions().blocks().iface().maybeStack( 1 ).orElse( ItemStack.EMPTY ); }
@Override public ItemStack getItemStackRepresentation() { return AEApi.instance().definitions().blocks().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY ); }
private boolean isCenter() { return AEApi.instance() .definitions() .blocks() .quantumLink() .maybeBlock() .map( link -> this.getBlockType() == link ) .orElse( false ); }
@Override public ItemStack getItemStackRepresentation() { return AEApi.instance().definitions().blocks().chest().maybeStack( 1 ).orElse( ItemStack.EMPTY ); }
@Override public ItemStack getItemStackRepresentation() { return AEApi.instance().definitions().blocks().drive().maybeStack( 1 ).orElse( ItemStack.EMPTY ); }
@Override public ItemStack getContainerItem( final ItemStack itemStack ) { return AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).orElse( ItemStack.EMPTY ); }
@Override public ItemStack getPickBlock( IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player ) { return AEApi.instance() .definitions() .blocks() .quartzOreCharged() .maybeStack( 1 ) .orElseThrow( () -> new MissingDefinitionException( "Tried to access charged certus quartz ore, even though they are disabled" ) ); }
@Override protected ItemStack getItemFromTile( final Object obj ) { final Optional<ItemStack> is = AEApi.instance().definitions().blocks().craftingMonitor().maybeStack( 1 ); return is.orElseGet( () -> super.getItemFromTile( obj ) ); } }
@Override protected ItemStack getItemFromTile( final Object obj ) { Optional<ItemStack> is = Optional.empty(); if( ( (TileCraftingTile) obj ).isAccelerator() ) { is = AEApi.instance().definitions().blocks().craftingAccelerator().maybeStack( 1 ); } else { is = AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ); } return is.orElseGet( () -> super.getItemFromTile( obj ) ); }
@Override public void onReady() { super.onReady(); final IBlockDefinition quantumRing = AEApi.instance().definitions().blocks().quantumRing(); final Optional<Block> maybeLinkBlock = quantumRing.maybeBlock(); final Optional<ItemStack> maybeLinkStack = quantumRing.maybeStack( 1 ); final boolean isPresent = maybeLinkBlock.isPresent() && maybeLinkStack.isPresent(); if( isPresent && this.getBlockType() == maybeLinkBlock.get() ) { final ItemStack linkStack = maybeLinkStack.get(); this.getProxy().setVisualRepresentation( linkStack ); } }
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() ); }
public QuartzWorldGen() { final IBlocks blocks = AEApi.instance().definitions().blocks(); final IBlockDefinition oreDefinition = blocks.quartzOre(); final IBlockDefinition chargedDefinition = blocks.quartzOreCharged(); this.oreNormal = oreDefinition.maybeBlock() .map( b -> new WorldGenMinable( b.getDefaultState(), AEConfig.instance().getQuartzOresPerCluster() ) ) .orElse( null ); this.oreCharged = chargedDefinition.maybeBlock() .map( b -> new WorldGenMinable( b.getDefaultState(), AEConfig.instance().getQuartzOresPerCluster() ) ) .orElse( null ); }
@Override public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { super.drawBG( offsetX, offsetY, mouseX, mouseY ); final IDefinitions definitions = AEApi.instance().definitions(); definitions.items().cell1k().maybeStack( 1 ).ifPresent( cell1kStack -> this.drawItem( offsetX + 66 - 8, offsetY + 17, cell1kStack ) ); definitions.blocks().drive().maybeStack( 1 ).ifPresent( driveStack -> this.drawItem( offsetX + 94 + 8, offsetY + 17, driveStack ) ); }
private void registerInscriberRecipes( IDefinitions definitions, IModRegistry registry ) { registry.handleRecipes( IInscriberRecipe.class, new InscriberRecipeHandler(), InscriberRecipeCategory.UID ); // Register the inscriber as the crafting item for the inscription category definitions.blocks().inscriber().maybeStack( 1 ).ifPresent( inscriber -> { registry.addRecipeCatalyst( inscriber, InscriberRecipeCategory.UID ); } ); List<IInscriberRecipe> inscriberRecipes = new ArrayList<>( AEApi.instance().registries().inscriber().getRecipes() ); registry.addRecipes( inscriberRecipes, InscriberRecipeCategory.UID ); }
private void registerGrinderRecipes( IDefinitions definitions, IModRegistry registry ) { ItemStack grindstone = definitions.blocks().grindstone().maybeStack( 1 ).orElse( ItemStack.EMPTY ); if( grindstone.isEmpty() ) { return; } registry.handleRecipes( IGrinderRecipe.class, new GrinderRecipeHandler(), GrinderRecipeCategory.UID ); registry.addRecipes( Lists.newArrayList( AEApi.instance().registries().grinder().getRecipes() ), GrinderRecipeCategory.UID ); registry.addRecipeCatalyst( grindstone, GrinderRecipeCategory.UID ); }
public TileIOPort() { this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL ); this.manager = new ConfigManager( this ); this.manager.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); this.manager.registerSetting( Settings.FULLNESS_MODE, FullnessMode.EMPTY ); this.manager.registerSetting( Settings.OPERATION_MODE, OperationMode.EMPTY ); this.mySrc = new MachineSource( this ); this.lastRedstoneState = YesNo.UNDECIDED; final Block ioPortBlock = AEApi.instance().definitions().blocks().iOPort().maybeBlock().get(); this.upgrades = new BlockUpgradeInventory( ioPortBlock, this, NUMBER_OF_UPGRADE_SLOTS ); }
public TileInscriber() { this.getProxy().setValidSides( EnumSet.noneOf( EnumFacing.class ) ); this.setInternalMaxPower( 1600 ); this.getProxy().setIdlePowerUsage( 0 ); this.settings = new ConfigManager( this ); final ITileDefinition inscriberDefinition = AEApi.instance().definitions().blocks().inscriber(); this.upgrades = new DefinitionUpgradeInventory( inscriberDefinition, this, this.getUpgradeSlots() ); this.sideItemHandler.setMaxStackSize( 1, 64 ); final IAEItemFilter filter = new ItemHandlerFilter(); this.topItemHandlerExtern = new WrapperFilteredItemHandler( this.topItemHandler, filter ); this.bottomItemHandlerExtern = new WrapperFilteredItemHandler( this.bottomItemHandler, filter ); this.sideItemHandlerExtern = new WrapperFilteredItemHandler( this.sideItemHandler, filter ); }
public TileMolecularAssembler() { final ITileDefinition assembler = AEApi.instance().definitions().blocks().molecularAssembler(); this.settings = new ConfigManager( this ); this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE ); this.getProxy().setIdlePowerUsage( 0.0 ); this.upgrades = new DefinitionUpgradeInventory( assembler, this, this.getUpgradeSlots() ); this.craftingInv = new InventoryCrafting( new ContainerNull(), 3, 3 ); }
@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() ); }