This adds:
- mossy stone brick stairs
- mossy cobblestone stairs
- mossy stone brick walls
We also add another block class for walls, and while we're at it,
clean up the stairs texture function to not have a huge sprawling
elif mess for loading textures, but instead to a cheeky dictionary
lookup.
In case you're wondering, yes I am just as disgusted by this code as
you are.
If the first texture loaded was not in the pack, i.e. we fell back
on system textures, then the pack was ignored altogether for the
remainder of the render.
Here we fix this by using an OrderedDict instead of the split jars
and jarpath nonsense, and then always checking the custom textures
first and opening them if they are not already open, and putting
the jar file handle at the start of the OrderedDict.
We also switch around some logic to avoid unnecessary isdir calls
when we're using a resource pack.
Sometimes a texture pack is not complete, but system textures are
available to make up the difference. In that case, we should load
those.
Current caveat is that we might not notice texture names changing
with newer minecraft clients because we have old ones installed.
I'll have to think some more about that one.
find_file contained a lot of code for searching textures in ways that
haven't been relevant for years. For example, it had workarounds for
MCPatcher, a tool that hasn't been updated since 2015.
Instead of searching in multiple paths that will never succeed in a
resource pack and Minecraft version that actually work, just look
for the filename that the block functions ask for.
Also, if we already have a manually specified resource pack open,
we shouldn't repeatedly re-open it. Furthermore, it's best if
the very first thing find_file does is try to find the file in
the resource pack or client jar we've already opened previously.
We can now also remove chest.png, ender.png, foliage.png, grass.png
and normal_double.png because Minecraft ships them, so we don't
need to ship them ourselves too. Us shipping them actually hid the
whole find_file garbagefire.
Concerns issue #1604.
Previously, textures that couldn't be found the first time around
would not have this fact cached, so we'd run through the whole
slow path of find_file with each blockid and data entry.
This is what caused the chests texture generation function to take
almost 12 seconds on my system, as it is looking for "normal.png"
that hasn't existed in Minecraft textures for ages.
Shoving the exception, if one is encountered, into the cache, and
then re-raising it if we load it from the texture cache brings this
number down to about 2 seconds. That's six times as fast!
Concerns issue #1604.
We can try each jar in descending order of versions until we actually
find one that works. This fixes#1328.
Future work might move the "if self.jar is not None" higher up in the
function so that we don't keep re-checking the overviewer dir and texture
path for files that we will then not use at all for some reason.
Sorry for the noise in mc_id.h, but somebody decided they want DOS
line endings and I couldn't allow that to happen. When not doing that
put the whole thing into diff, I decided to just fix the indentation
too while I was at it.
Needed bugfixing of some overlooked unsigned char usages for block IDs,
as otherwise the lighting would be scuffed.
Concerns issue #1486.
Many things work, some don't. Notably, genPOI doesn't work, and
there's some signedness comparison stuff going on in the C extension.
This also completely drops support for Python 2, as maintaining a C
extension for both Python 2 and 3 is a pain and not worth it for the
9 months that Python 2 is still going to be supported upstream.
The documentation needs to be adjusted as well.
All of the few tests we have pass, and rendering a map works, both
with a configuration file and without. We can also use optimizeimages.
Concerns #1528.