A Unified, Modern and Efficient Bukkit plugin framework

Related tags

Plugin LSPlugin
Overview

LSPlugin

! WARNING ! This project is still under development

DO NOT PUT INTO PRODUCTION ENVIRONMENT


一个专门为了 .DP7 群服务器 Charmless 的定制插件框架。未来Charmless的一切开发都将基于这个框架

996.icu LICENSE Respect

🏗️ 平民使用方法

开发中 敬请期待

🚀 超级有用的功能(对于开发者)

  • 高效率的API:
    • // 监听事件
      // 不使用 LSPlugin
      
      object SomeHandler : Listener {
          @EventHandler fun onPlayerChat(e: AsyncPlayerChatEvent) {
              println("${ChatColor.RED} Event triggered Obj: $e")
          }
      }
      Bukkit.server.pluginManager.registerEvents(SomeHandler)
      
      // 使用 LSPlugin
      listen<AsyncPlayerChatEvent> {
          println("${ChatColor.RED} Event triggered Obj: $e")
      }
  • 🏗️ 方便的底层管理 | 先进的 Kotlin DSL 设计
    • // 不使用 LSPlugin
      object For1_16 {
          fun doSomething(p: Player) {
              doSomeStuffFor1_16Only()
              val someStuff = (p as CraftPlayer).handle.b
              // ...
          }
      }
      
      object For1_17 {
          fun doSomething(p: Player) {
              val someStuff = (p as CraftPlayer).handle.c
              // ...
          }
      }
      
      //使用 LSPlugin
      
      fun doSomething(p: Player) {
          val someStuff = nms(p.asNMSPlayer) { // this -> NMSOperation
              version("1.16") {
                  doSomeStuffFor1_16Only()
              }
      
              universal {
                  memberMapping {
                       field("playerConnection") {
                           on("1.16.*", implmentation = Implementations.Spigot) {
                               "b"
                           }
      
                          on("1.17.*", implmentation = Implementations.Spigot) {
                               "c"
                           }
                       }
                  }
              }
      
              fallback {
                  // Do something
              }
          }.get("it.playerConnection") // 自动根据版本判断字段名字
         //.call("it.playerConnection.disconnect()", "Disconnected")
      }
      
      // 担心运行时表达式解析效率?没关系,我们提供了提前准备的方案!
      
      val nmsAccess = nms(p.asNMSPlayer, prepared = true) {
          // ...
      }
      
      val getSomeField = nmsAccess.get("it.playerConnection") // 因为初始化nms操作时 prepared = true
                                                              // 因此这里返回的是 PreparedNMSGet
      // 真正获取
      val field = getSomeField.fetch()
      // 调用: callSomeFun.invoke(arg1, arg2)
  • 🕛 便捷的多线程调用,完美避开无法正确判断类型问题
    • // 不使用 LSPlugin
      Bukkit.getScheduler().runTask(YourPlugin.instance) {} // 错误!Lambda表达式无法正确判断类型
      Bukkit.getScheduler().runTask(YourPlugin.instance, Runnable { }) // 需要手动标注类型
      
      // 使用 LSPlugin
      
      sync { // 自动以LSPlugin的身份执行task
        // ...
      }
      

更多的例子就不展示了,相信各位开发者看到这里应该能感觉这个API很方便

但很可惜,这个API目前还在开发中,尽情期待

🏗️ 贡献代码

统一的规范正在编制中,尽情期待

You might also like...
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.

ADB Idea A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development. The following commands are provided: Uninst

Maven Plugin for Android Application development and more

ANDROID MAVEN PLUGIN A plugin for Android application development with Apache Maven 3.0.5+ and the Android SDK. Please check out our website for furth

 Gradle plugin which downloads and manages your Android SDK.
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

CKlib is a gradle plugin that will build and package C/C++/Objective-C code for Kotlin/Native.

C Klib CKlib is a gradle plugin that will build and package C/C++/Objective-C code for Kotlin/Native. The Problem When you want to access C-etc code f

This is an android studio plugin that allows you to creates new color in hex format based on a percentage (0-100) and a base color you specify.

alpha-color Description This is an android studio plugin that allows you to creates new color in hex format based on a percentage (0-100) and a base c

 🌏 Android/IDEA localization plugin. supports multiple languages and multiple translators.
🌏 Android/IDEA localization plugin. supports multiple languages and multiple translators.

English | 简体中文 AndroidLocalizePlugin 🌏 Android/IDEA localization plugin. supports multiple languages and multiple translators. Features Multiple tran

An IntelliJ plugin for x86 and x86_64 AT&T assembly (for GNU as)

asms An IntelliJ plugin for x86 and x86_64 AT&T assembly (for GNU as). Motivation Contrary to popular belief, assembly is still taught in universities

A gradle plugin to optimize built jars through individual file optimizations and increased compression

Machete Machete is a gradle plugin that attempts to optimize the size of output JARs through both individual file optimizations and overall compressio

Owner
DP7 Network Works
DP7 Network @ GitHub.
DP7 Network Works
This plugin helps tp build GraphQL applications in Java using the DGS framework

dgs-intellij-plugin This plugin helps tp build GraphQL applications in Java using the DGS framework. The DGS Framework is open sourced by Netflix and

Netflix, Inc. 16 Nov 3, 2022
Entity Framework Core UI plugin for JetBrains Rider

Entity Framework Core UI plugin for JetBrains Rider This plugin introduces Entity Framework Core commands' UI inside JetBrains Rider. Features There a

Andrew Rublyov 125 Jan 2, 2023
gradle-android-scala-plugin adds scala language support to official gradle android plugin

gradle-android-scala-plugin gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at htt

saturday06 345 Dec 10, 2022
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

Shinnosuke Kugimiya 315 Aug 8, 2022
IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea

IntelliJ Idea Astor Plugin IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea. It communicates with a local/remote program

null 4 Aug 28, 2021
Intellij-platform-plugin-template - IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template TL;DR: Click the Use this template button and

null 0 Jan 1, 2022
BuildPlots-Plugin - PaperMC-Plugin for build contests written in Kotlin.

BuildPlotsPlugin PaperMC-Plugin for build contests. This is my first time using Kotlin and the first plugin I've written after a long time. It is stil

Lukas Heinzl 0 Jan 1, 2022
K6-intellij-plugin - IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your IntelliJ IDE

IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your Intel

Mikhail Bolotov 8 Jan 2, 2023
Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

null 4 Dec 15, 2022
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

null 3.9k Dec 30, 2022