mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-14 12:19:10 +01:00
backport traveller's sack item count tooltip to 1.10.2 branch (#483)
* backport traveller's sack item count tooltip to 1.10.2 branch
This commit is contained in:
parent
cde6127fd1
commit
6844c44dcf
1 changed files with 16 additions and 1 deletions
|
@ -56,7 +56,22 @@ public class ItemBag extends ItemBase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced){
|
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced){
|
||||||
tooltip.add(TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".previously"+(this.isVoid ? "VoidBag" : "Bag")));
|
ItemStack[] slots = new ItemStack[ContainerBag.getSlotAmount(this.isVoid)];
|
||||||
|
ItemDrill.loadSlotsFromNBT(slots, stack);
|
||||||
|
|
||||||
|
int slotsTotal = slots.length;
|
||||||
|
int slotsFilled = 0;
|
||||||
|
|
||||||
|
for(ItemStack slotStack : slots){
|
||||||
|
if(StackUtil.isValid(slotStack)){
|
||||||
|
slotsFilled++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't count the filter 4 slots
|
||||||
|
slotsTotal = slotsTotal - 4;
|
||||||
|
|
||||||
|
tooltip.add(TextFormatting.ITALIC.toString()+slotsFilled+"/"+slotsTotal+" filled slots");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
Loading…
Reference in a new issue