mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-23 17:08:15 +01:00
parent
adb10f5fe7
commit
c86da22f4e
@ -17,7 +17,6 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.util;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.io.CharStreams;
|
||||
import com.google.common.io.Files;
|
||||
|
||||
@ -85,6 +84,9 @@ public class CommentStore {
|
||||
}
|
||||
|
||||
public void storeComments(final InputStream inputStream) throws IOException {
|
||||
mainHeader.clear();
|
||||
headers.clear();
|
||||
|
||||
final String data;
|
||||
try (final InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
|
||||
data = CharStreams.toString(reader);
|
||||
@ -219,20 +221,6 @@ public class CommentStore {
|
||||
Files.write(fileData.toString(), output, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
private String addHeaderTags(final List<String> header, final String indent) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
for (final String line : header) {
|
||||
builder.append(indent).append("# ").append(line).append('\n');
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private String join(final String[] array, final char joinChar, final int start, final int length) {
|
||||
final String[] copy = new String[length - start];
|
||||
System.arraycopy(array, start, copy, 0, length - start);
|
||||
return Joiner.on(joinChar).join(copy);
|
||||
}
|
||||
|
||||
private int getIndents(final String line) {
|
||||
int count = 0;
|
||||
for (int i = 0; i < line.length(); i++) {
|
||||
@ -250,16 +238,4 @@ public class CommentStore {
|
||||
System.arraycopy(array, 0, copy, 0, length);
|
||||
return String.join(this.pathSeparator, copy);
|
||||
}
|
||||
|
||||
private int getSuccessiveSpaces(final String text) {
|
||||
int count = 0;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == ' ') {
|
||||
count += 1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user