| 41 | } |
| 42 | |
| 43 | public void writeToNBT(NBTTagCompound nbt) { |
| 44 | nbt.setLong("initialDate", initialDate); |
| 45 | |
| 46 | MappingRegistry registry = new MappingRegistry(); |
| 47 | |
| 48 | NBTTagList list = new NBTTagList(); |
| 49 | |
| 50 | for (SequenceAction action : actions) { |
| 51 | NBTTagCompound cpt = new NBTTagCompound(); |
| 52 | action.writeToNBT(cpt); |
| 53 | cpt.setString("class", classToStr.get(action.getClass())); |
| 54 | registry.scanAndTranslateStacksToRegistry(cpt); |
| 55 | list.appendTag(cpt); |
| 56 | } |
| 57 | |
| 58 | nbt.setTag("actions", list); |
| 59 | |
| 60 | NBTTagCompound registryNBT = new NBTTagCompound(); |
| 61 | registry.write(registryNBT); |
| 62 | nbt.setTag("registry", registryNBT); |
| 63 | } |
| 64 | |
| 65 | public void readFromNBT(NBTTagCompound nbt) { |
| 66 | initialDate = nbt.getLong("initialDate"); |