Added a color code to the memory card. (#3609)

Can be used to encode the stored content as a 4x2 grid of AEColors
Currently used to indicate the P2P frequency.
This commit is contained in:
yueh
2018-07-14 19:42:56 +02:00
committed by GitHub
parent 2891014cf6
commit fe4db2eb98
17 changed files with 462 additions and 77 deletions
@@ -21,8 +21,6 @@ package appeng.util.helpers;
import com.google.common.base.Preconditions;
import net.minecraft.util.text.TextFormatting;
import appeng.api.util.AEColor;
@@ -69,22 +67,4 @@ public class P2PHelper
return String.format( "%04X", frequency );
}
public String toColorHexDigit( AEColor color )
{
return TextFormatting.fromColorIndex( color.ordinal() ) + this.toHexDigit( color );
}
public String toColorHexString( short frequency )
{
final AEColor[] colors = toColors( frequency );
final StringBuilder builder = new StringBuilder();
for( AEColor aeColor : colors )
{
builder.append( this.toColorHexDigit( aeColor ) );
}
return builder.toString();
}
}