FarmControl 允许你限制并管理服务器上某些方面下的怪物农场。
功能
- 限制服务器上怪物农场的大小。
- 减少怪物农场内不必要的碰撞和移动。
- 根据农场大小或服务器性能,禁用农场中怪物的感知或 AI。
- 高度可配置——允许你根据需求自定义插件。
- 低影响——插件的大部分处理工作都在异步执行。
安装
要安装该插件,只需将下载的 jar 文件放入你的插件目录即可。
请务必通过查看 config.yml 和 profiles.yml 来配置插件,这两个文件都位于插件目录中 FarmControl 文件夹下。默认情况下,插件仅会移除动物农场中怪物的随机移动能力并禁用其碰撞体积。
配置
此插件有许多可配置项
config.yml
# FarmControl 的配置。
# 插件页面:https://www.spigotmc.org/resources/86923/
# GitHub:https://github.com/froobynooby/FarmControl
# 请不要更改此项!
version: 7
# 每隔多少刻我们应该运行一次配置文件检查 / 动作周期?
cycle-period: 600
# 在插件启动后,我们应等待多少刻才开始执行检查任务?
# * 这在“响应式”模式下很有用,因为在重启后的最初几分钟内,希望忽略服务器的性能状况。
start-up-delay: 0
# 这些设置可以针对每个世界进行指定。
# * 注意:如果未指定某个世界或某项设置缺失,它将使用 default(默认)部分下列出的设置。
world-settings:
default:
# 我们应该运行哪些配置文件(如在 profiles.yml 中给出的)?
profiles:
# 这些配置文件会持续运行。
proactive:
- soft-nerf-animal-farms
# - soft-limit-animal-farms
# - soft-limit-villager-breeders
# - trim-animal-farms
# - trim-sparse-animal-farms
# 这些配置文件仅在服务器性能不佳时运行,并随着性能改善(如 reactive-mode-settings 下所定义的那样)逐步撤销操作。
# * 注意:通常最好确保服务器性能本身不会下降,而不是试图缓解它。话虽如此,这种模式也有一些合理的使用场景,例如
# 允许玩家保留更大的农场,但代价是在性能开始下降时削弱它们。
reactive:
# - hard-nerf-animal-farms
# - freeze-animal-farms
# 这些设置涉及触发配置文件检查 / 动作周期的响应式模式。
reactive-mode-settings:
# 超过多少 MSPT(每刻毫秒数)时应触发响应式模式?
trigger-mspt-threshold: 45.0
# 低于多少 MSPT 时应取消触发响应式模式,并撤销操作?
untrigger-mspt-threshold: 35.0
# 这些设置涉及一旦响应式模式被取消触发,插件应如何处理对怪物执行的操作的撤销。
untrigger-settings:
# 在撤销任何操作之前,需要经历多少个响应式模式已取消触发的周期?
minimum-cycles-before-undo: 10
# 每个周期最多应撤销多少怪物的操作?
maximum-undos-per-cycle: 40
# 一个实体应对 maximum-undos-per-cycle 限制贡献多少权重?
# * 例如,如果 maximum-undos-per-cycle 为 40,且村民的 entity-undo-weight 为 5,则最多可以有 8 名村民
# 被撤销操作(因为 5 * 8 = 40)。
# * 如果未指定实体类型,则将使用 default(默认)下的值。
entity-undo-weight:
default: 1
villager: 5
# 这些设置涉及何时应将某个怪物排除在操作之外。
exclusion-settings:
# 我们是否不应对被驯服的怪物执行操作?
tamed: true
# 我们是否不应对被命名的怪物执行操作?
named: true
# 我们是否不应处于繁殖模式的怪物(繁殖动物)上执行操作?
love-mode: true
# 我们是否不应对被拴绳的怪物执行操作?
leashed: true
# 我们是否不应巡逻队长执行操作?
patrol-leader: false
# 我们是否不应年龄小于此值(以刻为单位)的怪物执行操作?
younger-than: 0
# 我们不应对其执行操作的怪物类型有哪些?
type:
# - villager
# 对于哪些元数据,我们不应对其拥有该元数据的怪物执行操作?
# * 某些插件会为它们生成或使用的怪物添加元数据。此设置允许你将那些怪物
# 从本插件执行的操作中排除出去。
metadata:
- Elitemob # EliteMobs 插件中的精英怪物。
- Elitemobs_NPC # EliteMobs 插件中的 NPC。
- Supermob # EliteMobs 插件中的超级怪物。
- infernalMetadata # InfernalMobs 插件中的地狱怪物。
- NPC # Citizens 插件中的 NPC。
- shopkeeper # Shopkeepers 插件中的店主。
# 这些设置涉及操作的属性。
action-settings:
# 这些设置涉及何时应撤销操作,并且可以针对每个操作进行指定。
# * 注意:如果未指定某个操作,或者某个选项为空,则将使用 default(默认)部分下列出的设置。
undo-on:
default:
# 当与怪物交互时,我们是否应撤销此操作?
interact: false
# 当怪物受到伤害时,我们是否应撤销此操作?
damage: false
# 当怪物被另一个实体瞄准时(例如僵尸瞄准村民),我们是否应撤销此操作?
target: false
# 当生物被玩家诱惑时(例如,手持小麦的奶牛被玩家诱惑),我们是否应该撤销此操作?
tempt: false
remove-ai:
interact: true
damage: true
target: true
remove-awareness:
interact: true
damage: true
target: true
disable-collisions:
tempt: true
disable-breeding:
# 你必须与动物互动才能使其繁殖,因此在交互时永远不要撤销此操作。
interact: false
# 手持使动物繁殖所需的食物会诱惑它,因此在被诱惑时永远不要撤销此操作。
tempt: false
# 这些设置涉及我们如何确定服务器的 MSPT。
mspt-tracker-settings:
# 在计算 MSPT 时,我们应该收集多少个刻的持续时间?
# * 设置过高会导致 MSPT 对变化的反应非常缓慢。
# * 设置过低会导致 MSPT 不稳定。
collection-period: 1200
profiles.yml
# 请访问 https://github.com/froobynooby/FarmControl/wiki/Profiles 以获取有关创建配置文件的帮助。
profiles:
# 移除农场中动物的随机移动并禁用碰撞
soft-nerf-animal-farms:
group:
types:
- "category:animal"
count: 15
distance: 5
actions:
- remove-random-movement
- disable-collisions
# 移除农场中动物的感知能力
hard-nerf-animal-farms:
group:
types:
- "category:animal"
count: 15
distance: 5
actions:
- remove-awareness
- disable-collisions
# 移除农场中动物的 AI
freeze-animal-farms:
group:
types:
- "category:animal"
count: 15
distance: 5
actions:
- remove-ai
- disable-collisions
# 禁用包含 20 只或以上同类型动物的农场中的繁殖
soft-limit-animal-farms:
group:
types:
- "category:animal"
count: 20
distance: 5
pure: true
actions:
- disable-breeding
# 禁用包含 20 名或以上村民的农场中的繁殖
soft-limit-villager-breeders:
group:
types:
- "villager"
count: 20
distance: 10
actions:
- disable-breeding
# 近距离范围内同类型动物不超过 20 只
trim-animal-farms:
group:
types:
- "category:animal"
count: 21
distance: 5
pure: true
actions:
- kill
# 稀疏分布的同类型动物不超过 50 只(彼此间距在 160 格以内)
trim-sparse-animal-farms:
group:
types:
- "category:animal"
count: 51
distance: 160
pure: true
actions:
- kill
# 每个区块内的村民不超过 10 名
trim-villager-chunks:
group:
types:
- "villager"
count: 11
distance: same-chunk
actions:
- kill
如需有关创建配置文件的帮助,请访问 wiki。
命令
要执行命令 /farmcontrol <subcommand>,用户需要权限 farmcontrol.command.<subcommand>。
/farmcontrol reload - 重新加载插件的配置。
/farmcontrol status <world> - 显示指定世界的状态。
/farmcontrol history - 显示插件在最近时间内执行的操作。
/farmcontrol notify - 切换来自插件的通知。
指标
此插件使用 bStats 收集运行该插件的服务器的一些(非识别性)数据。您可以通过编辑位于服务器插件目录中 bStats 文件夹内的 config.yml 来选择不加入统计。
FarmControl allows you to limit and govern certain aspects of mob farms on your server.
Features
- Limit the size of mob farms on your server.
- Reduce unnecessary collisions and movement within mob farms.
- Disable the awareness or AI of mobs in farms in response to the size of the farm or the server's performance.
- Highly configurable - allowing you to tailor the plugin to your needs.
- Low impact - with the brunt of the plugin's processing performed asynchronously.
Installation
To install the plugin, simply place the downloaded jar into your plugin directory.
Be sure to configure the plugin by looking through its config.yml and profiles.yml, both located in the FarmControl folder of your plugin directory. By default, the plugin will only remove the random movement capabilities of and disable collisions for mobs in animal farms.
Configuration
There is much to configure with this plugin
config.yml
# Configuration for FarmControl.
# Plugin page: https://www.spigotmc.org/resources/86923/
# GitHub: https://github.com/froobynooby/FarmControl
# Please don't change this!
version: 7
# Every how many ticks should we run the profile check / action cycle?
cycle-period: 600
# How long in ticks should we wait before starting the checking tasks following the plugin's start up?
# * This is useful when using the 'reactive' mode where it is desirable to ignore the server's performance in the first
# few minutes following a restart.
start-up-delay: 0
# These settings can be specified per world.
# * Note: If a world is not specified or if a setting is missing, it will use the settings listed under the default
# section.
world-settings:
default:
# Which profiles (as given in profiles.yml) should we run?
profiles:
# These profiles are constantly run.
proactive:
- soft-nerf-animal-farms
# - soft-limit-animal-farms
# - soft-limit-villager-breeders
# - trim-animal-farms
# - trim-sparse-animal-farms
# These profiles only run when the server is performing poorly and are progressively undone as performance
# improves (as defined under the reactive-mode-settings).
# * Note: It is generally preferable to ensure your server's performance doesn't degrade in the first place,
# rather than try to mitigate it. That said, there are some reasonable use cases for this mode, such as
# allowing your players to keep larger farms at the cost of nerfing them when performance begins to degrade.
reactive:
# - hard-nerf-animal-farms
# - freeze-animal-farms
# These settings concern the reactive mode for triggering profile check / action cycles.
reactive-mode-settings:
# Above what MSPT should the reactive mode be triggered?
trigger-mspt-threshold: 45.0
# Below what MSPT should the reactive mode be untriggered, and actions undone?
untrigger-mspt-threshold: 35.0
# These settings concern how the plugin should handle undoing actions performed on mobs once the reactive mode has
# been untriggered.
untrigger-settings:
# How many cycles of the reactive mode being untriggered should have to pass before any actions are undone?
minimum-cycles-before-undo: 10
# At most how many mobs should have their actions undone per cycle?
maximum-undos-per-cycle: 40
# How much should an entity contribute to the maximum-undos-per-cycle limit?
# * For example, if maximum-undos-per-cycle was 40 and the entity-undo-weight for villagers was 5, at most 8
# villagers could have their actions undone (since 5 * 8 = 40).
# * If an entity type is not specified, the value under default will be used.
entity-undo-weight:
default: 1
villager: 5
# These settings concern when we should exclude a mob from having actions applied to them.
exclusion-settings:
# Should we not perform actions on tamed mobs?
tamed: true
# Should we not perform actions on named mobs?
named: true
# Should we not perform actions on mobs in love-mode (breeding animals)?
love-mode: true
# Should we not perform actions on mobs that are leashed?
leashed: true
# Should we not perform actions on patrol leaders?
patrol-leader: false
# Should we not perform actions on mobs that are younger than this value (in ticks)?
younger-than: 0
# Which types of mobs should we not perform actions on?
type:
# - villager
# For which metadata should we not perform actions on a mob?
# * Some plugins will add metadata to mobs that they spawn or use. This setting allows you to exclude those mobs
# from having actions performed on them by this plugin.
metadata:
- Elitemob # Elite mobs from the plugin EliteMobs.
- Elitemobs_NPC # NPCs from the plugin EliteMobs.
- Supermob # Super mobs from the plugin EliteMobs.
- infernalMetadata # Infernal mobs from the plugin InfernalMobs.
- NPC # NPCs from the plugin Citizens.
- shopkeeper # Shopkeepers from the plugin Shopkeepers.
# These settings concern properties of actions.
action-settings:
# These settings concern when an action should be undone, and can be specified per action.
# * Note: If an action is not specified, or if an option is blank, the settings listed under default will be
# used.
undo-on:
default:
# Should we undo this action when the mob is interacted with?
interact: false
# Should we undo this action when the mob is damaged?
damage: false
# Should we undo this action when the mob is targeted by another entity (e.g. a zombie targeting a villager)?
target: false
# Should we undo this action when the mob is tempted by a player (e.g. a cow tempted a player holding wheat)?
tempt: false
remove-ai:
interact: true
damage: true
target: true
remove-awareness:
interact: true
damage: true
target: true
disable-collisions:
tempt: true
disable-breeding:
# You have to interact with an animal to breed it, so never undo this action on interact.
interact: false
# Holding the food required to breed an animal will tempt it, so never undo this action on tempt.
tempt: false
# These settings concern how we determine the server's MSPT.
mspt-tracker-settings:
# Over how many ticks should we collect tick durations for calculating the MSPT?
# * Setting this too high will make the MSPT very slow to react to changes.
# * Setting this too low will make the MSPT volatile.
collection-period: 1200
profiles.yml
# Please visit https://github.com/froobynooby/FarmControl/wiki/Profiles for help with making profiles.
profiles:
# Remove random movements and disable collisions of mobs in animal farms
soft-nerf-animal-farms:
group:
types:
- "category:animal"
count: 15
distance: 5
actions:
- remove-random-movement
- disable-collisions
# Remove the awareness of mobs in animal farms
hard-nerf-animal-farms:
group:
types:
- "category:animal"
count: 15
distance: 5
actions:
- remove-awareness
- disable-collisions
# Remove the AI of mobs in animal farms
freeze-animal-farms:
group:
types:
- "category:animal"
count: 15
distance: 5
actions:
- remove-ai
- disable-collisions
# Disable breeding in farms containing 20 or more animals of the same type
soft-limit-animal-farms:
group:
types:
- "category:animal"
count: 20
distance: 5
pure: true
actions:
- disable-breeding
# Disable breeding in villager farms containing 20 or more villagers
soft-limit-villager-breeders:
group:
types:
- "villager"
count: 20
distance: 10
actions:
- disable-breeding
# No more than 20 animals (all of the same type) within close proximity
trim-animal-farms:
group:
types:
- "category:animal"
count: 21
distance: 5
pure: true
actions:
- kill
# No more than 50 animals (all of the same type) sparsely placed (within 160 blocks of each other)
trim-sparse-animal-farms:
group:
types:
- "category:animal"
count: 51
distance: 160
pure: true
actions:
- kill
# No more than 10 villagers per chunk
trim-villager-chunks:
group:
types:
- "villager"
count: 11
distance: same-chunk
actions:
- kill
For help with making profiles, please visit the wiki.
Commands
To run the command /farmcontrol <subcommand> the user will require farmcontrol.command.<subcommand>.
/farmcontrol reload - Reload the plugin's configuration.
/farmcontrol status <world> - Show the status of the given world.
/farmcontrol history - Display actions performed by the plugin in the recent past.
/farmcontrol notify - Toggle notifications from the plugin.
Metrics
This plugin uses bStats to collect some (non-identifying) data about the servers running this plugin. You can opt-out by editing the config.yml in the bStats folder located within your server's plugin directory.
评论 0
登录后参与评分
还没有评论,来抢沙发吧