Entries in the uuidcache will now be considered expired if they were
retrieved before the mtime of the player dat file. This follows the
recommendation made in issue #1279.
Minecraft now uses minecraft:sign as its id for signs, but also uses
Sign for older versions or chunks that have not yet been updated.
Change the genPOI sign wrangling code and the documentation to reflect
this change.
Fixes#1340.
Previously, the files were not closed after reading or writing;
by using a "with" statement, the file handles will be closed as
soon as they go out of scope.
Possible fix for #1271.
* When reading the cache, catch some errors on load, instead of crashing
* When writing to cache, write to tmp file, then move it into place.
This should be more robust if a ctrl+c is recieved while writing the
cache
Addresses #1266
There is no point in ignoring an invalid point, because without an error
message the user might wonder, why it's poyline doesn't look the way it
should.
One should use isinstance instead of `type(A) ==` because of
inheritance.
There should be an exception if a list of `elif`s don't match.
Make Polyline not only accept tuples, but any iterable.
Instead of reading all Players and especially Entities and TileEntities
into RAM and than applying the filter functions onto them, filter
functions are used after each parsed chunk to get only the markers of
this chunk and not all Entities.
This reduced the RAM usage dramatically:
On a 233 MB map over 200 MB of RAM was used before.
Using these changes (and only having two filter functions for signs) not
more than 36 MB of RAM was used.
Since all the POIs are created from different lists, multiple for loops
were used. With itertools.chain these lists can be looped over with only
one for loop thus removing doubled code.
The code creating the actual marker dict out of the entity and the
result of the filter function was almost the same for every set of
entities. Thus it is now a function.
Instead of doing the UUID->name resolution for all players in every
case, only do it when EntityId is accessed and the name hasn't been
retrieved this run already. This makes genPOI usable for people who
have many players on their servers but don't wish to use player POI
while still using other genPOI features.
To do this, a PlayerDict has been created, which contains a dirty
hack to see if the requested item is EntityId and whether it hasn't
been set already.