-
Notifications
You must be signed in to change notification settings - Fork 109
Mod handling optimization, refactor, render tests. #873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mod_support
Are you sure you want to change the base?
Conversation
Grabbing latest changes
…-Unified into mod_support_lachal Conflicts: pymclevel/infiniteworld.py
* 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.
* 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 in `pymclevel::MCInfdevOldLevel:loadLevelDat`.
* Refactor
Moved threading utilities from `player_cache.py` to its own sub module in
`utilities/thread_utils.py`.
* Render tests
Played around with the rendering code to make it show mod blocks.
No success...
* 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_materials = getattr(level, "mod_materials", {}) | ||
|
|
||
| flatcolors = level.materials.flatColors[blockTypes, ch.Data[blockIndices] & 0xf][:, numpy.newaxis, :] | ||
| for mod_mats in mod_materials: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall be for mod_mats in mod_materials.values(), like in other places...
(My bad, I'll change this.)
This initialization breaks MCEdit at startup.
|
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 |
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_loadermodule now handles a mod catalog (mods/catalog) whichcontains 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.ModLoaderinstances have atexturemember which contains the loadedPNG texture image. This member is
Noneif no texture could be builtduring 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 in
pymclevel::MCInfdevOldLevel:loadLevelDat.Refactor
Moved threading utilities from
player_cache.pyto its own sub module inutilities/thread_utils.py.Moved OpenGL code from
mceutils.pytogl_img_utils.pyto avoid cyclicimports issues.
Render tests
Played around with the rendering code to make it show mod blocks.
No success...
Changes since commit 3f7e50c
access issues during render.
most of the members like 'names' and 'type'.
json data contains more information for data values, and files names are the
ones in 'level.dat' mod datas.
'mod_materials' key word argument for 'getBlocktypes' method and use it to
try to retrieve needed data.
Old code still there for ease of rollback if needed.
Mod blocks still can't be rendered...