From 13ca3f0f3e25e786c0782bcf6aaeae9b1bf561d1 Mon Sep 17 00:00:00 2001 From: DrBot7 <46543473+DrBot7@users.noreply.github.com> Date: Tue, 19 Jan 2021 00:16:39 -0600 Subject: [PATCH] 1.16.5 --- cogs/timings_check.yml | 2 +- cogs/timings_public.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cogs/timings_check.yml b/cogs/timings_check.yml index 05c91b9..00bc20b 100644 --- a/cogs/timings_check.yml +++ b/cogs/timings_check.yml @@ -5,7 +5,7 @@ # wake_up_inactive_animals_every = int(spigot["world-settings"]["default"]["entity-activation-range"]["wake-up-inactive"]["animals-every"]) # wake_up_inactive_flying_monsters_every = int(spigot["world-settings"]["default"]["entity-activation-range"]["wake-up-inactive"]["flying-monsters-every"]) # wake_up_inactive_monsters_every = int(spigot["world-settings"]["default"]["entity-activation-range"]["wake-up-inactive"]["monsters-every"]) -version: "1.16.4" +version: "1.16.5" servers: - name: "Yatopia" prefix: "❌" diff --git a/cogs/timings_public.py b/cogs/timings_public.py index b021aba..768adc2 100644 --- a/cogs/timings_public.py +++ b/cogs/timings_public.py @@ -22,6 +22,7 @@ class Timings(commands.Cog): self.bot = bot self.TIMINGS_TITLE = "Timings Analysis" + # TODO: Check Tuinity.yml for spawn rate changes async def analyze_timings(self, message): words = message.content.replace("\n", " ").split(" ") timings_url = "" @@ -335,13 +336,16 @@ def create_field(option): field["inline"] = option["inline"] return field + # Returns -1 if version A is older than version B # Returns 0 if version A and B are equivalent # Returns 1 if version A is newer than version B -def compare_versions(versionA, versionB): - def normalize(v): - return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")] - return (normalize(versionA) > normalize(versionB)) - (normalize(versionA) < normalize(versionB)) +def compare_versions(version_a, version_b): + def normalize(v): + return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")] + + return (normalize(version_a) > normalize(version_b)) - (normalize(version_a) < normalize(version_b)) + def setup(bot): bot.add_cog(Timings(bot))