public AssemblerFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b, final float speed, final IAEItemStack is ) { super( w, x, y, z, r, g, b ); this.motionX = 0; this.motionY = 0; this.motionZ = 0; this.speed = speed; final ItemStack displayItem = is.asItemStackRepresentation(); this.fi = new EntityFloatingItem( this, w, x, y, z, displayItem ); w.spawnEntity( this.fi ); this.particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2; }
ItemStack getStack() { return this.getAEStack() == null ? ItemStack.EMPTY : this.getAEStack().asItemStackRepresentation(); }
/** * Displays the item currently crafted by the CPU cluster * * @param itemStack stack of crafting monitor * @param currentToolTip unmodified tooltip * @param accessor information wrapper * @param config config option * * @return modified tooltip */ @Override public List<String> getWailaBody( final ItemStack itemStack, final List<String> currentToolTip, final IWailaDataAccessor accessor, final IWailaConfigHandler config ) { final TileEntity te = accessor.getTileEntity(); if( te instanceof TileCraftingMonitorTile ) { final TileCraftingMonitorTile monitor = (TileCraftingMonitorTile) te; final IAEItemStack displayStack = monitor.getJobProgress(); if( displayStack != null ) { final String currentCrafting = displayStack.asItemStackRepresentation().getDisplayName(); currentToolTip.add( WailaText.Crafting.getLocal() + ": " + currentCrafting ); } } return currentToolTip; } }
@Override public ImmutableCollection<ICraftingPatternDetails> getCraftingFor( final IAEItemStack whatToCraft, final ICraftingPatternDetails details, final int slotIndex, final World world ) { final ImmutableList<ICraftingPatternDetails> res = this.craftableItems.get( whatToCraft ); if( res == null ) { if( details != null && details.isCraftable() ) { for( final IAEItemStack ais : this.craftableItems.keySet() ) { if( ais.getItem() == whatToCraft.getItem() && ( !ais.getItem().getHasSubtypes() || ais.getItemDamage() == whatToCraft.getItemDamage() ) ) { // TODO: check if OK // TODO: this is slightly hacky, but fine as long as we only deal with itemstacks if( details.isValidItemForSlot( slotIndex, ais.asItemStackRepresentation(), world ) ) { return this.craftableItems.get( ais ); } } } } return ImmutableSet.of(); } return res; }
if( firstItem != null ) newColor = firstItem.asItemStackRepresentation(); return list.get( 0 ).asItemStackRepresentation();
@Override public void addProbeInfo( AEBaseTile tile, ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data ) { if( tile instanceof TileCraftingMonitorTile ) { final TileCraftingMonitorTile monitor = (TileCraftingMonitorTile) tile; final IAEItemStack displayStack = monitor.getJobProgress(); if( displayStack != null ) { // TODO: check if OK final ItemStack itemStack = displayStack.asItemStackRepresentation(); final String itemName = itemStack.getDisplayName(); final String formattedCrafting = String.format( TheOneProbeText.CRAFTING.getLocal(), itemName ); final IProbeInfo centerAlignedHorizontalLayout = probeInfo .horizontal( probeInfo.defaultLayoutStyle().alignment( ElementAlignment.ALIGN_CENTER ) ); centerAlignedHorizontalLayout.item( itemStack ); centerAlignedHorizontalLayout.text( formattedCrafting ); } } }
currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.asItemStackRepresentation().getDisplayName() );
/** * Render an item in 2D and the given text below it. * * @param spacing Specifies how far apart the item and the item stack amount are rendered. */ public static void renderItem2dWithAmount( IAEItemStack itemStack, float itemScale, float spacing ) { final ItemStack renderStack = itemStack.asItemStackRepresentation(); TesrRenderHelper.renderItem2d( renderStack, itemScale ); final long stackSize = itemStack.getStackSize(); final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm( stackSize ); // Render the item count final FontRenderer fr = Minecraft.getMinecraft().fontRenderer; final int width = fr.getStringWidth( renderedStackSize ); GlStateManager.translate( 0.0f, spacing, 0 ); GlStateManager.scale( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f ); GlStateManager.translate( -0.5f * width, 0.0f, 0.5f ); fr.drawString( renderedStackSize, 0, 0, 0 ); }
public void partition() { final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" ); final IMEInventory<IAEItemStack> cellInv = this.storageBus.getInternalHandler(); Iterator<IAEItemStack> i = new NullIterator<>(); if( cellInv != null ) { final IItemList<IAEItemStack> list = cellInv .getAvailableItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() ); i = list.iterator(); } for( int x = 0; x < inv.getSlots(); x++ ) { if( i.hasNext() && this.isSlotEnabled( ( x / 9 ) - 2 ) ) { // TODO: check if ok final ItemStack g = i.next().asItemStackRepresentation(); ItemHandlerUtil.setStackInSlot( inv, x, g ); } else { ItemHandlerUtil.setStackInSlot( inv, x, ItemStack.EMPTY ); } } this.detectAndSendChanges(); }
final int posY = y * offY + yo; final ItemStack is = refStack.asItemStackRepresentation();
final int posY = y * offY + ITEMSTACK_TOP_OFFSET; final ItemStack is = refStack.asItemStackRepresentation();
@Override public void addProbeInfo( IPart part, ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data ) { if( part instanceof IPartStorageMonitor ) { final IPartStorageMonitor monitor = (IPartStorageMonitor) part; final IAEStack<?> displayed = monitor.getDisplayed(); final boolean isLocked = monitor.isLocked(); // TODO: generalize if( displayed instanceof IAEItemStack ) { final IAEItemStack ais = (IAEItemStack) displayed; probeInfo.text( TheOneProbeText.SHOWING.getLocal() + ": " + ais.asItemStackRepresentation().getDisplayName() ); } else if( displayed instanceof IAEFluidStack ) { final IAEFluidStack ais = (IAEFluidStack) displayed; probeInfo.text( TheOneProbeText.SHOWING.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) ); } probeInfo.text( isLocked ? TheOneProbeText.LOCKED.getLocal() : TheOneProbeText.UNLOCKED.getLocal() ); } }
cca.getCraftingItem().putStack( baseContainer.getTargetStack().asItemStackRepresentation() );
this.drawItem( posX, posY, refStack.asItemStackRepresentation() );
if( penetration <= 0 ) final ItemStack type = aeAmmo.asItemStackRepresentation(); if( type.getItem() instanceof ItemPaintBall )
ContainerWT wtContainer = (ContainerWT) baseContainer; if (wtContainer.getTargetStack() != null) { cca.getCraftingItem().putStack(wtContainer.getTargetStack().asItemStackRepresentation()); cca.setItemToCraft(wtContainer.getTargetStack());