• 游客, 欢迎您来到九域资源社区,如果您是新人,请前往 论坛公告 板块查看新人引导教程 或者 点我打开
    如果您发现没有下载许可, 请先验证邮箱再进行下载;金锭可通过每日登陆或资源出售获取,目前没有其他渠道可获取。
资源图标

Bukkit FICore — 一些方便开发的API[全版本] 1.2.7-SNAPSHOT

没有下载权限
◆ 支持核心
CatServer,Spigot,PaperSpigot,Magma,Arclight
◆ 插件前置
Forge
FICore插件只需服务端有1.12.2/1.16.5的Forge即可,所以理论支持所有12 16的Forge端
其他Forge混合端请自己实验,该插件一定程度上可以自兼容


一、前言
该插件只为便于开发,如果你不是开发者,除非有插件需要依赖此插件,不然没必要下载


二、功能列表
工具:
  • Forge监听器注册
  • ListenerInvHolder实现内处理有关容器的事件
  • FileUtil文件工具
  • LangMsgUtil语言信息工具
事件:
  • ForgeEvent(直接利用'Forge监听器注册'监听了所有的eventbus事件)


三、功能使用方法
ListenerInvHolder内处理有关事件
继承该类后会有onOpen方法来处理打开事件,以此类推后面还有关闭,拖拽,点击

Forge监听器注册:
Java:
public class Example extends JavaPlugin {
    @Override
    public void onEnable() {
        //这个方法的最后一个参数,如果你的监听器方法是静态的则用class,非静态就直接给示例对象就行
        FICoreAPI.registerForgeListener(this,bus,Example.class)
    }

    /*
    注解需要看你版本使用对应的net.minecraftforge.fml.common.eventhandler.SubscribeEvent(1.12.2)
    */
    @SubscribeEvent
    public static void battleStart(BattleStartedEvent e){
        //你的处理代码
    }
}
ForgeEvent事件:
和CatServer的用法一样,instanceof判断一下

LangMsgUtil语言信息工具:
继承LangMsgUtil后super内传入自己的类和一个bukkit中yaml文件内获取道的节点把节点内需要的信息都写在自己的类里面(一定要一样的名字)之后开发过程中就可以把需要出来的信息直接用自己的类加上变量名字来获取了(用来防止打错路径而已);记得不要忘记实例化!

FileUtil文件工具:
传文件就好了,自己去看里面写的api说明

源码地址:https://github.com/FullIdle/FICore
作者
FullIdle
下载
458
查看
3,809
首次发布
最后更新
评分
4.67 星 3 星

来自FullIdle的更多资源

分享资源

最新更新

  1. 更新1.2.7-SNAPSHOT

    修复不支持Forge功能的端导致所有功能失效问题
  2. 更新1.2.6

    添加CraftItemStack,NBTTagCompound,ItemStack
  3. 1.2.5

    forgeEvent事件注入的判断分为12以上用16,其余用12

最新评论

关服报错
[20:33:58] [Server thread/INFO] [me.fullidle.ficore.ficore.Main]: [FICore] Disabling FICore v1.2.7-SNAPSHOT
[20:33:58] [Server thread/ERROR] [Minecraft]: Could not pass event PluginDisableEvent to FICore v1.2.7-SNAPSHOT
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[forge:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:593) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:578) ~[forge:?]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:370) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:504) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:496) ~[forge:?]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.disablePlugins(CraftServer.java:344) ~[forge:1.16.5-1c92118f]
at net.minecraft.server.MinecraftServer.func_71260_j(MinecraftServer.java:649) ~[?:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71260_j(DedicatedServer.java:595) ~[?:?]
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:818) ~[?:?]
at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:265) ~[?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class net.minecraftforge.eventbus.api.IEventListener (java.util.ArrayList is in module java.base of loader 'bootstrap'; net.minecraftforge.eventbus.api.IEventListener is in unnamed module of loader 'app')
at me.fullidle.ficore.ficore.v1_16.V1_16.unregisterAllListener(V1_16.java:73) ~[?:?]
at me.fullidle.ficore.ficore.listener.PluginListener.pluginDisable(PluginListener.java:13) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor555.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[forge:?]
... 12 more
[20:33:58] [Server thread/ERROR] [Minecraft]: Error occurred while disabling FICore v1.2.7-SNAPSHOT (Is it up to date?)
java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class net.minecraftforge.eventbus.api.IEventListener (java.util.ArrayList is in module java.base of loader 'bootstrap'; net.minecraftforge.eventbus.api.IEventListener is in unnamed module of loader 'app')
at me.fullidle.ficore.ficore.v1_16.V1_16.unregisterAllListener(V1_16.java:73) ~[?:?]
at me.fullidle.ficore.ficore.Main.onDisable(Main.java:38) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:265) ~[forge:?]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:376) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:504) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:496) ~[forge:?]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.disablePlugins(CraftServer.java:344) ~[forge:1.16.5-1c92118f]
at net.minecraft.server.MinecraftServer.func_71260_j(MinecraftServer.java:649) ~[?:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71260_j(DedicatedServer.java:595) ~[?:?]
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:818) ~[?:?]
at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:265) ~[?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
FullIdle
FullIdle
高版本一直都会报
1.16.5 cat端这报错啥意思啊
Could not pass event PluginDisableEvent to FICore v1.2.7-SNAPSHOT
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[forge:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:593) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:578) ~[forge:?]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:370) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:504) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:496) ~[forge:?]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.disablePlugins(CraftServer.java:344) ~[forge:1.16.5-98eabb0e]
at net.minecraft.server.MinecraftServer.func_71260_j(MinecraftServer.java:649) ~[?:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71260_j(DedicatedServer.java:595) ~[?:?]
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:818) ~[?:?]
at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:265) ~[?:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_381]
Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to net.minecraftforge.eventbus.api.IEventListener
at me.fullidle.ficore.ficore.v1_16.V1_16.unregisterAllListener(V1_16.java:73) ~[?:?]
at me.fullidle.ficore.ficore.listener.PluginListener.pluginDisable(PluginListener.java:13) ~[?:?]
at sun.reflect.GeneratedMethodAccessor233.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_381]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_381]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[forge:?]
... 12 more
为什么获取版本号写在SomeMethod类,一开始还找不到.
FullIdle
FullIdle
自己回答自己有点傻逼,不过我就要回答一下