Add an ease of use tooltip to the creative cell. Displays the items provided/formatted by the cell.
This commit is contained in:
parent
eb0b304fd9
commit
7398af0e1c
1 changed files with 25 additions and 0 deletions
|
@ -19,6 +19,11 @@
|
||||||
package appeng.items.storage;
|
package appeng.items.storage;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.api.AEApi;
|
||||||
|
import appeng.api.storage.ICellInventoryHandler;
|
||||||
|
import appeng.api.storage.IMEInventoryHandler;
|
||||||
|
import appeng.api.storage.StorageChannel;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@ -27,6 +32,7 @@ import appeng.api.storage.ICellWorkbenchItem;
|
||||||
import appeng.items.AEBaseItem;
|
import appeng.items.AEBaseItem;
|
||||||
import appeng.items.contents.CellConfig;
|
import appeng.items.contents.CellConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenchItem
|
public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenchItem
|
||||||
{
|
{
|
||||||
|
@ -65,4 +71,23 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||||
|
{
|
||||||
|
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||||
|
|
||||||
|
if( inventory instanceof ICellInventoryHandler)
|
||||||
|
{
|
||||||
|
final CellConfig cc = new CellConfig( stack );
|
||||||
|
|
||||||
|
for( final ItemStack is : cc )
|
||||||
|
{
|
||||||
|
if( !is.isEmpty() )
|
||||||
|
{
|
||||||
|
lines.add( is.getDisplayName() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue