The Lost Cities

The Lost Cities

60M Downloads

editpart on a stairs part does not include meta section on export, causing chunk gen errors

hanleybrand opened this issue ยท 0 comments

commented

Version: 1.19-6.0.15

Issue:

Using /lost listparts ( Found 'stairsbig' at 72) and then /lost editpart (Start editing part 'stairsbig') and replacing a few blocks with white_stained_glass and using /lost exportpart stairsbig (Exported part to 'stairsbig'!) ouputs this export file:

{
  "__comment__": "'missingpalette' represents all blockstates that it couldn't find in the palette. These have to be put in a palette. 'exportedpart' is the actual exported part",
  "palette": {
    "palette": [
      {
        "char": "e",
        "block": "minecraft:white_stained_glass"
      }
    ]
  },
  "exportedpart": {
    "xsize": 6,
    "zsize": 12,
    "__comment__": "slices above 0 removed",
    "slices": [
      [
        "      ",
        "      ",
        "      ",
        "      ",
        "xxxxxe",
        "xxxxx/",
        "xxxxx/",
        "xxxxx/",
        "xxxxx/",
        "xxxxx/",
        "xxxxx/",
        "xxxxxe"
      ],

The default stairsbig.json file (like the other stairs files) contains a meta section which (as far as I can tell passes stair rotation information as an integer?)

  "meta": [
    {
      "integer": 4,
      "key": "z1"
    },
    {
      "integer": 11,
      "key": "z2"
    }
  ],
  "xsize": 6,
  "zsize": 12,
  ...

Without the meta section, correcting the stairsbig.json file (ie renaming missingpalette to palette and moving exportedpart children to the root, etc) and moving it to /parts and estarting the minecraft client will not produce errors until the part is ised for worldgen, which throws an error similar to

[10:47:04] [Worker-Main-97/ERROR] [lostcities/]: Error generating chunk 32,-21: Cannot invoke "java.lang.Integer.intValue()" because "z1" is null
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because "z1" is null
	at mcjty.lostcities.worldgen.LostCityTerrainFeature.borderNeedsConnectionToAdjacentChunk(LostCityTerrainFeature.java:2379) ~[lostcities-1.19-6.0.15.jar%23461!/:1.19-6.0.15] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityTerrainFeature.generateBorder(LostCityTerrainFeature.java:2106) ~[lostcities-1.19-6.0.15.jar%23461!/:1.19-6.0.15] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityTerrainFeature.generateBorders(LostCityTerrainFeature.java:1993) ~[lostcities-1.19-6.0.15.jar%23461!/:1.19-6.0.15] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityTerrainFeature.generateStreet(LostCityTerrainFeature.java:1970) ~[lostcities-1.19-6.0.15.jar%23461!/:1.19-6.0.15] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityTerrainFeature.doCityChunk(LostCityTerrainFeature.java:1428) ~[lostcities-1.19-6.0.15.jar%23461!/:1.19-6.0.15] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityTerrainFeature.generate(LostCityTerrainFeature.java:290) ~[lostcities-1.19-6.0.15.jar%23461!/:1.19-6.0.15] {re:classloading}
	at mcjty.lostcities.worldgen.LostCityFeature.m_142674_(LostCityFeature.java:57) ~[lostcities-1.19-6.0.15.jar%23461!/:1.19-6.0.15] {re:classloading}
	at net.minecraft.world.level.levelgen.feature.Feature.m_225028_(Feature.java:154) ~[client-1.19.2-20220805.130853-srg.jar%23547!/:?] {re:mixin,re:classloading,pl:mixin:APP:farmersdelight.mixins.json:KeepRichSoilMixin,pl:mixin:A}
	at net.minecraft.world.level.levelgen.feature.ConfiguredFeature.m_224953_(ConfiguredFeature.java:27) ~[client-1.19.2-20220805.130853-srg.jar%23547!/:?] {re:classloading}
	at net.minecraft.world.level.levelgen.placement.PlacedFeature.m_226362_(PlacedFeature.java:56) ~[client-1.19.2-20220805.130853-srg.jar%23547!/:?] {re:classloading,pl:accesstransformer:B}
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?] {}
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?] {}
	at java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180) ~[?:?] {} 

Proposed solution:

The meta section should be included as a child of exportedpart, or a comment filed should alert the editor of the exported part that they should refer to the original part json as some information may not have been included in the export.