NorbiPeti
cae626197f
Fixed setting player properties Changed player rotation to float3 Added constructor for BlockColor with an index param Improved Player.Exists() ~~hopefully~~
51 lines
No EOL
1 KiB
C#
51 lines
No EOL
1 KiB
C#
namespace GamecraftModdingAPI.Blocks
|
|
{
|
|
public struct BlockColor
|
|
{
|
|
public BlockColors Color;
|
|
public byte Darkness;
|
|
|
|
public BlockColor(byte index)
|
|
{
|
|
if (index == byte.MaxValue)
|
|
{
|
|
Color = BlockColors.Default;
|
|
Darkness = 0;
|
|
}
|
|
else
|
|
{
|
|
Color = (BlockColors) (index % 10);
|
|
Darkness = (byte) (index / 10);
|
|
}
|
|
}
|
|
|
|
public BlockColor(BlockColors color, byte darkness)
|
|
{
|
|
Color = color;
|
|
Darkness = darkness;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Preset block colours
|
|
/// </summary>
|
|
public enum BlockColors
|
|
{
|
|
Default = byte.MaxValue,
|
|
White = 0,
|
|
Pink,
|
|
Purple,
|
|
Blue,
|
|
Aqua,
|
|
Green,
|
|
Lime,
|
|
Yellow,
|
|
Orange,
|
|
Red
|
|
}
|
|
} |