Minecoprocessors

Minecoprocessors

183k Downloads

Why save compiled program to NBT?

josephcsible opened this issue ยท 2 comments

commented

program = new ArrayList<>();
NBTTagList programTag = (NBTTagList) c.getTag(NBT_PROGRAM);
if (programTag != null) {
for (NBTBase tag : programTag) {
program.add(((NBTTagByteArray) tag).getByteArray());
}
}
labels = new ArrayList<>();
NBTTagList labelTag = (NBTTagList) c.getTag(NBT_LABELS);
if (labelTag != null) {
for (NBTBase tag : labelTag) {
labels.add(Label.fromNbt((NBTTagCompound) tag));
}
}

Is there a reason that we need to save program and labels to NBT? Instead of doing this, could we just re-parse the book whenever we load the rest of our data from NBT?

commented

Removing that would be a good optimization. It seems like it would work without it, certainly worth a shot. Before we removing this code, let me fix the stack NBT serialization.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.