Storage disk and block stored and capacity counts are formatted now in the tooltip, fixes #1591
This commit is contained in:
@@ -103,8 +103,8 @@ public class GuiStorage extends GuiBase {
|
||||
}
|
||||
|
||||
drawTooltip(mouseX, mouseY, (gui.getCapacity() == -1 ?
|
||||
t("misc.refinedstorage:storage.stored_minimal", gui.getStored()) :
|
||||
t("misc.refinedstorage:storage.stored_capacity_minimal", gui.getStored(), gui.getCapacity())
|
||||
t("misc.refinedstorage:storage.stored_minimal", RenderUtils.QUANTITY_FORMATTER_UNFORMATTED.format(gui.getStored())) :
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.RSItems;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeFluidStorage;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
|
||||
import com.raoulvdberge.refinedstorage.block.FluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -35,9 +36,9 @@ public class ItemBlockFluidStorage extends ItemBlockBase {
|
||||
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeFluidStorage.NBT_STORAGE);
|
||||
|
||||
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 {
|
||||
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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.RSItems;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeStorage;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
|
||||
import com.raoulvdberge.refinedstorage.block.ItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -35,9 +36,9 @@ public class ItemBlockStorage extends ItemBlockBase {
|
||||
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(NetworkNodeStorage.NBT_STORAGE);
|
||||
|
||||
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 {
|
||||
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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.raoulvdberge.refinedstorage.api.storage.StorageDiskType;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskFluid;
|
||||
import com.raoulvdberge.refinedstorage.block.FluidStorageType;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -109,9 +110,9 @@ public class ItemFluidStorageDisk extends ItemBase implements IStorageDiskProvid
|
||||
|
||||
if (storage.isValid(stack)) {
|
||||
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 {
|
||||
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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.raoulvdberge.refinedstorage.api.storage.StorageDiskType;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItem;
|
||||
import com.raoulvdberge.refinedstorage.block.ItemStorageType;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -101,9 +102,9 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
|
||||
|
||||
if (storage.isValid(stack)) {
|
||||
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 {
|
||||
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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user