Moar Gamecraft commands!
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

41 行
1.2KB

  1. using Svelto.ECS;
  2. //using Svelto.Context;
  3. using Unity.Mathematics;
  4. using GamecraftModdingAPI.Commands;
  5. using GamecraftModdingAPI;
  6. namespace ExtraCommands.Building
  7. {
  8. [CustomCommand("RotateLastBlock", "Rotate last block from original position")]
  9. class RotateBlocksCommandEngine : ICustomCommandEngine
  10. {
  11. public string Description => "Rotate last block from original position";
  12. public string Name => "RotateLastBlock";
  13. public EntitiesDB entitiesDB { set; private get; }
  14. public bool isRemovable => true;
  15. public void Ready()
  16. {
  17. CommandRegistrationHelper.Register<float, float, float>(Name, RotateLastBlockCommand, Description);
  18. }
  19. // Move block with highest index by vector (x,y,z)
  20. private void RotateLastBlockCommand(float x, float y, float z)
  21. {
  22. float3 eulerAngles = new float3(x, y, z);
  23. Block.GetLastPlacedBlock().Rotation += eulerAngles;
  24. //GamecraftModdingAPI.Blocks.Rotation.RotateBlock(BlockIdentifiers.LatestBlockID, eulerAngles);
  25. }
  26. public void Dispose()
  27. {
  28. //CustomCommandUtility.Unregister("RotateBlocks");
  29. CommandRegistrationHelper.Unregister("RotateLastBlock");
  30. }
  31. }
  32. }