Moar Gamecraft commands!
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

53 řádky
1.6KB

  1. using System;
  2. using System.Collections.Generic;
  3. using RobocraftX.Multiplayer;
  4. using RobocraftX.Common;
  5. using RobocraftX.Blocks;
  6. using RobocraftX.Blocks.Ghost;
  7. using Svelto.ECS;
  8. using Svelto.ECS.EntityStructs;
  9. using Unity.Entities;
  10. using Svelto.Context;
  11. using Svelto.Tasks;
  12. using RobocraftX;
  13. using RobocraftX.SimulationModeState;
  14. using RobocraftX.UECS;
  15. using Unity.Transforms;
  16. using Unity.Mathematics;
  17. using UnityEngine;
  18. using GamecraftModdingAPI.Blocks;
  19. using GamecraftModdingAPI.Commands;
  20. namespace ExtraCommands.Building
  21. {
  22. //[CustomCommand("MoveBlocks", "Move all blocks (including ground) from their original position")]
  23. [CustomCommand("MoveLastBlock", "Move last block from original position")]
  24. class MoveBlocksCommandEngine : ICustomCommandEngine
  25. {
  26. public string Description => "Move blocks";
  27. public string Name => "MoveBlocks";
  28. public IEntitiesDB entitiesDB { set; private get; }
  29. public void Ready()
  30. {
  31. //CustomCommandUtility.Register<float, float, float>("MoveBlocks", MoveBlocksCommand, "Move all blocks (including ground) from their original position");
  32. CommandRegistrationHelper.Register<float, float, float>("MoveLastBlock", MoveLastBlockCommand, "Move last block from original position");
  33. }
  34. private void MoveLastBlockCommand(float x, float y, float z)
  35. {
  36. float3 vector = new float3(x, y, z);
  37. Movement.MoveConnectedBlocks(BlockIdentifiers.LatestBlockID, vector);
  38. }
  39. public void Dispose()
  40. {
  41. //CommandRegistrationHelper.Unregister("MoveBlocks");
  42. CommandRegistrationHelper.Unregister("MoveLastBlock");
  43. }
  44. }
  45. }