Browse Source

Timings - Better error handling

master
DrBot7 4 years ago
committed by GitHub
parent
commit
6eb8b892fd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 232
      cogs/timings.py

232
cogs/timings.py

@ -10,10 +10,6 @@ class Timings(commands.Cog):
# Use @commands.Cog.listener() instead of event and use @commands.command() for commands # Use @commands.Cog.listener() instead of event and use @commands.command() for commands
# TODO: Add descriptions or hyperlink from the following links
# http://bit.ly/spiconf
# http://bit.ly/paperconf
# http://bit.ly/purpurc
async def analyze_timings(self, message): async def analyze_timings(self, message):
enterless_message = message.content.replace("\n", " ") enterless_message = message.content.replace("\n", " ")
words = enterless_message.split(" ") words = enterless_message.split(" ")
@ -51,7 +47,6 @@ class Timings(commands.Cog):
return return
unchecked = 0 unchecked = 0
try:
try: try:
version = r["timingsMaster"]["version"] version = r["timingsMaster"]["version"]
if "1.16.4" not in version: if "1.16.4" not in version:
@ -68,6 +63,9 @@ class Timings(commands.Cog):
"Consider using [Purpur](https://purpur.pl3x.net/downloads/#1.16.4).||") "Consider using [Purpur](https://purpur.pl3x.net/downloads/#1.16.4).||")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
online_mode = r["timingsMaster"]["onlinemode"] online_mode = r["timingsMaster"]["onlinemode"]
@ -80,6 +78,9 @@ class Timings(commands.Cog):
value="Enable this in [server.properties](http://bit.ly/servprop) for security.") value="Enable this in [server.properties](http://bit.ly/servprop) for security.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
timing_cost = int(r["timingsMaster"]["system"]["timingcost"]) timing_cost = int(r["timingsMaster"]["system"]["timingcost"])
@ -88,6 +89,9 @@ class Timings(commands.Cog):
value="Your timingcost is " + str(timing_cost) + ". Find a [better host](https://www.birdflop.com).") value="Your timingcost is " + str(timing_cost) + ". Find a [better host](https://www.birdflop.com).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
jvm_version = r["timingsMaster"]["system"]["jvmversion"] jvm_version = r["timingsMaster"]["system"]["jvmversion"]
@ -96,6 +100,9 @@ class Timings(commands.Cog):
value="You are using Java " + jvm_version + ". Update to [Java 11](https://adoptopenjdk.net/installation.html).") value="You are using Java " + jvm_version + ". Update to [Java 11](https://adoptopenjdk.net/installation.html).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
flags = r["timingsMaster"]["system"]["flags"] flags = r["timingsMaster"]["system"]["flags"]
@ -146,6 +153,9 @@ class Timings(commands.Cog):
value="Use [Aikar's flags](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/).") value="Use [Aikar's flags](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
cpu = int(r["timingsMaster"]["system"]["cpu"]) cpu = int(r["timingsMaster"]["system"]["cpu"])
if cpu == 1: if cpu == 1:
@ -156,6 +166,9 @@ class Timings(commands.Cog):
value="You have only " + str(cpu) + " threads. Find a [better host](https://www.birdflop.com).") value="You have only " + str(cpu) + " threads. Find a [better host](https://www.birdflop.com).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
plugins = r["timingsMaster"]["plugins"] plugins = r["timingsMaster"]["plugins"]
@ -270,6 +283,9 @@ class Timings(commands.Cog):
value="This plugin was made by Songoda. Songoda resources are poorly developed and often cause problems. You should find an alternative.") value="This plugin was made by Songoda. Songoda resources are poorly developed and often cause problems. You should find an alternative.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
using_purpur = "purpur" in r["timingsMaster"]["config"] using_purpur = "purpur" in r["timingsMaster"]["config"]
@ -289,6 +305,9 @@ class Timings(commands.Cog):
"Enable villager.lobotomize.enabled in [purpur.yml](http://bit.ly/purpurc).") "Enable villager.lobotomize.enabled in [purpur.yml](http://bit.ly/purpurc).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
plugins = r["timingsMaster"]["plugins"] plugins = r["timingsMaster"]["plugins"]
@ -305,6 +324,9 @@ class Timings(commands.Cog):
"Enable phantoms-only-attack-insomniacs in [paper.yml](http://bit.ly/paperconf).") "Enable phantoms-only-attack-insomniacs in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
network_compression_threshold = int( network_compression_threshold = int(
@ -318,6 +340,9 @@ class Timings(commands.Cog):
value="Set this to -1 in [server.properties](http://bit.ly/servprop) for a bungee server like yours.") value="Set this to -1 in [server.properties](http://bit.ly/servprop) for a bungee server like yours.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
spigot_view_distance = r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["view-distance"] spigot_view_distance = r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["view-distance"]
@ -328,6 +353,9 @@ class Timings(commands.Cog):
"Recommended: 3.") "Recommended: 3.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
chunk_gc_period = int(r["timingsMaster"]["config"]["bukkit"]["chunk-gc"]["period-in-ticks"]) chunk_gc_period = int(r["timingsMaster"]["config"]["bukkit"]["chunk-gc"]["period-in-ticks"])
@ -336,6 +364,9 @@ class Timings(commands.Cog):
value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 400.") value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 400.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
ticks_per_monster_spawns = int(r["timingsMaster"]["config"]["bukkit"]["ticks-per"]["monster-spawns"]) ticks_per_monster_spawns = int(r["timingsMaster"]["config"]["bukkit"]["ticks-per"]["monster-spawns"])
@ -344,6 +375,9 @@ class Timings(commands.Cog):
value="Increase this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 4.") value="Increase this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 4.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
monsters_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["monsters"]) monsters_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["monsters"])
@ -352,6 +386,9 @@ class Timings(commands.Cog):
value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 15.") value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 15.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
water_ambient_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["water-ambient"]) water_ambient_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["water-ambient"])
@ -360,6 +397,9 @@ class Timings(commands.Cog):
value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 2.") value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 2.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
ambient_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["ambient"]) ambient_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["ambient"])
@ -368,6 +408,9 @@ class Timings(commands.Cog):
value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 1.") value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 1.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
animals_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["animals"]) animals_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["animals"])
@ -376,6 +419,9 @@ class Timings(commands.Cog):
value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 3.") value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 3.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
water_animals_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["water-animals"]) water_animals_spawn_limit = int(r["timingsMaster"]["config"]["bukkit"]["spawn-limits"]["water-animals"])
@ -384,6 +430,9 @@ class Timings(commands.Cog):
value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 2.") value="Decrease this in [bukkit.yml](https://bukkit.gamepedia.com/Bukkit.yml).\nRecommended: 2.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
mob_spawn_range = int(r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["mob-spawn-range"]) mob_spawn_range = int(r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["mob-spawn-range"])
@ -400,6 +449,9 @@ class Timings(commands.Cog):
"Recommended: " + str(int(spigot_view_distance) - 1) + ".") "Recommended: " + str(int(spigot_view_distance) - 1) + ".")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
animals_entity_activation_range = int( animals_entity_activation_range = int(
@ -411,6 +463,9 @@ class Timings(commands.Cog):
"Recommended: 6.") "Recommended: 6.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
monsters_entity_activation_range = int( monsters_entity_activation_range = int(
@ -422,6 +477,9 @@ class Timings(commands.Cog):
"Recommended: 16.") "Recommended: 16.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
raiders_entity_activation_range = int( raiders_entity_activation_range = int(
@ -429,6 +487,9 @@ class Timings(commands.Cog):
"raiders"]) "raiders"])
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
misc_entity_activation_range = int( misc_entity_activation_range = int(
@ -439,6 +500,9 @@ class Timings(commands.Cog):
"Recommended: 4.") "Recommended: 4.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
water_entity_activation_range = int( water_entity_activation_range = int(
@ -449,6 +513,9 @@ class Timings(commands.Cog):
"Recommended: 12.") "Recommended: 12.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
villagers_entity_activation_range = int( villagers_entity_activation_range = int(
@ -460,6 +527,9 @@ class Timings(commands.Cog):
"Recommended: 16.") "Recommended: 16.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
flying_monsters_entity_activation_range = int( flying_monsters_entity_activation_range = int(
@ -467,6 +537,9 @@ class Timings(commands.Cog):
"flying-monsters"]) "flying-monsters"])
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
tick_inactive_villagers = \ tick_inactive_villagers = \
@ -477,6 +550,9 @@ class Timings(commands.Cog):
value="Disable this in [spigot.yml](http://bit.ly/spiconf).") value="Disable this in [spigot.yml](http://bit.ly/spiconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
nerf_spawner_mobs = r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["nerf-spawner-mobs"] nerf_spawner_mobs = r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["nerf-spawner-mobs"]
@ -485,6 +561,9 @@ class Timings(commands.Cog):
value="Enable this in [spigot.yml](http://bit.ly/spiconf).") value="Enable this in [spigot.yml](http://bit.ly/spiconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_villagers_every = int( wake_up_inactive_villagers_every = int(
@ -492,6 +571,9 @@ class Timings(commands.Cog):
"wake-up-inactive"]["villagers-every"]) "wake-up-inactive"]["villagers-every"])
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_villagers_for = int( wake_up_inactive_villagers_for = int(
r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["entity-activation-range"][ r["timingsMaster"]["config"]["spigot"]["world-settings"]["default"]["entity-activation-range"][
@ -502,6 +584,9 @@ class Timings(commands.Cog):
"Recommended: 20.") "Recommended: 20.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_flying_monsters_for = int( wake_up_inactive_flying_monsters_for = int(
@ -513,6 +598,9 @@ class Timings(commands.Cog):
"Recommended: 60.") "Recommended: 60.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_animals_every = int( wake_up_inactive_animals_every = int(
@ -521,6 +609,9 @@ class Timings(commands.Cog):
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_villagers_max_per_tick = int( wake_up_inactive_villagers_max_per_tick = int(
@ -532,6 +623,9 @@ class Timings(commands.Cog):
"Recommended: 1.") "Recommended: 1.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_animals_for = int( wake_up_inactive_animals_for = int(
@ -543,6 +637,9 @@ class Timings(commands.Cog):
"Recommended: 40.") "Recommended: 40.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_monsters_max_per_tick = int( wake_up_inactive_monsters_max_per_tick = int(
@ -554,6 +651,9 @@ class Timings(commands.Cog):
"Recommended: 4.") "Recommended: 4.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_flying_monsters_max_per_tick = int( wake_up_inactive_flying_monsters_max_per_tick = int(
@ -565,6 +665,9 @@ class Timings(commands.Cog):
"Recommended: 1.") "Recommended: 1.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_flying_monsters_every = int( wake_up_inactive_flying_monsters_every = int(
@ -572,6 +675,9 @@ class Timings(commands.Cog):
"wake-up-inactive"]["flying-monsters-every"]) "wake-up-inactive"]["flying-monsters-every"])
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_monsters_every = int( wake_up_inactive_monsters_every = int(
@ -579,6 +685,9 @@ class Timings(commands.Cog):
"wake-up-inactive"]["monsters-every"]) "wake-up-inactive"]["monsters-every"])
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_animals_max_per_tick = int( wake_up_inactive_animals_max_per_tick = int(
@ -590,6 +699,9 @@ class Timings(commands.Cog):
"Recommended: 2.") "Recommended: 2.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
wake_up_inactive_monsters_for = int( wake_up_inactive_monsters_for = int(
@ -601,6 +713,9 @@ class Timings(commands.Cog):
"Recommended: 60.") "Recommended: 60.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
arrow_despawn_rate = int( arrow_despawn_rate = int(
@ -611,6 +726,9 @@ class Timings(commands.Cog):
"Recommended: 300.") "Recommended: 300.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
item_merge_radius = float( item_merge_radius = float(
@ -621,6 +739,9 @@ class Timings(commands.Cog):
"Recommended: 4.0.") "Recommended: 4.0.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
exp_merge_radius = float( exp_merge_radius = float(
@ -631,6 +752,9 @@ class Timings(commands.Cog):
"Recommended: 6.0.") "Recommended: 6.0.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
max_entity_collisions = int( max_entity_collisions = int(
@ -641,6 +765,9 @@ class Timings(commands.Cog):
"Recommended: 2.") "Recommended: 2.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
max_auto_save_chunks_per_tick = int( max_auto_save_chunks_per_tick = int(
@ -651,6 +778,9 @@ class Timings(commands.Cog):
"Recommended: 6.") "Recommended: 6.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
optimize_explosions = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][ optimize_explosions = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][
@ -660,6 +790,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
mob_spawner_tick_rate = int( mob_spawner_tick_rate = int(
@ -670,6 +803,9 @@ class Timings(commands.Cog):
"Recommended: 2.") "Recommended: 2.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
disable_chest_cat_detection = \ disable_chest_cat_detection = \
@ -680,6 +816,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
container_update_tick_rate = int( container_update_tick_rate = int(
@ -690,6 +829,9 @@ class Timings(commands.Cog):
"Recommended: 3.") "Recommended: 3.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
grass_spread_tick_rate = int( grass_spread_tick_rate = int(
@ -700,6 +842,9 @@ class Timings(commands.Cog):
"Recommended: 4") "Recommended: 4")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
soft_despawn_range = int( soft_despawn_range = int(
@ -710,6 +855,9 @@ class Timings(commands.Cog):
"Recommended: 28") "Recommended: 28")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
hard_despawn_range = int(r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["despawn-ranges"]["soft"]) hard_despawn_range = int(r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["despawn-ranges"]["soft"])
@ -719,6 +867,9 @@ class Timings(commands.Cog):
"Recommended: 48") "Recommended: 48")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
hopper_disable_move_event = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["hopper"][ hopper_disable_move_event = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["hopper"][
@ -728,6 +879,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
non_player_arrow_despawn_rate = int( non_player_arrow_despawn_rate = int(
@ -738,6 +892,9 @@ class Timings(commands.Cog):
"Recommended: 60") "Recommended: 60")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
creative_arrow_despawn_rate = int( creative_arrow_despawn_rate = int(
@ -748,6 +905,9 @@ class Timings(commands.Cog):
"Recommended: 60") "Recommended: 60")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
prevent_moving_into_unloaded_chunks = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][ prevent_moving_into_unloaded_chunks = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][
@ -757,6 +917,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
eigencraft_redstone = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][ eigencraft_redstone = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][
@ -766,6 +929,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
fix_climbing_bypass_gamerule = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["fix-climbing-bypassing-cramming-rule"] fix_climbing_bypass_gamerule = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["fix-climbing-bypassing-cramming-rule"]
@ -774,6 +940,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
armor_stands_do_collision_entity_lookups = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["armor-stands-do-collision-entity-lookups"] armor_stands_do_collision_entity_lookups = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["armor-stands-do-collision-entity-lookups"]
@ -782,6 +951,9 @@ class Timings(commands.Cog):
value="Disable this in [paper.yml](http://bit.ly/paperconf).") value="Disable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
plugins = r["timingsMaster"]["plugins"] plugins = r["timingsMaster"]["plugins"]
@ -791,6 +963,9 @@ class Timings(commands.Cog):
value="Disable this in [paper.yml](http://bit.ly/paperconf).") value="Disable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
per_player_mob_spawns = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][ per_player_mob_spawns = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][
@ -800,6 +975,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
alt_item_despawn_rate_enabled = \ alt_item_despawn_rate_enabled = \
@ -809,6 +987,9 @@ class Timings(commands.Cog):
value="Enable this in [paper.yml](http://bit.ly/paperconf).") value="Enable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
no_tick_view_distance = int( no_tick_view_distance = int(
@ -829,6 +1010,9 @@ class Timings(commands.Cog):
"Recommended: " + spigot_view_distance + ". And reduce view-distance in [spigot.yml](http://bit.ly/spiconf). Recommended: 3.") "Recommended: " + spigot_view_distance + ". And reduce view-distance in [spigot.yml](http://bit.ly/spiconf). Recommended: 3.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
enable_treasure_maps = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["enable-treasure-maps"] enable_treasure_maps = r["timingsMaster"]["config"]["paper"]["world-settings"]["default"]["enable-treasure-maps"]
@ -838,6 +1022,9 @@ class Timings(commands.Cog):
value="Disable this in [paper.yml](http://bit.ly/paperconf).") value="Disable this in [paper.yml](http://bit.ly/paperconf).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
projectile_load_save = int(r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][ projectile_load_save = int(r["timingsMaster"]["config"]["paper"]["world-settings"]["default"][
@ -847,6 +1034,9 @@ class Timings(commands.Cog):
value="Set a value in [paper.yml](http://bit.ly/paperconf). Recommended: 8.") value="Set a value in [paper.yml](http://bit.ly/paperconf). Recommended: 8.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
use_alternate_keepalive = r["timingsMaster"]["config"]["purpur"]["settings"]["use-alternate-keepalive"] use_alternate_keepalive = r["timingsMaster"]["config"]["purpur"]["settings"]["use-alternate-keepalive"]
@ -859,6 +1049,9 @@ class Timings(commands.Cog):
value="Disable this in [purpur.yml](http://bit.ly/purpurc). It causes issues with TCPShield.") value="Disable this in [purpur.yml](http://bit.ly/purpurc). It causes issues with TCPShield.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
dont_send_useless_entity_packets = r["timingsMaster"]["config"]["purpur"]["settings"][ dont_send_useless_entity_packets = r["timingsMaster"]["config"]["purpur"]["settings"][
@ -868,6 +1061,9 @@ class Timings(commands.Cog):
value="Enable this in [purpur.yml](http://bit.ly/purpurc).") value="Enable this in [purpur.yml](http://bit.ly/purpurc).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
disable_treasure_searching = \ disable_treasure_searching = \
@ -878,6 +1074,9 @@ class Timings(commands.Cog):
value="Enable this in [purpur.yml](http://bit.ly/purpurc).") value="Enable this in [purpur.yml](http://bit.ly/purpurc).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
brain_ticks = int(r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"]["brain-ticks"]) brain_ticks = int(r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"]["brain-ticks"])
@ -887,6 +1086,9 @@ class Timings(commands.Cog):
"Recommended: 4.") "Recommended: 4.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
iron_golem_radius = int(r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"]["spawn-iron-golem"]["radius"]) iron_golem_radius = int(r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"]["spawn-iron-golem"]["radius"])
@ -896,6 +1098,9 @@ class Timings(commands.Cog):
"Recommended: 32.") "Recommended: 32.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
iron_golem_limit = int(r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"]["spawn-iron-golem"]["limit"]) iron_golem_limit = int(r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"]["spawn-iron-golem"]["limit"])
@ -905,6 +1110,9 @@ class Timings(commands.Cog):
"Recommended: 5.") "Recommended: 5.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
aggressive_towards_villager_when_lagging = \ aggressive_towards_villager_when_lagging = \
@ -915,6 +1123,9 @@ class Timings(commands.Cog):
value="Disable this in [purpur.yml](http://bit.ly/purpurc).") value="Disable this in [purpur.yml](http://bit.ly/purpurc).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
entities_can_use_portals = \ entities_can_use_portals = \
@ -925,6 +1136,9 @@ class Timings(commands.Cog):
value="Disable this in [purpur.yml](http://bit.ly/purpurc) to prevent players from creating chunk anchors.") value="Disable this in [purpur.yml](http://bit.ly/purpurc) to prevent players from creating chunk anchors.")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
lobotomize_enabled = r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"][ lobotomize_enabled = r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["mobs"]["villager"][
@ -934,6 +1148,9 @@ class Timings(commands.Cog):
value="Enable this in [purpur.yml](http://bit.ly/purpurc).") value="Enable this in [purpur.yml](http://bit.ly/purpurc).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
try: try:
teleport_if_outside_border = r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["gameplay-mechanics"]["player"]["teleport-if-outside-border"] teleport_if_outside_border = r["timingsMaster"]["config"]["purpur"]["world-settings"]["default"]["gameplay-mechanics"]["player"]["teleport-if-outside-border"]
@ -942,10 +1159,7 @@ class Timings(commands.Cog):
value="Enable this in [purpur.yml](http://bit.ly/purpurc).") value="Enable this in [purpur.yml](http://bit.ly/purpurc).")
except KeyError: except KeyError:
unchecked = unchecked + 1 unchecked = unchecked + 1
except ValueError:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
except TypeError:
except:
embed_var.add_field(name="❌ Invalid Configuration", embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.") value="At least one of your configuration files had an invalid data type.")

Loading…
Cancel
Save