Storage disk and block stored and capacity counts are formatted now in the tooltip, fixes #1591

This commit is contained in:
raoulvdberge
2017-12-31 11:44:25 +01:00
parent 97874d56a7
commit 6336dca54c
6 changed files with 15 additions and 10 deletions

View File

@@ -3,6 +3,7 @@
### 1.5.31 ### 1.5.31
- Improved the "cannot craft! loop in processing..." error message (raoulvdberge) - Improved the "cannot craft! loop in processing..." error message (raoulvdberge)
- Fixed error logs when toggling the Pattern Grid from and to processing mode (raoulvdberge) - Fixed error logs when toggling the Pattern Grid from and to processing mode (raoulvdberge)
- Storage disk and block stored and capacity counts are formatted now in the tooltip (raoulvdberge)
### 1.5.30 ### 1.5.30
- Fixed crashing bug when MCMultiPart is not installed (raoulvdberge) - Fixed crashing bug when MCMultiPart is not installed (raoulvdberge)

View File

@@ -103,8 +103,8 @@ public class GuiStorage extends GuiBase {
} }
drawTooltip(mouseX, mouseY, (gui.getCapacity() == -1 ? drawTooltip(mouseX, mouseY, (gui.getCapacity() == -1 ?
t("misc.refinedstorage:storage.stored_minimal", gui.getStored()) : t("misc.refinedstorage:storage.stored_minimal", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(gui.getStored())) :
t("misc.refinedstorage:storage.stored_capacity_minimal", gui.getStored(), gui.getCapacity()) t("misc.refinedstorage:storage.stored_capacity_minimal", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(gui.getStored()), RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(gui.getCapacity()))
) + "\n" + TextFormatting.GRAY + t("misc.refinedstorage:storage.full", full)); ) + "\n" + TextFormatting.GRAY + t("misc.refinedstorage:storage.full", full));
} }
} }

View File

@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.RSItems;
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeFluidStorage; import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeFluidStorage;
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
import com.raoulvdberge.refinedstorage.block.FluidStorageType; import com.raoulvdberge.refinedstorage.block.FluidStorageType;
import com.raoulvdberge.refinedstorage.util.RenderUtils;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -35,9 +36,9 @@ public class ItemBlockFluidStorage extends ItemBlockBase {
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeFluidStorage.NBT_STORAGE); NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeFluidStorage.NBT_STORAGE);
if (type == FluidStorageType.TYPE_CREATIVE) { if (type == FluidStorageType.TYPE_CREATIVE) {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", StorageDiskFluid.getStored(tag))); tooltip.add(I18n.format("misc.refinedstorage:storage.stored", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(StorageDiskFluid.getStored(tag))));
} else { } else {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", StorageDiskFluid.getStored(tag), type.getCapacity())); tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(StorageDiskFluid.getStored(tag)), RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(type.getCapacity())));
} }
} }
} }

View File

@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.RSItems;
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeStorage; import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeStorage;
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
import com.raoulvdberge.refinedstorage.block.ItemStorageType; import com.raoulvdberge.refinedstorage.block.ItemStorageType;
import com.raoulvdberge.refinedstorage.util.RenderUtils;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -35,9 +36,9 @@ public class ItemBlockStorage extends ItemBlockBase {
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeStorage.NBT_STORAGE); NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeStorage.NBT_STORAGE);
if (type == ItemStorageType.TYPE_CREATIVE) { if (type == ItemStorageType.TYPE_CREATIVE) {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", StorageDiskItem.getStored(tag))); tooltip.add(I18n.format("misc.refinedstorage:storage.stored", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(StorageDiskItem.getStored(tag))));
} else { } else {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", StorageDiskItem.getStored(tag), type.getCapacity())); tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(StorageDiskItem.getStored(tag)), RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(type.getCapacity())));
} }
} }
} }

View File

@@ -7,6 +7,7 @@ import com.raoulvdberge.refinedstorage.api.storage.StorageDiskType;
import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.API;
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
import com.raoulvdberge.refinedstorage.block.FluidStorageType; import com.raoulvdberge.refinedstorage.block.FluidStorageType;
import com.raoulvdberge.refinedstorage.util.RenderUtils;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -109,9 +110,9 @@ public class ItemFluidStorageDisk extends ItemBase implements IStorageDiskProvid
if (storage.isValid(stack)) { if (storage.isValid(stack)) {
if (storage.getCapacity() == -1) { if (storage.getCapacity() == -1) {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", storage.getStored())); tooltip.add(I18n.format("misc.refinedstorage:storage.stored", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(storage.getStored())));
} else { } else {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", storage.getStored(), storage.getCapacity())); tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(storage.getStored()), RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(storage.getCapacity())));
} }
} }
} }

View File

@@ -7,6 +7,7 @@ import com.raoulvdberge.refinedstorage.api.storage.StorageDiskType;
import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.API;
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
import com.raoulvdberge.refinedstorage.block.ItemStorageType; import com.raoulvdberge.refinedstorage.block.ItemStorageType;
import com.raoulvdberge.refinedstorage.util.RenderUtils;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -101,9 +102,9 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
if (storage.isValid(stack)) { if (storage.isValid(stack)) {
if (storage.getCapacity() == -1) { if (storage.getCapacity() == -1) {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", storage.getStored())); tooltip.add(I18n.format("misc.refinedstorage:storage.stored", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(storage.getStored())));
} else { } else {
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", storage.getStored(), storage.getCapacity())); tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(storage.getStored()), RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(storage.getCapacity())));
} }
} }
} }