EndingCredits / litematic-viewer

Viewer for Litematica schematics in-browser for when you cba to fire up Minecraft. Based on Deepslate renderer.
25 stars 16 forks source link

Minimum-maximum layer view #11

Open Blackrobe opened 1 year ago

Blackrobe commented 1 year ago

This is a feature request, I started to recommend this tool for Minecraft Bedrock players who can't use Litematica. Is it possible to add maybe a lesser version of Litematica's layer display feature? For example the maximum layer displayed which can be configured from bottom to top.

EndingCredits commented 1 year ago

Noted, thanks for the request!

This may not be so easy, it's dependent on us working out how to make it work with the renderer (deepslate), but we can certainly look into it.

Blackrobe commented 1 year ago

Oh I'm not knowledgeable in JS but I was thinking if it will involve playing with the render's height parameter like in

https://github.com/EndingCredits/litematic-viewer/blob/main/src/litematic-utils.js#L28

function readLitematicFromNBTData(nbtdata, yparameter) {
...
  for (let regionName in regions) {
    ...
    // height = region.Size.value.y.value;
    // change into
    height = yparameter;
    ...

and it will re-render the whole thing every time the user changes the value.

EndingCredits commented 1 year ago

Yes, I think it could be simple, just need to have a look to see if there is a simple way of selecting which blocks are rendered in the render library (otherwise we will just have to rebuild the structure each time).