Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

HyrKG/fastspigot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastSpigot介绍 / Introduction

Codacy Badge codebeat badge

image

FastSpigot是一个帮助进行快速插件开发的IoC/AoP框架。基于@Inject注释所展开的快捷开发系统。

目前提供服务 Provided Services

  • 快捷指令服务
  • 快捷配置服务
  • 快捷箱子界面(OOP)
  • 快捷的Forge界面基于信道的对接(OOP)
  • 简易的基于Mysql的锁
  • 内置Redis和Mysql
  • 各种各样的工具

该项目主要为学习用途,很多专业知识并不具备,若有错误请指出!

部分功能使用举例 / Before and After

嵌套管理器注入 Inject Handler

public class ExampleFastPlugin extends FastPlugin {

    @Inject
    public YourHandler yourHandler;
}

class YourHandler{

    @Inject 
    public OtherHandler otherHandler;
    
    @OnHandlerInit
    void onInit(){}
    
    @OnHandlerLoad
    void onLoad() {}
    }
    
.....and so on
}

LOG服务使用 Easy Log

public class YourHandler implements ILogService {
    
    @OnHandlerLoad
    public void onLoad() {
        info("该处理器已被加载!");
    }
}

指令服务使用 Easy Command

public class YourCommandHandler implements IFastCommandExecutor {
    @FastCommand(index = "test", desc = "测试指令")
    public void onTest(Player player, int number) {
        player.sendMessage("你输入了 " + number);
    }
}

快捷配置读取 Easy Config

public class YourCommandHandler  extends FastPluginConfig {
    @AutoLoad
    public static boolean you_want_to_load;
}