Simple Anti-Mob Lag

插件

· 作者 froobynoobymc

一款简单、轻量的插件,用于减少实体卡顿。

0 本站下载 0 关注 更新于 7 年前

最新 Simple Anti-Mob Lag 1.3.5 · 1.14

一键开服(送7天)
Simple Anti-Mob Lag
一款轻量级插件,用于减少实体卡顿
 
在许多服务器中,卡顿的主要来源是实体(mobs)。本插件的目的很简单:当服务器卡顿时冻结实体,而在服务器不卡顿时解冻它们。我们也力求以一种不会对游戏玩法产生显著影响的方式来实现这一功能。
 
默认情况下,我们仅冻结大群落的实体,而保留单独行动的实体处于活跃状态。这意味着会导致严重卡顿的大型动物养殖场会被冻结,但世界中随机生成的怪物则不会。此外,还有一个选项可以使用智能缩放系统,根据服务器的卡顿程度来调整此行为,即如果服务器卡顿严重,我们会冻结更多实体。所有这些功能均可配置。
 
安装与配置
安装非常简单。只需将 jar 文件放入你的 plugins 文件夹并重启或重载服务器即可。这将在插件目录中的 'SAML' 文件夹内生成该插件的配置文件。
有很多内容需要配置。以下是配置文件的样貌:
# Do you want a config file with more options to generate?
use-advanced-config: false

When the server's TPS drops below this, we will start freezing mobs.

tps-freezing-threshold: 18.5

When the server's TPS rises above this, we will begin unfreezing mobs again.

This should be higher than the tps-freezing-threshold!

tps-unfreezing-threshold: 19.0

Every how many ticks should we freeze or unfreeze mobs? There are 20 ticks per second.

Not recommended to set this below 600.

ticks-per-operation: 1200

How long (in milliseconds) should the freezing or unfreezing operation be allowed to take?

If this is set too high there may be noticeable lag spikes when we freeze mobs.

maximum-operation-time: 300

At most how many mobs should be unfrozen in any given operation?

unfreeze-limit: 100

Should we keep a list of chunks containing frozen mobs in them, so we may be able to unfreeze them if the plugin doesn't shut down correctly?

Keep this as true if you think you'll uninstall this plugin at some point. This will allow you to unfreeze all the frozen mobs in your world easily.

keep-frozen-chunk-cache: true

On startup, should we unfreeze mobs which were not unfrozen previously?

Warning: this operation loads chunks and therefore can cause a lot of lag.

unfreeze-cached-chunks-on-startup: false

Every how many ticks should we unfreeze these mobs?

ticks-per-cached-chunk-unfreeze: 40

Do you use Paper? If so, do you want this task (the cache unfreezing task) to run in a more efficient manner?

use-paper-get-chunk-async: false

Should we only freeze mobs that are in large groups, ignoring single mobs?

This is good if you want to freeze large player-made farms, but don't want to freeze random monsters in the world.

group-bias: true

Below what TPS should we ignore the option above and freeze EVERYTHING in accordance to the other options?

Set to 0 to disable this option.

group-bias-tps-threshold: 0

If there are any more than the group-minimum-size number of mobs within group-maximum-radius of each other this will constitute a group of mobs, which will be frozen if the server starts lagging.

group-minimum-size: 10 group-maximum-radius: 8.0

Should we scale the maximum radius and minimum size required of a group depending on how much the server is lagging?

use-smart-scaling: true

When we freeze mobs should we say so in the server console?

broadcast-to-console: true

When we freeze mobs should we tell people with the permission 'saml.notify'?

broadcast-to-ops: false

Should we stop mobs from targeting mobs that are frozen?

This includes things like zombies attacking frozen villagers and baby animals following frozen adult animals.

prevent-targeting-frozen: true

Should we stop mobs from being able to damage frozen mobs?

prevent-damaging-frozen: true

Should we stop players from being able to damage frozen mobs?

prevent-player-damaging-frozen: false

Should we unfreeze mobs when the chunk they are in is unloaded?

unfreeze-on-unload: true

Should we unfreeze all the loaded mobs when the plugin shuts down?

unfreeze-on-shutdown: true

