A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BlockColor.cs 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. namespace GamecraftModdingAPI.Blocks
  2. {
  3. public struct BlockColor
  4. {
  5. public BlockColors Color;
  6. public byte Darkness;
  7. public BlockColor(byte index)
  8. {
  9. if (index == byte.MaxValue)
  10. {
  11. Color = BlockColors.Default;
  12. Darkness = 0;
  13. }
  14. else
  15. {
  16. Color = (BlockColors) (index % 10);
  17. Darkness = (byte) (index / 10);
  18. }
  19. }
  20. public BlockColor(BlockColors color, byte darkness)
  21. {
  22. Color = color;
  23. Darkness = darkness;
  24. }
  25. public override string ToString()
  26. {
  27. return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}";
  28. }
  29. }
  30. /// <summary>
  31. /// Preset block colours
  32. /// </summary>
  33. public enum BlockColors
  34. {
  35. Default = byte.MaxValue,
  36. White = 0,
  37. Pink,
  38. Purple,
  39. Blue,
  40. Aqua,
  41. Green,
  42. Lime,
  43. Yellow,
  44. Orange,
  45. Red
  46. }
  47. }