MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接

    已解决 插件之间的不正常调用

    开发交流
    2
    3
    354
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • Y
      Ycituss 最后由 编辑

      我用同样的指令结构和文件结构写了两个插件,我是用在两个不同的机器人上的,使用没有问题,但是放在同一个 Mirai Console里面,就会出现奇怪的问题。

      setu

      private PluginMain() {
              super(new JvmPluginDescriptionBuilder("com.ycitus.setu", "3.5.0")
                      .name("Setu")
                      .author("ycitus")
                      .build());
          }
      

      mcping

         private MinecraftPing() {
              super(new JvmPluginDescriptionBuilder("com.ycitus.MinecraftPing", "1.0-SNAPSHOT")
                      .name("MinecraftPing")
                      .author("Ycitus")
                      .build());
          }
      

      日志

      2021-09-08 16:38:49 I/MinecraftPing: MinecraftPing >> Enable.
      2021-09-08 16:38:49 I/MinecraftPing: Start Init...
      2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init FileSystem.
      2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init All Configs...
      2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init >> ApplicationConfig.json
      2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Load Local File to Memory >> ApplicationConfig.json
      2021-09-08 16:38:49 I/MinecraftPing: [CommandSystem] Init CommandSystem.
      2021-09-08 16:38:49 I/MinecraftPing: [TimerSystem] Start TimerSystem.
      2021-09-08 16:38:49 I/MinecraftPing: McPing End Init...
      2021-09-08 16:38:49 I/MinecraftPing: Setu >> Enable.
      2021-09-08 16:38:49 I/MinecraftPing: Start Init...
      2021-09-08 16:38:49 I/MinecraftPing: [FileSystem] Init FileSystem.
      2021-09-08 16:38:49 I/MinecraftPing: [CommandSystem] Init CommandSystem.
      2021-09-08 16:38:49 I/MinecraftPing: End Init...
      

      可以看到,写在setu的onEnable()函数里的输出显示输出插件为mcping
      同时setu插件的功能也无法正常使用,监听事件失效。

      有没有大佬知道是为什么

      1 条回复 最后回复 回复 引用 0
      • Karlatemp
        Karlatemp 最后由 编辑

        99%两个插件的主包名一样

        Y 1 条回复 最后回复 回复 引用 1
        • Y
          Ycituss @Karlatemp 最后由 编辑

          @karlatemp 原来是因为这个 萌新涨知识

          1 条回复 最后回复 回复 引用 0
          • 1 / 1
          • First post
            Last post
          Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact