关于
这是作为我所有模组基础库使用的模组。如果您愿意,可以自由使用它。
库功能
- 包括锁定摄像机、覆盖层等在内的视觉效果 (VFX)
- 服务器端 GUI 纹理
- 服务器端粒子效果
- 隐藏 Boss 血条
- 自定义效果
- Ponder(思考/演示系统)
- 轻松创建配置
- 以及更多……
用法
在模组初始化时,请运行 Lib99j.ensureLoaded()。这将强制库在你的模组之前加载,从而确保所有功能正常工作。
build.gradle(版本号来自 Modrinth)
repositories {
maven { url = 'https://dj.ucc.asn.au/maven/' }
}
dependencies {
implementation include("com.daniel99j:djutil:1.1")
implementation include("com.daniel99j:lib99j:VERSION")
}
Ponder(服务器端)
这是对 Create 模组的 ponder 系统的重新实现,现已支持服务器端。请参阅 获取示例。
功能:
- 无需客户端模组
- 支持跳过、倒带和暂停
- 如果与 Polydex 或 Booklet 一起安装,点击一次即可打开 ponder
- 快速
- 不会改变玩家状态——服务器或客户端都不知道你正在 ponder,所有内容均在网络层面处理
- 完全自包含
- 无现实世界更改
- 兼容 Polymer 和服务器端模组(也包括客户端模组!)
控制键(游戏内 HUD 会显示这些按键):
- F:识别 - 飞行并查看你正对着的内容
- 空格:暂停/播放
- Q:退出
- L:打开菜单
- S:重新开始场景
- D:下一场景(如果可能)
- A:上一场景(如果可能)
- 滚轮:选择要跳过的步骤
- W:跳转到选中的步骤
命令:
/ponder all <id>
/ponder item <item>
/ponder item <item> scene <id>
/ponder item hand
/ponder item hand <id>
/ponder scene pause
/ponder scene unpause
/ponder scene exit
开发者命令:
/ponder dev ui_creator -> 打开 UI 编辑器。
/ponder dev ui_creator_from <ponder command> -> 运行指定的 ponder 命令后打开 UI 编辑器
/ponder dev toggle_free_movement -> 在 ponder 场景中切换自由移动模式
/ponder dev get_edits -> 列出在自由移动模式下对世界进行的所有交互
UI 编辑器:
- 染色玻璃显示安全区域
- 打开菜单 [L] 开始编辑
- 如果在客户端,在菜单中按住 Shift 可查看光标所在的 ponder UI 坐标,按 CTRL-C 复制
演示视频:
游戏属性
enableHideableBossbar()使黄色 Boss 血条变为白色,并使用BossBarVisibility可以使任何 Boss 血条不可见enableCustomEffectBadLuck()使“厄运”效果显示为“自定义效果 (/polymer effects)”并具有自定义精灵图enablePonder()启用 ponder(见上文)enableAddingAssetTranslationsToServer()使 assets 文件夹中的所有 lang 文件被视为 Nucleoid Server Translations API 中的服务器翻译
配置
- Lib99j 还提供易于使用的配置 API
- 支持按世界、通用、仅客户端和仅服务器的配置选项
- 可选的客户端同步
- 屏幕界面使用 cloth config
- 游戏内服务器端对话框重新创建 cloth config 界面 (
/lib99j config {modid}) - 支持 Mod Menu
- 通过 GSON 进行 JSON 序列化
- 在所有配置屏幕和配置文件中自动支持基本类型、标识符、vec2、vec3 和颜色
- 使用
ConfigManager.addConfig(modid, modconfig)添加配置。每个ModConfig包含每个上下文的可选ConfigHolder。只需提供一个配置类即可完成 - 使用
ServerConfigCopy.getConfigOption(modid, serializedName, optionClass, fallback)从服务器获取同步选项(选项必须使用sync = true注解)
示例配置类:
public class ExampleConfig {
@ConfigEntry
public boolean testBool = true;
@ConfigEntry(sync = true)
@SerializedName("wavy_ui")
public boolean wavyUi = false;
//对象基本类型也有效!
@ConfigEntry(min = 0, max = 10000)
public Integer explosionDamage = 10;
@ConfigEntry(displayType = ConfigDisplayType.SLIDER, max = 50, min = 0)
public int explosionSize = 10;
@ConfigEntry(displayType = ConfigDisplayType.COLOUR_PICKER)
public int worldTint = 0xff00ff;
@ConfigEntry(displayType = ConfigDisplayType.COLOUR_PICKER_ALPHA)
public int overlayColour = 0xff0000ff;
@ConfigEntry
public Identifier packId = Identifier.withDefaultNamespace("test");
@ConfigEntry
public Vec2 spawnRotation = Vec2.ZERO;
@ConfigEntry
public Vec3 spawnPos = Vec3.ZERO;
//ChatFormatting 是一个枚举
@ConfigEntry
public ChatFormatting formatType = ChatFormatting.RED;
}
模组安装状态
- 使用
ModInstallManager.syncInstalledStatus(modid)标记你的模组以同步其安装状态,然后使用ModInstallManager.isInstalled(modid, player)检查该模组是否在客户端上已安装
GUI 工具
- 默认情况下,Lib99j 生成范围为 -256 到 256 的字体空格范围(注意,当使用例如 space=270 时,它会组合使用 256 和 14!)。使用
GuiUtils.getSpace()及相关函数 GuiUtils.nextPage()、GuiUtils.previousPage()和GuiUtils.head()为玩家头像,可用于 GUIGuiUtils.doesPlayerHaveMods()允许你查看安装了哪些模组,阅读文档以获取更多信息GuiUtils.toast()显示带有自定义物品和文本的进度弹出窗口- 核心部分来了!
GuiUtils.generateTexture()和GuiUtils.generateColourableTexture()创建一个GuiElementBuilder,它具有自动生成物品模型和定义。纹理格式:"examplemod", "ui/test/image"。注意接受其他基本路径,但建议使用/ui/,因为其他函数专门使用此路径GuiUtils.generateBarTexture()创建一个从底部到顶部填充的垂直条形图,包含基底、填充和覆盖层。- BackgroundTextures 是一种基于库存的基本字体背景生成器,例如:
new BackgroundTexture(Identifier.fromNamespaceAndPath(MagmaNetworkMod.MOD_ID, "test/test_ui"), 176)。使用/ui/进行纹理引用。
视觉效果
-
VfxUtils.shake()会产生类似基岩版的摄像机抖动效果。 -
VfxUtils.addGenericScreenEffect()添加多种其他客户端效果,例如: -
RED_TINT- 红色世界边界色调 -
SNOW- 细雪覆盖层 -
FIRE- 顾名思义(火焰效果) -
NAUSEA- 你懂的(恶心效果)。 -
BLACK_HEARTS- 凋灵之心 -
GREEN_HEARTS- 中毒之心 -
GREEN_HUNGER- 饥饿之肋条呈绿色 -
BLINDNESS- 失明效果 -
NIGHT_VISION- 夜视效果 -
CONDUIT_POWER- 潮涌核心力量效果 -
DARKNESS- 监守者黑暗效果 -
LOCK_CAMERA_AND_POS- 较为复杂,下文将详细解释。 -
摄像机锁定
-
要锁定玩家的摄像机和移动,请添加
LOCK_CAMERA_AND_POS效果。 -
setCameraInterpolation、setCameraPos、setCameraPitch和setCameraYaw控制被锁定摄像机的各个方面。 -
由于技术原因,玩家无法看到快捷栏,游戏看起来处于旁观者模式。
-
registerCameraLockHandler为源 ID 注册一个摄像机锁定处理器,该处理器提供摄像机旋转和玩家数据。 -
杂项
-
VfxUtils.clientSideExplode()会在客户端产生爆炸并破坏方块(仅在客户端生效)。仅用于电影制作,因为“幽灵方块”存在 Bug。 -
VfxUtils.fireworkExplode()创建烟花爆炸效果,仿佛烟花实际生成一样。 -
VfxUtils.sendFakeEntity()发送一个客户端实体。请注意它永远不会正常移除,因此建议仅将其与闪电或其他会自动移除的实体一起使用。
粒子效果
正在开发中的功能,可能会导致严重的服务器卡顿。 待我有空时将进行重构。
杂项
PlayPacketUtils包含所有 PLAY 阶段数据包的列表。ConfigUtils包含一些基本的配置函数。GameProperties包含一些开关以及关于游戏的信息。
本项目与 Create Mod、Ponder 或任何类似的模组均无关联。
About
This is a mod used as a base for all my mods. Feel free to use it if you wish.
Library Features
- VFX including locking camera, overlays, and more
- Server-side gui textures
- Server-side particles
- Hide bossbars
- Custom effects
- Pondering
- Easy config creation
- And more...
Usage
On mod initialization, please run Lib99j.ensureLoaded(). This forces the library to load before yours, which allows all the features to work correctly
build.gradle (Version number from modrinth)
repositories {
maven { url = 'https://dj.ucc.asn.au/maven/' }
}
dependencies {
implementation include("com.daniel99j:djutil:1.1")
implementation include("com.daniel99j:lib99j:VERSION")
}
Ponder (Server-side)
This is a re-creation of Create Mod's ponder system, now server-side. See for an example.
Features:
- No client mods
- Skip, rewind, and pause
- If installed alongside Polydex or Booklet, click once to open a ponder
- Fast
- Does not change the player - neither the server or client know you are pondering, everything happens at the network level
- Fully self-contained
- No real-world changes
- Works with Polymer and server-side mods (and client ones too!)
Controls (in-game hud shows these):
- F: Identify - fly around and it will show what you are looking at
- SPACE: Pause/play
- Q: Exit
- L: Open menu
- S: Restart scene
- D: Next scene (if possible)
- A: Previous scene (if possible)
- SCROLL: Select step to skip to
- W: Skip to selected step
Commands:
/ponder all <id>
/ponder item <item>
/ponder item <item> scene <id>
/ponder item hand
/ponder item hand <id>
/ponder scene pause
/ponder scene unpause
/ponder scene exit
Dev commands:
/ponder dev ui_creator -> Opens the UI creator.
/ponder dev ui_creator_from <ponder command> -> Opens the UI creator after running the specified ponder command
/ponder dev toggle_free_movement -> Toggle free movement in a ponder scene
/ponder dev get_edits -> Lists all interactions made with the world in free move mode
UI creator:
- Stained glass shows safe area
- Open menu [L] to start editing
- If on the client hold shift in the menu to see what ponder ui coordinate the cursor is over, CTRL-C to copy
Demo video:
Game properties
- enableHideableBossbar() makes yellow bossbars white, and using BossBarVisibility you can make any bossbar invisible
- enableCustomEffectBadLuck() makes the unluck effect show as "Custom Effect (/polymer effects)" and have a custom sprite
- enablePonder() enables ponder (see above)
- enableAddingAssetTranslationsToServer() makes all lang files in the assets folder be treated as a server translation in Nucleoid Server Translations API
Configs
- Lib99j also provides an easy to use config api
- Per-world, common, client only, and server only configuration options
- Optional client syncing
- Uses cloth config for screen
- In-game server side dialog re-creation of cloth config (/lib99j config {modid})
- Mod menu support
- JSON serialization through GSON
- Supports primitives, identifiers, vec2, vec3, colours automatically in all config screens and config files
- Use ConfigManager.addConfig(modid, modconfig) to add configs. Each ModConfig contains a nullable ConfigHolder for each context. Just supply a config class and you're done
- Use ServerConfigCopy.getConfigOption(modid, serializedName, optionClass, fallback) to get a synced option from the server (option must be annotated with sync = true)
Example config class:
public class ExampleConfig {
@ConfigEntry
public boolean testBool = true;
@ConfigEntry(sync = true)
@SerializedName("wavy_ui")
public boolean wavyUi = false;
//Object primitives work too!
@ConfigEntry(min = 0, max = 10000)
public Integer explosionDamage = 10;
@ConfigEntry(displayType = ConfigDisplayType.SLIDER, max = 50, min = 0)
public int explosionSize = 10;
@ConfigEntry(displayType = ConfigDisplayType.COLOUR_PICKER)
public int worldTint = 0xff00ff;
@ConfigEntry(displayType = ConfigDisplayType.COLOUR_PICKER_ALPHA)
public int overlayColour = 0xff0000ff;
@ConfigEntry
public Identifier packId = Identifier.withDefaultNamespace("test");
@ConfigEntry
public Vec2 spawnRotation = Vec2.ZERO;
@ConfigEntry
public Vec3 spawnPos = Vec3.ZERO;
//ChatFormatting is an Enum
@ConfigEntry
public ChatFormatting formatType = ChatFormatting.RED;
}
Mod install status
- Use ModInstallManager.syncInstalledStatus(modid) to mark your mod to have its install status synced, then use ModInstallManager.isInstalled(modid, player) to check if the mod is installed on the client
Gui Utils
- By default, Lib99j generates a font space range of -256 to 256 (Note, when using eg, space=270, it uses a combo of 256 and 14!). Use GuiUtils.getSpace() and related functions
- GuiUtils.nextPage(), GuiUtils.previousPage(), and GuiUtils.head() create player heads for use in guis
- GuiUtils.doesPlayerHaveMods() allows you to see what mods are installed, read the documentation for more info
- GuiUtils.toast() displays an advancement popup with a custom item and text
- Now for the meat of it!
- GuiUtils.generateTexture() and GuiUtils.generateColourableTexture() creates a GuiElementBuilder that has an auto generated item model and definition. Texture format: "examplemod", "ui/test/image". Note that other base paths are accepted, but it is recommended to use /ui/ as other functions use this solely
- GuiUtils.generateBarTexture() creates a vertical bottom to top filling bar with a base, fill, and overlay.
- BackgroundTextures are a basic inventory-based font background generator, eg: new BackgroundTexture(Identifier.fromNamespaceAndPath(MagmaNetworkMod.MOD_ID, "test/test_ui"), 176). Uses /ui/ for texture references.
VFX
- VfxUtils.shake() causes a camerashake effect similar to bedrock edition
- VfxUtils.addGenericScreenEffect() adds many other client-side effect such as:
- RED_TINT - Red worldborder tint
- SNOW - Powder snow overlay
- FIRE - Self-explanatory
- NAUSEA - You get it.
- BLACK_HEARTS - Withered hearts
- GREEN_HEARTS - Poisoned hearts
- GREEN_HUNGER - Green hunger haunches
- BLINDNESS - The blindness effect
- NIGHT_VISION - The night vision effect
- CONDUIT_POWER - The conduit power effect
- DARKNESS - Warden darkness effect
- LOCK_CAMERA_AND_POS - More complicated, explained next.
- Camera Locking
- To lock the player's camera and movement, add the LOCK_CAMERA_AND_POS effect
- setCameraInterpolation, setCameraPos, setCameraPitch, and setCameraYaw control varius aspects of the locked camera
- Due to technical reasons, the player is unable to see the hotbar, and the game looks like it is in spectator mode
- registerCameraLockHandler registers a camera lock handler for a source id, which supplies camera rotation and player
- MISC
- VfxUtils.clientSideExplode() causes a client-side explosion destroying blocks (ONLY ON THE CLIENT). Use only for cinematics, as ghost blocks are buggy
- VfxUtils.fireworkExplode() creates a firework explosion as if a firework actually spawned
- VfxUtils.sendFakeEntity() sends a client side entity. Note it will never be removed normally, so it is only recommended to use this with lightning bolts or other entities that will be auto-removed
Particles
WORK IN PROGRESS FEATURE, may experience heavy server lag. Rework will happen soon when I have time.
Misc
- PlayPacketUtils contains a list of all PLAY packets
- ConfigUtils has some basic configuration functions
- GameProperties has some toggles and information about the game
This project has no affiliation with Create Mod, Ponder, or any similar mods.
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lib99j
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
26.1!
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
评论 0
登录后参与评分
还没有评论,来抢沙发吧