VillagerLobotimizer

插件

· 作者 mja00

一个用于让困在交易大厅中的村民“脑叶切除”的插件。非常适合希望在提升性能的同时不牺牲游戏体验的 SMP 服务器!

0 本站下载 0 关注 更新于 3 周前

最新 1.18.0-snapshot-9f43232 · 26.3 · Folia / Paper

一键开服(送7天)

image

VillagerLobotimizer

一款 Minecraft Paper 插件,通过在村民被限制在交易大厅时关闭其 AI 来提升服务器性能。

功能

  • 自动检测村民是否被困在交易大厅中
  • 禁用被困村民的 AI 以提升服务器性能
  • 在 AI 禁用期间保持村民的交易功能
  • 按照可配置的时间表自动刷新村民交易,并支持随机化
  • 特定职业的重购音效和升级庆祝音效
  • 优化的工作站点检测以提升性能
  • 夜间交易刷新功能
  • 允许通过命名来控制村民行为("nobrain"、"alwaysbrain")
  • 调试模式用于故障排除
  • 命令系统用于检查村民状态和管理插件

命令

  • /lobotomy info - 显示被“去脑”和活跃村民的统计数据
  • /lobotomy debug - 显示你正在注视的村民的详细信息
  • /lobotomy debug <entity> - 显示特定村民的详细信息
  • /lobotomy debug toggle - 切换调试模式
  • /lobotomy wake - 手动恢复你正在注视的村民的 AI
  • /lobotomy reload - 重新加载配置并对所有村民应用更改


注意:我不从这个链接获取任何收益。它完全非货币化。

配置

#Configuration version - DO NOT MODIFY MANUALLY
config-version: 4

#List of names that will always keep villagers active (case-insensitive)
always-active-names:
  - "alwaysbrain"

#Interval between trapped checks, in ticks, for active villagers
check-interval: 150

#Interval between trapped checks, in ticks, for inactive villagers
inactive-check-interval: 150

#Interval between villager trade restocks, in milliseconds
restock-interval: 540000

#Range (in milliseconds) before restock-interval to start random restock checks. If set to 0, restocking is not randomized. If equal to or greater than restock-interval, restock will always occur.
restock-random-range: 0

#Whether to only lobotomize villagers with jobs
only-lobotomize-villagers-with-professions: false

#Whether to only lobotomize villagers that have been traded at least once
only-lobotomize-villagers-with-experience: false

#Whether to lobotomize villagers in boats/minecarts. Does not apply to villagers riding on non-vehicle entities like horses.
always-lobotomize-villagers-in-vehicles: false

#Whether to make lobotomized villagers silent. When enabled, villagers will be muted when their AI is disabled.
silent-lobotomized-villagers: false

#The sound to play when a villager restocks. Leave empty ("") for default sounds.
#A list of sounds can be found at https://jd.papermc.io/paper/1.21.6/io/papermc/paper/registry/keys/SoundEventKeys.html
#Use the name found in the description column, e.g. "entity.villager.celebrate" for the sound played when a villager restocks.
restock-sound: ""

#The sound played when a villager is leveled up. Leave empty ("") for no sound.
level-up-sound: "entity.villager.celebrate"

#Debug mode. Prints debug messages to the console.
debug: false

#Chunk debug mode. Prints debug messages related to chunks
chunk-debug: false

#To ignore villagers stuck in doors, set this to true.
ignore-villagers-stuck-in-doors: false

#To not lobotomize villagers surrounded by non-solid blocks, set this to true.
ignore-non-solid-blocks: false

#To check if there is a roof above a villager before lobotomizing, set this to true
check-roof: true

#Create teams for debugging purposes. This will create colored teams for inactive and active villagers. We use this to color their glowing effect.
create-debug-teams: false

#Disable the update checker. You can disable this if you don't want to be notified about updates.
disable-update-checker: false

#Disable chunk forced Villager updating. This'll disable changes to blocks in a chunk from triggering Villagers in the chunk to be updated.
disable-chunk-villager-updates: false

#Prevent trading with unlobotomized villagers. When enabled, players can only trade with villagers that have been lobotomized.
prevent-trading-with-unlobotomized-villagers: false

#Persist lobotomized state across chunk unloads. When enabled, villagers that are lobotomized will remain lobotomized when their chunk is unloaded and reloaded.
#This prevents lag spikes from villagers needing to be re-evaluated and re-lobotomized after chunk loads.
persist-lobotomized-state: true

#Enable Sentry error tracking to help developers identify and fix bugs. See "Privacy & Telemetry" section below for details.
enable-sentry: true

特殊村民名称

  • 将村民命名为 "nobrain" 以强制使其始终处于“去脑”状态
  • 将村民命名为 "alwaysbrain" 以防止其被“去脑”(可在 always-active-names 中配置)

音效系统

该插件具备增强的音效系统:

  • 默认重购音效:当 restock-sound 留空时,村民将在重购时播放默认音效
  • 自定义音效:您可以通过在配置中指定自定义音效来覆盖默认音效
  • 音效参考:完整的声音列表可在 Paper API 文档 中找到
  • 升级庆祝:村民在提升交易等级时会播放庆祝音效

要求

  • Paper(或其分支)1.21.6+
  • Java Development Kit (JDK) 21(用于开发)

安装

  1. 从 Modrinth 或 Hangar 下载最新发行版
  2. 将 .jar 文件放入服务器的 plugins 文件夹中
  3. 重启服务器,或使用插件管理器加载该插件
  4. 如有需要,在 plugins/VillagerLobotimizer/config.yml 中配置插件设置

开发

前置要求

  • Java Development Kit (JDK) 21
  • Gradle(已包含包装器)

构建

  1. 克隆仓库

    git clone https://github.com/mja00/VillagerLobotimizer.git
    cd VillagerLobotimizer
    
  2. 构建插件

    ./gradlew build
    

    构建好的插件位于 build/libs/VillagerLobotimizer-<version>.jar

运行测试服务器

该项目使用 run-paper 插件来方便地测试更改:

./gradlew runServer

这将下载一个用于 Minecraft 1.21.5 的 Paper 服务器,并在安装该插件的情况下启动它。

发布

该项目使用 Hangar 进行发布:

./gradlew publishPluginPublicationToHangar

这需要设置 HANGAR_API_KEY 环境变量。插件将按以下方式发布:

  • 如果当前提交带有与项目版本匹配的标签,则发布为正式版本
  • 如果没有匹配的标签,则发布为快照版本

支持

如果遇到任何问题,请在 GitHub 上报告。

许可证

本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源