用途:通过按方块类型禁用拾取,防止物品/方块的意外自动拾取(例如盆栽)。兼容服务器——更改以命令形式发送,因此在可用时尊重服务器的权限;客户端回退机制确保离线状态下 UI 响应灵敏。
主要特性:
图形界面:可通过“控制”菜单打开(可分配热键)——按本地化名称搜索方块并添加/移除条目。
本地化搜索:按显示名称(而非原始 ID)进行自动补全搜索,并显示方块图标以便轻松选择。
服务器兼容:客户端发送 /disablepickup 和 /enablepickup 命令,以便在支持的情况下由服务器强制执行拾取规则。
持久化:客户端列表在会话之间保持持久,以实现即时反馈和离线使用。
德语本地化:UI 字符串包含德语(以及英语)。
轻量模糊:GUI 后面的背景柔和模糊,同时保持图标和文字清晰(可在源代码中配置)。
使用方法
打开“控制”并将按键绑定到“Anti Pickup Settings”,或从客户端模组菜单打开 GUI。
在搜索框中输入内容(使用本地化名称,如 “Potted White Tulip”),选择一个建议项,然后点击“应用”。
使用模式按钮在禁用拾取或显式启用拾取之间切换。
在支持的服务器上,客户端将自动发送 /disablepickup namespace:block 或 /enablepickup namespace:block。
命令(客户端 → 服务器)
/disablepickup <block> — 指示服务器禁用该方块类型的拾取
/enablepickup <block> — 指示服务器重新启用该方块类型的拾取
兼容性与要求
平台:Fabric 模组(已在 Minecraft 1.21.4 上测试)。
运行时:Java 21(开发环境使用 Fabric Loom)。
注意:服务器端强制执行需要服务器接受模组的命令或运行相应的服务器组件;否则,客户端会为了方便起见回退到本地行为。
文件与故障排除
GUI 逻辑:AntiPickupConfigScreen.java
客户端网络通信:AntiPickupClientNetworking.java
本地配置:AntiPickupClientConfig(持久化列表)
如果您的系统上 GUI 看起来模糊,请尝试在 AntiPickupConfigScreen.java 中调整模糊强度(blurDownscale)。
许可证与鸣谢
Purpose: Prevent unwanted automatic pickup of items/blocks (e.g., potted plants) by disabling pickup per block type. Works with servers — changes are sent as commands so server authority is respected when available, and client fallback keeps the UI responsive offline.
Key Features:
GUI: Openable via the Controls menu (assign a hotkey) — search blocks by localized name and add/remove entries.
Localized Search: Autocomplete searches by display name (not raw IDs) and shows block icons for easy selection.
Server-Compatible: Client sends /disablepickup and /enablepickup commands so the server enforces pickup rules when supported.
Persistence: Client-side lists persist between sessions for instant feedback and offline use.
German Localization: UI strings are included in German (plus English).
Lightweight Blur: Background is softly blurred behind the GUI while keeping icons and text sharp (configurable in source).
How To Use
Open Controls and bind the key for “Anti Pickup Settings”, or open the GUI from the client mod menu.
Type into the search box (use localized names like “Potted White Tulip”), pick a suggestion, and click Apply.
Toggle between disabling pickups or explicitly enabling pickups using the mode button.
On servers that support it, the client will send /disablepickup namespace:blocknamespace:block or /enablepickup namespace:blocknamespace:block automatically.
Commands (client → server)
/disablepickup <block> — instructs server to disable pickup for that block type
/enablepickup <block> — instructs server to re-enable pickup for that block type
Compatibility & Requirements
Platform: Fabric mod (tested on Minecraft 1.21.4).
Runtime: Java 21 (development setup uses Fabric Loom).
Notes: Server-side enforcement requires the server to accept the mod’s commands or run the corresponding server component; otherwise the client falls back to local behavior for convenience.
Files & Troubleshooting
GUI logic: AntiPickupConfigScreen.java
Client networking: AntiPickupClientNetworking.java
Local config: AntiPickupClientConfig (persists lists)
If the GUI looks blurry on your system, try adjusting the blur strength in AntiPickupConfigScreen.java (blurDownscale).
License & Credits
评论 0
登录后参与评分
还没有评论,来抢沙发吧