Should we unfreeze mobs when interacted with by a player?

unfreeze-on-interact: true

Below what TPS should we ignore the option above and not unfreeze mobs that are interacted with?

Set to 0 to disable this option.

unfreeze-on-interact-tps-threshold: 0

Should we unfreeze mobs when they take damage?

unfreeze-on-damage: true

Below what TPS should we ignore the option above and not unfreeze mobs that take damage?

Set to 0 to disable this option.

unfreeze-on-damage-tps-threshold: 0

Should tamed mobs (cats, dogs, horses, etc.) never be frozen?

ignore-tamed: true

Below what TPS should we ignore the option above and start freezing mobs that are tamed?

Set to 0 to disable this option.

ignore-tamed-tps-threshold: 0

Should we ignore mobs named with a name tag?

ignore-named: true

Below what TPS should we ignore the option above and start freezing mobs that are named?

Set to 0 to disable this option.

ignore-named-tps-threshold: 0

Should mobs that are leashed never be frozen?

ignore-leashed: true

Below what TPS should we ignore the option above and start freezing mobs that are leashed?

Set to 0 to disable this option.

ignore-leashed-tps-threshold: 0

是否永远不冻结处于求偶模式(繁殖模式)的实体?

ignore-love-mode: true

TPS 低于多少时,我们应该忽略上述选项并开始冻结处于求偶模式的实体?

设置为 0 以禁用此选项。

ignore-love-mode-tps-threshold: 0

实体距离玩家多远(以方块为单位)时不应被冻结?

设置为 0 以禁用此选项。

ignore-player-proximity: 0

TPS 低于多少时,我们应该忽略上述选项并开始冻结靠近玩家的实体?

请注意,这是一个非常消耗资源的检查。如果玩家数量众多,可能会导致冻结操作显著变慢。

设置为 0 以禁用此选项。

ignore-player-proximity-tps-threshold: 0

我们永远不会冻结此类实体。

将那些如果被冻结可能会陷入危险的实体放在这里,比如村民。

类型列表请参阅 。

这是区分大小写的,必须全部大写!

never-freeze:

  • VILLAGER
  • WANDERING_TRADER
  • PILLAGER
  • VINDICATOR
  • VEX
  • WITCH
  • RAVAGER
  • ILLUSIONER
  • EVOKER

TPS 低于多少时,我们应该忽略上述选项并开始冻结列表中的实体?

设置为 0 以禁用此选项。

never-freeze-tps-threshold: 0

如果服务器卡顿,我们将始终冻结此类实体。即使它们没有组成大型群体。

将那些资源占用高的实体放在这里,比如水生生物。

类型列表请参阅 。

这是区分大小写的,必须全部大写!

always-freeze:

  • COD
  • SALMON
  • TROPICAL_FISH
  • PUFFERFISH
  • TURTLE
  • SQUID
  • DOLPHIN

我们永远不会在这些世界中冻结实体。

ignore-world:

  • example_world_the_end
命令与权限
命令:
  • /saml - 插件的基础命令,显示版本号。
  • /saml reload - 重新加载插件的配置文件。
  • /saml stats - 显示全服及每个世界的已冻结实体总数。
权限:
  • saml.saml - 授予使用 /saml 命令的权限。
  • saml.notify - 当冻结操作开始和结束时你会收到通知(如果在配置中启用)。
 
兼容性
该插件支持 1.9 到 1.14 版本。然而,并非所有功能都适用于较低版本。在 1.13 以下版本中,无法在配置中使用 ignore-love-mode 或 use-paper-get-chunk-async 选项。这是因为这些选项使用了当时尚不存在的 API。遗憾的是,1.8 永远无法获得支持,因为我们用于“冻结”实体的主要 API 在 1.8 中并不存在。
你需要 Java 8 来运行此插件。
 
 
请注意: 如果你在配置中禁用了 unfreeze-on-unload 和 unfreeze-on-shutdown,冻结的实体将被保存到你的世界中。如果你随后卸载插件,这些实体将不会被解冻。如果你不想启用这两个选项,并且打算在未来某个时候卸载插件,建议将配置中的 'keep-frozen-chunk-cache' 选项设置为 true。

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

评论 0

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

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源