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

Method save

tests/buildcraft/tests/testcase/TileTestCase.java:124–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 }
123
124 @RPC(RPCSide.SERVER)
125 private void save() {
126 if (sequence != null) {
127 File sequenceFile = new File(testName + ".seq");
128
129 OutputStream gzOs = null;
130 try {
131 NBTTagCompound nbt = new NBTTagCompound();
132 sequence.writeToNBT(nbt);
133
134 FileOutputStream f = new FileOutputStream(sequenceFile);
135 f.write(CompressedStreamTools.compress(nbt));
136 f.close();
137 } catch (IOException ex) {
138 Logger.getLogger("Buildcraft").log(Level.SEVERE,
139 String.format("Failed to save Sequence file: %s %s", sequenceFile, ex.getMessage()));
140 } finally {
141 try {
142 if (gzOs != null) {
143 gzOs.close();
144 }
145 } catch (IOException e) {
146 }
147 }
148 }
149
150 sequence.actions.clear();
151 updateInformation();
152 }
153
154 @RPC(RPCSide.SERVER)
155 private void setName(String name) {

Callers

nothing calls this directly

Calls 6

updateInformationMethod · 0.95
compressMethod · 0.80
logMethod · 0.80
writeMethod · 0.65
clearMethod · 0.65
writeToNBTMethod · 0.45

Tested by

no test coverage detected