MCEdit-Unified
MCEdit-Unified copied to clipboard
Mod handling optimization, refactor, render tests.
-
Mod handling optimization
-
Mods found in worlds are no more loaded at startup.
The mods are loaded only when the world is.
Added a 'check_only'keyword argument to MCInfdevOldLevel class
instanciation and to subsequent 'fromFile' and 'loadFile' methods. -
mod_loader
module now handles a mod catalog (mods/catalog
) which
contains data for already analyzed and extracted mod needed stuff.
This is used to avoid parsing and extrating .jar data every time a mod is
needed. -
The json data produced by the mod loader is consumed by
id_fefinitions
. -
ModLoader
instances have atexture
member which contains the loaded
PNG texture image. This member isNone
if no texture could be built
during mod loading. -
Tried to load mods using threads to reduce loading time.
Don't work, the threaded solution being slower than the sequential one.
The code can be found inpymclevel::MCInfdevOldLevel:loadLevelDat
.
-
-
Refactor
-
Moved threading utilities from
player_cache.py
to its own sub module in
utilities/thread_utils.py
. -
Moved OpenGL code from
mceutils.py
togl_img_utils.py
to avoid cyclic
imports issues.
-
-
Render tests
Played around with the rendering code to make it show mod blocks. No success...
Changes since commit 3f7e50c7c28f7c129b2c07910cc3f94c89b60d7d
- Added missing 'thread_utils.py' file.
- Commented part which add the mod definitions to vanila ones because of data access issues during render.
- Implemented block numeric IDs corretion from 'level.dat' data.
- Reworked 'MCMaterials' class to be able to handle more than 16 sub-items in most of the members like 'names' and 'type'.
- Swithced to 'blockstates' .jar data instead of 'models' because 'blockstates' json data contains more information for data values, and files names are the ones in 'level.dat' mod datas.
- In the render, made 'BlockRenderer' instances (and children ones) accept a 'mod_materials' key word argument for 'getBlocktypes' method and use it to try to retrieve needed data.
- Also made more generic functions to retrieve block types. Old code still there for ease of rollback if needed.
Mod blocks still can't be rendered...
Any progress on that? Or delayed?
@Dushess We’ve delayed any further work on this in order for us to work on Bedrock support and to prep for starting work on 1.13 format support. We’ll hopefully get around to this again in the future