version_utils module

class version_utils.PlayerCache[source]

Used to cache Player names and UUID’s, provides an small API to interface with it

PATH = u'C:\\Users\\Jonathan\\Documents\\MCEdit\\usercache.json'
TIMEOUT = 2.5
UUIDInCache(uuid)[source]

Checks to see if the UUID is already in the cache

Parameters:uuid (str) – The UUID of the player
Return type:bool
force_refresh()[source]
static getDeltaTime(timestamp, unit)[source]
getPlayerInfo(arg, force=False, use_old_data=False)[source]

Recommended method to call to get Player data. Roughly determines whether a UUID or Player name was passed in ‘arg’

Parameters:
  • arg (str) – Either a UUID or Player name to retrieve from the cache/Mojang’s API
  • force (bool) – True if the Player name should be forcefully fetched from Mojang’s API
Returns:

A tuple with the data in this order: (UUID with separator, Player name, UUID without separator)

Return type:

tuple

getPlayerSkin(arg, force_download=True, instance=None)[source]

Gets the player’s skin from Mojang’s skin servers

Parameters:
  • uuid (str) – The UUID of the player
  • force_download – Should the skin be re-downloaded even if it has already been downloaded
  • instance (PlayerTool) – The instance of the PlayerTool
Returns:

The path to the player skin

Return type:

str

static insertSeperators(uuid)[source]
load()[source]

Loads from the usercache.json file if it exists, if not an empty one will be generated

nameInCache(name)[source]

Checks to see if the name is already in the cache

Parameters:name (str) – The name of the player
Return type:bool
save()[source]