From 0f9888dacd97528a2bfba2e8af89dbbe456635db Mon Sep 17 00:00:00 2001 From: lilingfengdev Date: Sun, 9 Jun 2024 14:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=B1=E9=99=A9=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto-optimize.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/auto-optimize.py b/auto-optimize.py index 21c65bb..d341378 100644 --- a/auto-optimize.py +++ b/auto-optimize.py @@ -6,6 +6,8 @@ print("开始优化!") +danger = ask("是否开启危险优化(会严重影响玩家体验)?") + @handler('server.properties', ServerPropLoader.load, ServerPropLoader.dump) def optimize_prop(properties): @@ -162,6 +164,8 @@ def optimize_paper_world(paper): } paper["entities"]["spawning"]["non-player-arrow-despawn-rate"] = 20 paper["entities"]["spawning"]["creative-arrow-despawn-rate"] = 20 + if not danger: + paper["entities"]["behavior"]["spawner-nerfed-mobs-should-jump"] = True paper["collisions"]["max-entity-collisions"] = 2 paper["collisions"]["fix-climbing-bypassing-cramming-rule"] = True paper["misc"]["update-pathfinding-on-block-update"] = False @@ -189,7 +193,9 @@ def optimize_paper_world(paper): paper["tick-rates"]["container-update"] = 1 paper["tick-rates"]["wet-farmland"] = 2 paper["environment"]["optimize-explosions"] = True - paper["environment"]["treasure-maps"]["enabled"] = False + if danger: + paper["environment"]["treasure-maps"]["enabled"] = False + paper["environment"]["nether-ceiling-void-damage-height"] = 127 paper["environment"]["treasure-maps"]["find-already-discovered"] = { "loot-tables": True, "villager-trade": True @@ -201,6 +207,9 @@ def optimize_gale_world(gale): gale["small-optimizations"]["max-projectile-chunk-loads"]["per-tick"] = 2 gale["small-optimizations"]["max-projectile-chunk-loads"]["per-projectile"][ "reset-movement-after-reach-limit"] = True + if danger: + gale["small-optimizations"]["max-projectile-chunk-loads"]["per-projectile"][ + "remove-from-world-after-reach-limit"] = True gale["small-optimizations"]["reduced-intervals"]["acquire-poi-for-stuck-entity"] = 200 gale["small-optimizations"]["reduced-intervals"]["check-nearby-item"]["hopper"]["interval"] = 50 gale["small-optimizations"]["reduced-intervals"]["check-nearby-item"]["hopper"]["minecart"]["temporary-immunity"][ @@ -233,12 +242,15 @@ def optimize_pufferfish(pufferfish): def optimize_purpur(purpur): purpur["settings"]["use-alternate-keepalive"] = True purpur["world-settings"]["default"]["mobs"]["zombie"]["aggressive-towards-villager-when-lagging"] = False - purpur["world-settings"]["default"]["mobs"]["villager"]["lobotomize"]["enabled"] = True - purpur["world-settings"]["default"]["mobs"]["villager"]["lobotomize"]["search-radius"] = { - "acquire-poi": 16, - "nearest-bed-sensor": 16 - } - purpur["world-settings"]["default"]["mobs"]["dolphin"]["disable-treasure-searching"] = True + if not danger: + purpur["settings"]["lagging-threshold"] = 18 + if danger: + purpur["world-settings"]["default"]["mobs"]["villager"]["lobotomize"]["enabled"] = True + purpur["world-settings"]["default"]["mobs"]["villager"]["lobotomize"]["search-radius"] = { + "acquire-poi": 16, + "nearest-bed-sensor": 16 + } + purpur["world-settings"]["default"]["mobs"]["dolphin"]["disable-treasure-searching"] = True purpur["world-settings"]["default"]["gameplay-mechanics"]["entities-can-use-portals"] = False purpur["world-settings"]["default"]["gameplay-mechanics"]["player"]["teleport-if-outside-border"] = True