FluidKeys.EMPTY could have a better name
williambl opened this issue ยท 4 comments
I know there is a comment saying "Empty doesn't have a proper sprite or text component because it doesn't ever make sense to use it." However, if the empty fluid key had a less out-of-place name, it'd cut down on code like this:
private Text getFluidName(FluidKey key) {
if (key == FluidKeys.EMPTY)
return someOtherValue;
else return key.name;
}
such as what is in my mod.
My suggestions for names are:
new LiteralText("None")
- makes sense in most contexts.
new LiteralText("Empty")
- close to current, but less out-of-place.
Blocks.AIR.getName()
- this may look insane, but it has a couple of things going for it:
- In most cases, an empty container is filled with air.
- It's localised.
- if this is done, then
someFluidKey.name
and
someRawFluid.toBlockstate().getBlock().getName()
(which is, afaik, the only way to get the name of a vanilla fluid)
will be the same, disregarding formatting.
That's a good point - so far I've been assuming that everyone would be happy with re-using LBA's own fluid tooltip methods (For example getFluidVolume(stack).addFullTooltip(getCapacity(stack), tooltip);
should add a tooltip similar to Empty 16 Bucket Tank
or 5 Buckets of Water in a 16 Bucket Tank
, or at least it would do if it wasn't buggy :/ )
I'll add a localisable string "libblockattributes.fluid.empty": "Empty"
as I think that's probably simplest.
(I've pushed this in 0.8.2-pre.6).
I'll admit though it does result in an awkward tooltip - while Big Bucket: Empty
or Empty Big Bucket
would make sense (similar to how vanilla localises fluids in buckets), I'm not so sure about Fluid: Empty
. (So you might want to special-case empty anyway?)