Browse Source

1.16.5

pull/16/head
DrBot7 4 years ago
parent
commit
13ca3f0f3e
  1. 2
      cogs/timings_check.yml
  2. 12
      cogs/timings_public.py

2
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: "❌"

12
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))

Loading…
Cancel
Save