标签:craft str load module addm als return this void
首发于Enaium的个人博客
在cn.enaium.excel
下新建一个包module
在module
包里新建Module
、ModuleManager
这2个类 然后再新建一个Category
枚举
Module
内容
package cn.enaium.excel.module;
/**
* @Author Enaium
* @Date 2020/1/9 11:03
*/
public class Module {
private String name;
private Category category;
private boolean toggled;
public Module(String name,Category category) {
this.name = name;
this.category = category;
this.toggled = false;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public boolean isToggled() {
return toggled;
}
public void setToggled(boolean toggled) {
this.toggled = toggled;
}
}
ModuleManager
内容
package cn.enaium.excel.module;
import java.util.ArrayList;
/**
* @Author Enaium
* @Date 2020/1/9 11:03
*/
public class ModuleManager {
ArrayList<Module> modules;
public ModuleManager() {
modules = new ArrayList();
}
private void addModule(Module e) {
this.modules.add(e);
}
public void loadModules() {
}
}
Category
内容
package cn.enaium.excel.module;
/**
* @Author Enaium
* @Date 2020/1/9 11:03
*/
public enum Category {
COMBAT,MOVEMENT,RENDER,OTHER;
}
然后再Excel
里面添加Module
public enum Excel {
[...]
public ModuleManager moduleManager;
public void onEnable() {
[...]
moduleManager = new ModuleManager();
moduleManager.loadModules();
}
[...]
}
Minecraft Fabric Client 教程 #4 添加Modules
标签:craft str load module addm als return this void
原文地址:https://www.cnblogs.com/Enaium/p/12344580.html