Coder Social home page Coder Social logo

messagesync's Introduction

MessageSync 多功能插件

不仅仅是消息同步插件

概述

  • 起源:帖子 这个插件其实是我学习Spigot插件写的,所有很多地方写的不好
    由于功能越写越多,所以该插件目前的功能已经不仅仅是消息同步了
  • 版本:我也不知道兼容哪个版本,测试兼容spigot-1.19.3

使用

相关视频教程:【MC服务器消息同步 - 小猪比机器人】
填写配置,位于./plugins/MessageSync/config.yml
注释都很详细,全中文,看着填就行

已知问题

可能会与以下插件发生冲突:

  • 其他的登录插件例如AuthMe
  • SkinsRestorer
  • TitleManager-2.3.1 预计加入TitleManager以实现并替代tm的功能

开发

  • 日志
    引入主类import center.xzy.qb.messagesync.Main;,然后使用Main.instance.getLogger()就可以获取到logger
  • event事件监听
    位于center.xzy.qb.messagesync.event包,customEventHandler是消息上报的监听器类,所有event操作都应该在event包中,在主类中定义监听器
  • commands指令
    位于center.xzy.qb.messagesync.commands.impl包中。
    • 创建指令:每一个指令都是一个类,继承自commands包中的ICommand,需要调用super(插件名, 参数, 描述)方法初始化插件
    • 注册指令:在executor.CommandHandler中的initHandler方法中添加registerCommand(new 指令类名());即可
    • 指令使用:在指令类的onCommand(CommandSender sender, String[] args)方法中写具体逻辑,在permission方法返回使用指令的权限组
    • 好处:使用/ms 指令名[ 参数]即可使用指令,有TAB自动补全
  • scheduler定时任务 位于center.xzy.qb.messagesync.scheduler
  • sqlite数据库 直接调用Main.dbConn就能获得数据库连接,使用Main.dbConn.createStatement()创建Statement对象。
    您无需dbConn.close(),因为插件onDisable时会自动关闭数据库连接

messagesync's People

Contributors

gingmzmzx avatar xiaohuihui1022 avatar

Stargazers

YouM avatar NiuFuyu avatar  avatar  avatar

Watchers

 avatar

Forkers

xiaohuihui1022

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.