Skip to content

Conversation

@LaChal
Copy link
Collaborator

@LaChal LaChal commented Nov 18, 2017

  • 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 a texture member which contains the loaded
      PNG texture image. This member is None 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 in pymclevel::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 to gl_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 3f7e50c

  • 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...

LaChal and others added 4 commits November 11, 2017 12:15
…-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...
LaChal and others added 2 commits November 20, 2017 00:16
* 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:
Copy link
Collaborator Author

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.)

@Dushess
Copy link

Dushess commented Aug 3, 2018

Any progress on that? Or delayed?

@Podshot
Copy link
Owner

Podshot commented Aug 3, 2018

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants