Merge pull request #1269 from thatsIch/b-1256-number-converter

Fixes #1256: Using new size logic to determine the abbreviation for a stack size
This commit is contained in:
thatsIch
2015-04-23 23:43:31 +02:00
10 changed files with 406 additions and 390 deletions
@@ -59,14 +59,21 @@ import appeng.core.AELog;
import appeng.core.localization.PlayerMessages;
import appeng.helpers.Reflected;
import appeng.me.GridAccessException;
import appeng.util.IWideReadableNumberConverter;
import appeng.util.Platform;
import appeng.util.ReadableNumberConverter;
import appeng.util.item.AEItemStack;
/**
* @author AlgorithmX2
* @author thatsIch
* @version rv2
* @since rv0
*/
public class PartStorageMonitor extends PartMonitor implements IPartStorageMonitor, IStackWatcherHost
{
private static final ReadableNumberConverter NUMBER_CONVERTER = ReadableNumberConverter.INSTANCE;
private static final IWideReadableNumberConverter NUMBER_CONVERTER = ReadableNumberConverter.INSTANCE;
IAEItemStack configuredItem;
boolean isLocked;
IStackWatcher myWatcher;
@@ -339,7 +346,7 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
GL11.glScalef( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
final long stackSize = ais.getStackSize();
final String renderedStackSize = NUMBER_CONVERTER.toHumanReadableForm( stackSize );
final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm( stackSize );
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
int width = fr.getStringWidth( renderedStackSize );