mrkite/minutor

Support for more dimensions than default ones.

MajsterTynek opened this issue · 10 comments

Look into 20w14infinity version and how saves work.
This format may be used in the future or by mods.

  • add dimension parameter for commandline rendering

Work on custom dimensions is already ongoing:

  • rendering is finished
  • detection is discussed in #255 (and #242)
  • some internal restructuring is necessary for proper support
  • 20w14infinity is the Aprils Fools version, other more reasonable documentation is available

Yes you are right, a command line switch to select the dimension is also necessary.

@BlaCoiso & @MajsterTynek could you please test this new version from PullRequest #283 with some Custom Dimensions?

I can try testing it, I also have a 20w14infinity world if that needs to be tested as well

20w14infinity was just an Aprils fool version. Implementation and format might have changed dramatically.
If it works, great. If not, we will not add support.

I implemented from documentation in Minecraft Wiki and tested with the last example world you have provided.

I removed the duplicate label, as now the only remaining part is: missing support on command line.

minutor/worldinfo.cpp

Lines 78 to 90 in 085e519

if (file.startsWith("data/" + packname + "/dimension_type/") &&
file.endsWith(".json")) {
std::unique_ptr<JSONData> json;
try {
json = JSON::parse(zip.get(file));
} catch (JSONParseException e) {
// file was not parsable -> silently try next one
continue;
}
// now 'json' should contain the Dimension description
QFileInfo f(file);
DimensionInfo dim;
dim.path = "./dimensions/" + packname + "/" + f.baseName();

There can be multiple dimensions using the same dimension type, or dimension types with different names than the dimension itself; dimension type specifies properties like y limits, skylight, etc while dimension specifies biomes, worldgen settings and which type to use

minutor/worldinfo.cpp

Lines 69 to 75 in 085e519

// we only support this style "file/<packname>.zip" -> skip otherwise
if (!dp.startsWith("file")) continue;
QStringRef packname(&dp, 5, dp.size()-5-4);
// parse custom Dimension Data
// located in ./datapacks/<packname>.zip -> ./data/<packname>/dimension_type/<dimensions>.json
ZipReader zip(folder.path() + "/datapacks/" + packname + ".zip");

Datapacks can also be just a subfolder instead of a zip, I'm assuming for now support for subfolders rather than zip files is not a priority

Other than this, loading the custom dimensions worked just fine, although the Y pos label is getting cropped (Y > 999 or Y < -99)

So I have to somehow parse dimension and dimension_type. I will think about that.

Cropped Y is known, I hope that nobody (except you) will try something that large.
But it should be solvable with correct UI definition.

Dimension parameter should be possible to pair with --jump.
For example, I would want to make a script that opens
the current world at a current location I am in the game,
but for now, it defaults to the overworld and starts minimized. ¯\_(ツ)_/¯

So the dimension description may reference any dimension_type description. Even from a different pack or a vanilla one. That one may even be removed or invalid at that point. A real nightmare to find all combinations.
@BlaCoiso could you generate more working examples that reference e.g. a vanilla dimension_type or multiple dimensions that reference the same dimension_type?
I think I have the two-step lookup working now, but need some strange combinations for further testing.
Maybe also a combination of datapack in ZIP and another one as folder.

@BlaCoiso now it should work correctly with custom dimensions within the same data pack and within a ZIP file.
We still have to test:

  • referencing dimension_type from a different source
  • using unpacked data packs (not in ZIP file)
  • (and add a command line parameter)