末影箱限制器
Ender Chest Restrictor 是一个小型 Fabric 模组,用于防止可配置的物品被存入末影箱。
该限制具有递归性,这意味着如果物品被放置在潜影盒、线束包或任何嵌套容器的组合中,它也会被阻止存放。
被阻止的物品并未被禁止。它们仍然可以正常使用、携带、掉落,并在普通容器和背包中正常存储,只是不能放入末影箱中。
功能特性
- 可配置的限制物品列表
- 对潜影盒和线束包内物品的递归检测
- 支持嵌套容器及容器组合
- 仅影响末影箱
- 服务器端强制执行
- 轻量级实现,使用针对库存和线束包交互的 Mixin
- 兼容原版与模组物品
配置
首次启动后,配置文件将生成于:
config/enderchestrestrictor.json
示例:
{
"blockedItems": [
"minecraft:dragon_egg",
"minecraft:nether_star"
]
}
添加任何有效的物品 ID,包括来自模组的物品。
配置更改需要重启服务器。
工作原理
末影箱的槽位通过服务器端的槽位验证逻辑拒绝受限物品。线束包特有的交互单独处理,以防止在末影箱交互期间将受限物品放入线束包中。
当检查物品时,会递归检查其自身类型以及支持的容器组件内的内容。
Ender Chest Restrictor
Ender Chest Restrictor is a small Fabric mod that prevents configurable items from being stored in Ender Chests.
The restriction applies recursively, meaning an item is also blocked if it is contained inside a Shulker Box, Bundle, or any combination of nested containers.
Blocked items are not banned. They can still be used, carried, dropped, and stored normally in regular inventories and containers, they simply cannot be placed into an Ender Chest.
Features
- Configurable list of restricted items
- Recursive detection of items inside Shulker Boxes and Bundles
- Supports nested containers and combinations of containers
- Affects Ender Chests only
- Server-side enforcement
- Lightweight implementation using targeted inventory and Bundle interaction mixins
- Compatible with vanilla and modded items
Configuration
After the first launch, a configuration file is generated at:
config/enderchestrestrictor.json
Example:
{
"blockedItems": [
"minecraft:dragon_egg",
"minecraft:nether_star"
]
}
Add any valid item ID, including items from mods.
Configuration changes require a server restart.
How It Works
Ender Chest slots reject restricted items through the server-side slot validation logic. Bundle-specific interactions are handled separately to prevent restricted items from entering a Bundle during an Ender Chest interaction.
When an item is checked, its own type and the contents of supported container components are inspected recursively.
评论 0
登录后参与评分
还没有评论,来抢沙发吧