A stable modding interface between Techblox and mods https://mod.exmods.org/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

31 行
806B

  1. using System;
  2. using System.Reflection;
  3. using Svelto.ECS;
  4. using HarmonyLib;
  5. using TechbloxModdingAPI.Blocks;
  6. namespace TechbloxModdingAPI.Inventory
  7. {
  8. [HarmonyPatch]
  9. class HotbarSlotSelectionHandlerEnginePatch
  10. {
  11. private static int selectedBlockInt = 0;
  12. public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; }
  13. private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquippedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int) });
  14. public static void Prefix(uint playerID, int selectedDBPartID)
  15. {
  16. selectedBlockInt = selectedDBPartID;
  17. }
  18. public static MethodBase TargetMethod(Harmony harmonyInstance)
  19. {
  20. return PatchedMethod;
  21. }
  22. }
  23. }