Fenixin/Minecraft-Region-Fixer

Solving "Tag type id 116 is out of bounds" in mapping software

Closed this issue · 5 comments

Is your feature request related to a problem? Please describe.

I am using this mapping software: Minecraft-Technik-Wiki/BlockMap
which relies on this library: piegamesde/nbt
which has an issue of one of my worlds having a Tag Type ID misbehave here:
https://github.com/piegamesde/nbt/blob/c3e452efb3e13cf5a248d9cd8ac4c7970911bc1a/src/main/java/de/piegames/nbt/TagType.java#L119
and throws this error:

java.lang.IndexOutOfBoundsException: Tag type id 116 is out of bounds!
        at de.piegames.nbt.TagType.getById(TagType.java:119)
        at de.piegames.nbt.stream.NBTInputStream.readTag(NBTInputStream.java:190)
        at de.piegames.nbt.stream.NBTInputStream.readTagPayload(NBTInputStream.java:269)
        at de.piegames.nbt.stream.NBTInputStream.readTag(NBTInputStream.java:199)
        at de.piegames.nbt.stream.NBTInputStream.readTagPayload(NBTInputStream.java:269)
        at de.piegames.nbt.stream.NBTInputStream.readTag(NBTInputStream.java:199)
        at de.piegames.nbt.stream.NBTInputStream.readTag(NBTInputStream.java:176)
        at de.piegames.blockmap.renderer.RegionRenderer.renderRaw(RegionRenderer.java:117)
        at de.piegames.blockmap.renderer.RegionRenderer.render(RegionRenderer.java:59)
        at de.piegames.blockmap.world.RegionFolder$WorldRegionFolder.render(RegionFolder.java:180)
        at de.piegames.blockmap.world.RegionFolder$CachedRegionFolder.render(RegionFolder.java:466)
        at de.piegames.blockmap.standalone.CommandLineMain$CommandRender.call(CommandLineMain.java:249)
        at de.piegames.blockmap.standalone.CommandLineMain$CommandRender.call(CommandLineMain.java:113)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
        at picocli.CommandLine.access$1100(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
        at picocli.CommandLine.execute(CommandLine.java:2058)
        at de.piegames.blockmap.standalone.CommandLineMain.mainWithoutQuit(CommandLineMain.java:399)
        at de.piegames.blockmap.standalone.CommandLineMain.main(CommandLineMain.java:403)

Describe the solution you'd like
It would be great if this package could fix this issue. Thanks!

Hello again!

I'm sorry to say that this is the same case as #132. I don't have the time to keep up with all the changes made by tools or mods. And I don't have the time to keep up with the development of minecraft so I can't update all the nbt tags to check for bad types or values.

If it's a isolated problem you could try to fix it by hand or I can point you a place to implement this.

With all that said, have you tried to scan this region files with regionfixer? Does it find anything?

no, nothing is found by the fixer.
I wonder if it's possible to define a list of required data formats and then simply go through and highlight those that don't match the required format. It could be as easy if reading the existing formats from a freshly generated world.
If one only knew which files are broken, even if they cannot be fixed, it would be helpful to assess the size of the problem.

That is something that I have thought myself. The problem is that I don't know wether a nbt tag is mandatory or not. And I don't think that generating a new map is a good way to get a list to compare of, in map generation everything is random and you could end up with a lot of missing stuff. Finally I don't want to keep up with all the updates made to Minecraft, which are frequent.

Feel free to implement this yourself and don't hesitate to ask if you need any help. I don't want to implement a feature that is going to be time consuming to keep it in working order.

The problem is that I don't know wether a nbt tag is mandatory or not.

I did not think to check for existance, rather if the data format is wrong.

Finally I don't want to keep up with all the updates made to Minecraft, which are frequent.

I get that. I would approach it with having a script generate a world of a certain size (worldborder plugin can do that for example) and then scan it to read tags, then dumping the list of tag formats into a file to be included in the code. So the actual code would not be changed ever going forward. Of course this would not consider any tags created by users, not sure how much this is an issue.

Feel free to implement this yourself and don't hesitate to ask if you need any help

I'll consider it, I'll take a closer look at the code and see if I can wrap my brain around it.

This issue is stale. I going to close this, feel free to reopen if needed.