chore: pre-commit changes

This commit is contained in:
github-actions[bot] 2024-06-16 23:32:11 +00:00 committed by Sekwah
parent 069cd746f1
commit ed3eb6b868
3 changed files with 6 additions and 9 deletions

View File

@ -75,9 +75,8 @@ public abstract class CreateTaggedSubCommand implements SubCommand {
String baseString = endsWithSplit String baseString = endsWithSplit
? argData ? argData
: argData.substring( : argData.substring(
0, 0,
argData.lastIndexOf(multiTagSplit) argData.lastIndexOf(multiTagSplit) + 1);
+ 1);
tagSuggestions = tagSuggestions =
tagSuggestions tagSuggestions

View File

@ -127,8 +127,8 @@ public class ReflectiveConstructor<T> extends Constructor {
} }
} catch (Exception e) { } catch (Exception e) {
infoLogger.warning("Failed to set field " + field.getName() infoLogger.warning("Failed to set field " + field.getName()
+ " in " + currentClass.getName() + " in " + currentClass.getName() + ": "
+ ": " + e.getMessage()); + e.getMessage());
infoLogger.error(e); infoLogger.error(e);
throw new RuntimeException("Failed to set field " throw new RuntimeException("Failed to set field "
+ field.getName() + " in " + field.getName() + " in "

View File

@ -51,15 +51,13 @@ public class FriendlyDataOutput {
public void writeUtf(String text, int maxLength) { public void writeUtf(String text, int maxLength) {
if (text.length() > maxLength) { if (text.length() > maxLength) {
throw new EncoderException("String too big (was " + text.length() throw new EncoderException("String too big (was " + text.length()
+ " characters, max " + maxLength + " characters, max " + maxLength + ")");
+ ")");
} else { } else {
byte[] abyte = text.getBytes(StandardCharsets.UTF_8); byte[] abyte = text.getBytes(StandardCharsets.UTF_8);
int i = getMaxEncodedUtfLength(maxLength); int i = getMaxEncodedUtfLength(maxLength);
if (abyte.length > i) { if (abyte.length > i) {
throw new EncoderException("String too big (was " + abyte.length throw new EncoderException("String too big (was " + abyte.length
+ " bytes encoded, max " + i + " bytes encoded, max " + i + ")");
+ ")");
} else { } else {
this.writeVarInt(abyte.length); this.writeVarInt(abyte.length);
this.writeBytes(abyte); this.writeBytes(abyte);