Kube Utils
Kube Utils 是 KubeJS 的一个简易插件,为现有功能增添了新的特性,并衍生出全新的系统,从而编写出性能更高、更简洁明了的代码。
工作原理
Kube Utils(以下简称 Ku)的设计概念类似于清晰、简洁且一致的 API 设计。本模组添加的所有内容都包含在全局 Ku 对象中,因此如果你想访问层级相关的 API,需通过 Ku.Level 进行访问;如果你需要对流体进行操作,请使用 Ku.Fluids,以此类推。
功能特性
目前,我们仅提供了一些针对 KubeJS 支持较少领域的辅助工具,但计划在系统开发周期内大幅扩展这些功能。如果你有建议,请提交功能请求!
- 层级相关新增功能,例如:根据方块坐标获取结构、生成结构、查找实体与清理空间、获取带有边界框的随机位置等。
- 流体功能,允许你根据其命名空间列表获取流体列表,以及检查流体是否为空。
- 列表相关新增功能,例如:根据权重表获取随机条目。
- 通用实用工具,例如
nullOrEmpty,它提供了一种极其简单的方法,让你随时判断对象(无论是物品、方块、物品堆、字符串、流体还是物品实体)是否为空或不存在!(如有需要,将陆续增加更多支持)。 - 代码完全经过文档化。
- 经过生产环境验证。
- 清晰简单的 API。
我们的目标
- 除非绝对被迫由 Minecraft、Forge 或 Fabric 引起,否则我们绝不做出破坏性变更。当我们认为需要分叉版本并进行破坏性变更时,将以不影响现有代码的可选方式执行。
- 绝不使新增功能过于复杂。
- 始终用通俗英语记录所有新增功能的文档。
文档
免责声明
免责声明:在测试版期间,可能会出现导致代码失效的变更。一旦我们发布稳定版本,此消息将被移除,从此以后,代码将不再包含破坏性变更!
问题反馈
请将任何问题报告至 我们的问题追踪器,并附上示例代码,以便我们验证问题。
Kube Utils
Kube Utils is a simple addon to KubeJS which adds new functionality to existing features and branches off to create new systems that allow for more performant, simplified, and concise code.
How it works
Kube Utils (Ku from now on) has been designed with the concept of a clear, concise, and consistent API like design. Everything added by this mod is held within the global Ku object meaning if you want to access level apis, you will access it via Ku.Level, if you want to do something with fluids you will use Ku.Fluids etc.
Features
Currently, we only have a few helpers to some of the lesser supported areas of KubeJS but we plan to expand this greatly over the life cycle of the systems development. If you have any suggestions, please make a feature request!
- Level additions like being able to get structures at a block pos, ability to spawn structures, find entities and clear spaces, get a random location with a bounding box, etc.
- Fluids, allow you to get a list of fluids based on their namespace(s), and being able to check if a fluid is empty or not.
- List additions like getting random entries based on a weighted table
- The addition of general utilities like
nullOrEmptywhich gives you a very simply way to always know if an object is nullOrEmpty whether it's a item, block, itemstack, string, fluid or itemEntity! (more support to come as required) - Completely documented code
- Production validated
- Clear and simple API
Our goals
- We aim to never make breaking changes unless absolutely forced to by Minecraft, Forge or Fabric. At the point we feel we need to branch off and make breaking changes, it will be done in an optional way that will not affect existing code.
- Never to make the additions overly complex
- Always document the additions in plain English
Documentation
Disclaimer
Disclaimer, whist in beta, expect possible code breaking changes. Once we hit stable release, this message will be removed and from that point onwards, the code will not contain breaking changes!
Issues
Please report any issues to our issue tracker along with example code so we can validate the issues.
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
下载 Kube Utils
Kube Utils 更新日志
[21.1.3]
修复
ListKu.getRandomWeightedEntry在传入有效数据时不再出错
[21.1.2]
修复
- 与 KubeJS 7.2+ 相关的问题
[21.1.1]
新增
findFirstBlockTagWithinRadius:查找半径内具有特定方块标签的方块。findAnyEntitiesWithinRadius:根据实体类型查找半径内的任意实体。findLivingEntitiesWithinRadius:根据实体类型查找半径内的生物实体。
已弃用
findEntitiesWithinRadius,建议使用findLivingEntitiesWithinRadius替代
[21.1.0]
更改
- 感谢 @Saereth 更新至 1.21.1
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