BlockLimiter

[!INFO] Git Commit: efcb114 | Updated: 2026-09-28

BlockLimiter 是一个轻量的服务器端限制模组,根据方块/物品注册名和玩家所在维度,阻止玩家在特定维度放置或使用指定方块/物品。

  • modid: blocklimiter
  • 名称: BlockLimiter. Restrict your Blocks
  • 依赖: required-after:Forge@[10.13.2.1291,) + required-after:YAMCore@[0.13,)
  • 辅助库: eu.usrv.yamcore(提供 ConfigManager、ItemDescriptor、PlayerChatHelper、LogHelper、IntHelper)

源码结构:

包 类 角色
com.github.namikon.blocklimiter BlockLimiter @Mod 主类;preInit 加载配置,postInit 注册事件,serverLoad 注册指令
…auxiliary Reference、BlockInfo、ItemInfo 常量 + 数据封装
…config BlockLimiterConfig 继承 ConfigManager;PreInit/Init/PostInit 三段式加载 BlockList 与 ItemList
…events BlockPlaceEvent、ItemUseEvent 在 MinecraftForge.EVENT_BUS 上监听并取消违规操作
…command BlockLimiterCommand /blimit 指令

系统设定

  • 方块放置限制 - 在特定维度阻止玩家放置指定方块;BlockEvent.PlaceEvent 上 LOWEST 优先级拦截
  • 物品使用限制 - 在特定维度阻止玩家右键使用指定物品;PlayerInteractEvent 上 HIGHEST 优先级拦截
  • /blimit 指令 - 服务器指令 reload|blockinfo|iteminfo;reload 需 OP,重新加载配置
  • BlockLimiter 配置 - 配置文件结构与默认值;BlockList、ItemList、RejectMessages、ItemRejectMessages、PlaySFXOnBlockDeny、PlaySFXOnItemDeny、DenyCreativeMode