mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
parent
eeac084481
commit
bc220573e8
1 changed files with 14 additions and 7 deletions
|
@ -53,7 +53,19 @@ 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")));
|
NonNullList<ItemStack> slots = StackUtil.createSlots(ContainerBag.getSlotAmount(this.isVoid));
|
||||||
|
ItemDrill.loadSlotsFromNBT(slots, stack);
|
||||||
|
|
||||||
|
int slotsTotal = slots.size();
|
||||||
|
int slotsFilled = 0;
|
||||||
|
|
||||||
|
for(ItemStack slotStack : slots){
|
||||||
|
if(StackUtil.isValid(slotStack)){
|
||||||
|
slotsFilled++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tooltip.add(TextFormatting.ITALIC.toString()+slotsFilled+"/"+slotsTotal+" filled slots");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
@ -124,14 +136,9 @@ public class ItemBag extends ItemBase{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!StackUtil.isValid(stack)){
|
|
||||||
item.setDead();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item.setEntityItemStack(stack);
|
item.setEntityItemStack(stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
|
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
|
||||||
|
|
Loading…
Reference in a new issue