• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

TabooLib/taboolib: Powerful framework for creating multi-platform Minecraft plug ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

TabooLib/taboolib

开源软件地址(OpenSource Url):

https://github.com/TabooLib/taboolib

开源编程语言(OpenSource Language):

Kotlin 50.3%

开源软件介绍(OpenSource Introduction):

TabooLib Framework

[中文版本/Chinese Ver.]

TabooLib is a multi-platform plugin development framework for Minecraft Java Version. However, TabooLib itself is neither a platform nor a runtime environment for plugins, but a tool designed to help developers speed up development on various platforms, replacing some frequently used or relatively complex operations, as well as solving some painful problems.

  • TabooLib started out for Bukkit, but now is developing horizontally.
  • TabooLib is offered under the MIT License, which is a loose open source license.
  • Development speed comes first

Along with the 6.0 update, we focused more on security and stability. The hot-loading system which was problematic in the previous version has been abandoned. While it significantly reduced the size of plugins and introduced a centralized plugin manager, with the advent of updates to Minecraft and a multitude of derivatives of Spigot, this has become troublesome. So it was a foregone conclusion that a huge update to v6.0 was in order, in which we carefully redesigned every single component of TabooLib.

Most TabooLib-based plugins are supposed to work across multiple Minecraft versions without special updates. i.e. in most cases, server owners would not need to be concerned about incompatibility of plugins. Even with extensive use of nms code, TabooLib provides several magical tools.

Simpler, for example you can quickly register commands using the method provided in TabooLib.

command("tpuuid") {
    literal("random") {
        execute<ProxyPlayer> { player, _, _ ->
            player.teleport(player.entities().randomOrNull() ?: return@execute)
        }
    }
    dynamic(optional = true) {
        suggestion<ProxyPlayer> { player, _ ->
            player.entities().map { it.toString() }
        }
        execute<ProxyPlayer> { player, _, argument ->
            player.teleport(UUID.fromString(argument))
        }
    }
    execute<ProxyPlayer> { player, _, _ ->
        player.teleport(player.entityNearly() ?: return@execute)
    }
}

For more complex ones, you are able to create your own multi-platform implementation like the following, where TabooLib will select the appropriate implementation class based on the platform currently running.

import org.bukkit.Bukkit
import org.bukkit.entity.Player
import taboolib.common.platform.*
import taboolib.platform.util.toBukkitLocation
import java.util.*

interface PlatformEntityHandler {

    fun entities(player: ProxyPlayer): List<UUID>

    fun entityNearly(player: ProxyPlayer): UUID?

    fun teleport(player: ProxyPlayer, uuid: UUID)

    @PlatformImplementation(Platform.BUKKIT)
    class BukkitSide : PlatformEntityHandler {

        override fun entities(player: ProxyPlayer): List<UUID> {
            return player.cast<Player>().world.entities.map { it.uniqueId }
        }

        override fun entityNearly(player: ProxyPlayer): UUID? {
            return player.cast<Player>().world.entities
                .filter { it != player.origin }
                .minByOrNull { it.location.distance(player.location.toBukkitLocation()) }?.uniqueId
        }

        override fun teleport(player: ProxyPlayer, uuid: UUID) {
            player.cast<Player>().teleport(Bukkit.getEntity(uuid) ?: return)
        }
    }
}

fun ProxyPlayer.entities(): List<UUID> {
    return implementations<PlatformEntityHandler>().entities(this)
}

fun ProxyPlayer.entityNearly(): UUID? {
    return implementations<PlatformEntityHandler>().entityNearly(this)
}

fun ProxyPlayer.teleport(uuid: UUID) {
    implementations<PlatformEntityHandler>().teleport(this, uuid)
}

There is no need to do so if your plugin is designed to work only on the Bukkit platform. Since the duty of TabooLib is to help developers get their development done as fast as possible, instead of creating pointless methods to increase the size of the repository.

Versions

Build Version Distribution Date Distributor Plugin Version

Modules

  • common: Core parts of TabooLib, the environment deployment and cross-platform interface
  • common-5: Some tools retained from TabooLib v5.0
  • module-ai: Manage and register custom entity AI (Pathfinder)
  • module-chat: Building Tools for Component (Json) Information & 1.16 RGB Color Transformations
  • module-configuration: Solutions for Configuration(Yaml & Toml & Hocon & Json)
  • module-configuration-legacy: YAML Interface Wrappers & Configuration Management Tools ( previous version, before v6.0.3)
  • module-database: Database Management Tools
  • module-database-mongodb: Database Management Tools(MongoDB)
  • module-effect: Particles Generation Utilities
  • module-kether: Build-in scripts (action statements) solutions
  • module-lang: Language File Utilities
  • module-metrics: Integration of bStats
  • module-navigation: Entity-less Pathfinding Utilities
  • module-nms: Multi-version NMS Solutions & Packet Management Tools
  • module-nms-util: Collection of Common NMS Tools
  • module-porticus: BungeeCord Communication Tools
  • module-ui: Chest Menu Builder
  • module-ui-receptacle: Chest Menu Builder Implemented with Packet
  • platform-bukkit: Bukkit Implementation
  • platform-bungee: BungeeCord Implementation
  • platform-nukkit: Nukkit Implementation
  • platform-sponge-api7: Sponge (api7) Implementation
  • platform-sponge-api8: Sponge (api8) Implementation
  • platform-sponge-api9: Sponge (api9) Implementation
  • platform-velocity: Velocity Implementation
  • platform-cloudnet-v3: CloudNet (v3) Implementation
  • platform-application: Standalone Application Implementation

Links




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
iLexiconn/LLibrary: The lightweight Minecraft modding library.发布时间:2022-08-16
下一篇:
noelbundick/minecraft-server发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap