MCPcopy Create free account
hub / github.com/BuildCraft/BuildCraft / writeToNBT

Method writeToNBT

tests/buildcraft/tests/testcase/Sequence.java:43–63  ·  view source on GitHub ↗
(NBTTagCompound nbt)

Source from the content-addressed store, hash-verified

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");

Callers 1

saveMethod · 0.45

Calls 2

getMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected