cabaletta / baritone

google maps for block game
GNU Lesser General Public License v3.0
7.3k stars 1.46k forks source link

allow #build to use .nbt files #750

Open reticivis-net opened 5 years ago

reticivis-net commented 5 years ago

Currently #build uses .schematic files, An old and now broken format. .nbt files (ones a structure block would save) use 1.14 type string IDs and no more bytelists. They’re both NBT type files at heart, so no new libraries or code will be needed to read the files.

reticivis-net commented 5 years ago

Maybe “allow” isnt the right word here, but you get what I mean hopefully

alexlatz commented 5 years ago

There's currently a workaround for this: Schematica can load .nbt files just like schematics, and the #schematica command works perfectly fine for auto-building .nbt files once you load it in Schematica. (This won't work on versions above 1.12 because Schematica does not support them.)

reticivis-net commented 5 years ago

Huh. There still should be an update so it works on 1.14+ since the schematic format itself is outdated (it uses 8-bit numeric item IDs)

Also I coded a workaround myself (nbt to schematic converter in python)

tesnileft commented 5 years ago

Also I coded a workaround myself (nbt to schematic converter in python)

Can you perhaps upload that or link me to it? Would be really great!

reticivis-net commented 4 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply this is a sort of hacky python script put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work nbt2schematic.zip

5HT2 commented 4 years ago

Schematics are now converted and now work in 1.14.4 and stuff, by the way.

reticivis-net commented 4 years ago

Right That also means that you could make a structure, save it with a structure block, convert it, and have baritone build it without even leaving the work

which is neat

Heiloka commented 4 years ago

i don't really understand how the python thing works could you make a tutorial or something explaining how to use it?

5HT2 commented 4 years ago

look at the code

reticivis-net commented 4 years ago

I should have had explained it lol Near the beginning there’s a declaration of the variable “nbt_file” where it says “test.nbt”, change that to your input file The last line has the output file which is by default “output.schematic” Tbh I made this as a quick hack and you’re better off using schematica/litematica or world edit or something, especially considering nbt schematic size limits

AaronWebster commented 4 years ago

How did you create/obtain 114blocks.json?

5HT2 commented 4 years ago

This website lets you convert nbt to schematic https://cubical.xyz

ShadowBullet25 commented 3 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply this is a sort of hacky python script put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work nbt2schematic.zip

so, ive downloaded the files and unzipped them, and ran them through python, but it says "ModuleNotFoundError: No module named 'nbtlib'". what does that mean, and how do i fix that to convert the nbt?

reticivis-net commented 3 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply this is a sort of hacky python script put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work nbt2schematic.zip

so, ive downloaded the files and unzipped them, and ran them through python, but it says "ModuleNotFoundError: No module named 'nbtlib'". what does that mean, and how do i fix that to convert the nbt?

nbtlib is an external library that isnt included with python but is downloadable with pip. run <whatever python exe you use> -m pip install nbtlib and try again

ShadowBullet25 commented 3 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply this is a sort of hacky python script put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work nbt2schematic.zip

so, ive downloaded the files and unzipped them, and ran them through python, but it says "ModuleNotFoundError: No module named 'nbtlib'". what does that mean, and how do i fix that to convert the nbt?

nbtlib is an external library that isnt included with python but is downloadable with pip. run <whatever python exe you use> -m pip install nbtlib and try again

cough cough, im stupid, so im editing this once again not sure what this means: lookuptable[palette[int(block["state"])]] KeyError: 'minecraft:cobble_stone'

i did the script with a different .nbt file, and it did the same thing but with white concrete this time

(also, thanks for responding to me, it means quite a bit that you responded to a thing this "old")

zausa commented 3 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply this is a sort of hacky python script put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work nbt2schematic.zip

so, ive downloaded the files and unzipped them, and ran them through python, but it says "ModuleNotFoundError: No module named 'nbtlib'". what does that mean, and how do i fix that to convert the nbt?

nbtlib is an external library that isnt included with python but is downloadable with pip. run <whatever python exe you use> -m pip install nbtlib and try again

cough cough, im stupid, so im editing this once again not sure what this means: lookuptable[palette[int(block["state"])]] KeyError: 'minecraft:cobble_stone'

i did the script with a different .nbt file, and it did the same thing but with white concrete this time

(also, thanks for responding to me, it means quite a bit that you responded to a thing this "old")

Can this python be used in convert 1.16.5 nbt to 1.16.5 schematic?

reticivis-net commented 3 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply

this is a sort of hacky python script

put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work

nbt2schematic.zip

so, ive downloaded the files and unzipped them, and ran them through python, but it says "ModuleNotFoundError: No module named 'nbtlib'". what does that mean, and how do i fix that to convert the nbt?

nbtlib is an external library that isnt included with python but is downloadable with pip. run <whatever python exe you use> -m pip install nbtlib and try again

cough cough, im stupid, so im editing this once again

not sure what this means:

lookuptable[palette[int(block["state"])]]

KeyError: 'minecraft:cobble_stone'

i did the script with a different .nbt file, and it did the same thing but with white concrete this time

(also, thanks for responding to me, it means quite a bit that you responded to a thing this "old")

Can this python be used in convert 1.16.5 nbt to 1.16.5 schematic?

Maybe? Like I said, it was bodged together code just good enough to get the job done at the time. So,,, maybe? Obviously won't work on blocks added after 1.12 but might still work with the rest

reticivis-net commented 3 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply

this is a sort of hacky python script

put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work

nbt2schematic.zip

so, ive downloaded the files and unzipped them, and ran them through python, but it says "ModuleNotFoundError: No module named 'nbtlib'". what does that mean, and how do i fix that to convert the nbt?

nbtlib is an external library that isnt included with python but is downloadable with pip. run <whatever python exe you use> -m pip install nbtlib and try again

cough cough, im stupid, so im editing this once again

not sure what this means:

lookuptable[palette[int(block["state"])]]

KeyError: 'minecraft:cobble_stone'

i did the script with a different .nbt file, and it did the same thing but with white concrete this time

(also, thanks for responding to me, it means quite a bit that you responded to a thing this "old")

The error means it can't find the numeric block id for "minecraft:cobble_stone" but the namespaced id of cobble doesn't have an underscore so "cobble_stone", to my knowledge, isn't a thing? What program is generating your schematic files

ShadowBullet25 commented 3 years ago

Can you perhaps upload that or link me to it? Would be really great!

lol sorry for the super late reply

this is a sort of hacky python script

put 114blocks.json and your nbt file in the same folder as the script, then edit line 8 of the script (nbt name) and line 50 (output name) and it should spit out a .schematic file that will probably work

nbt2schematic.zip

so, ive downloaded the files and unzipped them, and ran them through python, but it says "ModuleNotFoundError: No module named 'nbtlib'". what does that mean, and how do i fix that to convert the nbt?

nbtlib is an external library that isnt included with python but is downloadable with pip. run <whatever python exe you use> -m pip install nbtlib and try again

cough cough, im stupid, so im editing this once again not sure what this means: lookuptable[palette[int(block["state"])]] KeyError: 'minecraft:cobble_stone' i did the script with a different .nbt file, and it did the same thing but with white concrete this time (also, thanks for responding to me, it means quite a bit that you responded to a thing this "old")

The error means it can't find the numeric block id for "minecraft:cobble_stone" but the namespaced id of cobble doesn't have an underscore so "cobble_stone", to my knowledge, isn't a thing? What program is generating your schematic files

a friend introduced me to the website, and its been pretty nice, but ive been using https://rebane2001.com/mapartcraft/ is there some other website i should be using to get past this error? ;-;