Java Code Examples for net.minecraftforge.items.ItemHandlerHelper#calcRedstoneFromInventory()

The following examples show how to use net.minecraftforge.items.ItemHandlerHelper#calcRedstoneFromInventory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SawmillBlock.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Deprecated
@Override
public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos)
{
    TileEntity te = worldIn.getTileEntity(pos);
    if (te instanceof SawmillTileEntity)
        return ItemHandlerHelper.calcRedstoneFromInventory(((SawmillTileEntity) te).getInventory());
    return 0;
}
 
Example 2
Source File: MetaTileEntityChest.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public int getActualComparatorValue() {
    return ItemHandlerHelper.calcRedstoneFromInventory(inventory);
}
 
Example 3
Source File: CartHopperBehaviourItems.java    From Signals with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getComparatorInputOverride(IItemHandler capability){
    return ItemHandlerHelper.calcRedstoneFromInventory(capability);
}