3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Fix tab completion not completing mid-word, also makes code simpler

Dieser Commit ist enthalten in:
Myles 2017-12-14 21:25:42 +00:00
Ursprung f90029319e
Commit 246dc34835

Datei anzeigen

@ -67,16 +67,11 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
index = input.length();
length = 0;
} else {
// Otherwise find the last space
int lastSpace = input.lastIndexOf(" ");
if (lastSpace == -1) {
index = 0;
length = input.length();
} else {
// Otherwise find the last space (+1 as we include it)
int lastSpace = input.lastIndexOf(" ") + 1;
index = lastSpace;
length = input.length() - lastSpace;
}
}
// Write index + length
wrapper.write(Type.VAR_INT, index);
wrapper.write(Type.VAR_INT, length);