SteamWar/BungeeCore
Archiviert
13
2

WIP: Add SchemSearch #467

Entwurf
Chaoscaot möchte 14 Commits von schemsearch nach master mergen
Nur Änderungen aus Commit f624d2893d werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -149,7 +149,7 @@ public class SchematicSearch {
task = BungeeCore.get().getProxy().getScheduler().runAsync(BungeeCore.get(), () -> {
try {
NodeData data = NodeData.get(node);
if(!data.getNodeFormat()) {
if (!data.getNodeFormat()) {
Message.send("SCHEMATIC_SEARCH_NOT_SUPPORTED", player);
end();
return;
@ -163,17 +163,15 @@ public class SchematicSearch {
while (!process.waitFor(100, TimeUnit.MILLISECONDS)) {
String s = readInputStream(stderr);
if(s.length() > 0) {
if(s.contains("s[")) {
if (s.length() > 0) {
if (s.contains("s[")) {
s = s.substring(s.lastIndexOf("s[") + 1);
}
BungeeCore.send(player, ChatMessageType.ACTION_BAR, "§7" + s.replace("", "§e█§7"));
}
}
Lixfel markierte diese Unterhaltung als gelöst
Review

BufferedInputStream.readline()?

BufferedInputStream.readline()?
String s = readInputStream(stderr);
if(s.contains("s[")) {
if (s.contains("s[")) {
s = s.substring(s.lastIndexOf("s[") + 1);
}
BungeeCore.send(player, ChatMessageType.ACTION_BAR, "§7" + s.replace("", "§e█§7"));
@ -228,6 +226,8 @@ public class SchematicSearch {
Message.send("SCHEMATIC_SEARCH_TOO_MANY_RESULTS", player);
}
end();
} catch (IOException | InterruptedException e) {
end();
} catch (Exception e) {
end();
@ -240,9 +240,11 @@ public class SchematicSearch {
if(process != null && process.isAlive()) {
process.destroy();
}
if(pattern != null) {
pattern.delete();
}
if(task != null) {
task.cancel();
}