MCPcopy Create free account
hub / github.com/Garten/sourcecraft / write

Method write

src/minecraft/map/DefaultSourceMap.java:115–147  ·  view source on GitHub ↗
(File file, SourceGame game)

Source from the content-addressed store, hash-verified

113 }
114
115 @Override
116 public ConvertingReport write(File file, SourceGame game) throws IOException {
117 if (!file.getParentFile()
118 .exists()) {
119 if (file.getParentFile()
120 .mkdirs()) {
121 Loggger.log("Successfully created " + file.getParentFile());
122 } else {
123 Loggger.log("Failed to create " + file.getParentFile());
124 }
125 }
126
127 ValveWriter w = new ValveWriter(file);
128
129 Loggger.log("writing");
130 this.writeHeader(w);
131
132 int brushCount = 0;
133 while (this.solids.empty() == false) {
134 brushCount++;
135 this.solids.pop()
136 .writeVmf(w);
137 }
138 ConvertingReport report = new ConvertingReport();
139 report.setBrushCount(brushCount);
140 Loggger.log(brushCount + "/8192 brushes added"); // TODO
141 w.close();
142 this.write(this.solidEntities, w);
143 this.write(this.pointEntities, w);
144 this.writeTail(w);
145 w.finish();
146 return report;
147 }
148
149 private void write(Stack<? extends ValveElement> stack, ValveWriter w) throws IOException {
150 while (stack.empty() == false) {

Callers

nothing calls this directly

Calls 7

logMethod · 0.95
writeHeaderMethod · 0.95
setBrushCountMethod · 0.95
closeMethod · 0.95
writeTailMethod · 0.95
finishMethod · 0.95
writeVmfMethod · 0.45

Tested by

no test coverage detected