geforkt von Mirrors/Velocity
Minor code cleanup
Dieser Commit ist enthalten in:
Ursprung
6c348c994c
Commit
a0a0966f99
@ -271,10 +271,6 @@ public enum ProtocolUtils {
|
||||
* @param stringArray the array to write
|
||||
*/
|
||||
public static void writeStringArray(ByteBuf buf, String[] stringArray) {
|
||||
if (stringArray == null) {
|
||||
writeVarInt(buf, 0);
|
||||
return;
|
||||
}
|
||||
writeVarInt(buf, stringArray.length);
|
||||
for (String s : stringArray) {
|
||||
writeString(buf, s);
|
||||
@ -292,7 +288,7 @@ public enum ProtocolUtils {
|
||||
writeString(buf, property.getName());
|
||||
writeString(buf, property.getValue());
|
||||
String signature = property.getSignature();
|
||||
if (signature != null) {
|
||||
if (signature != null && !signature.isEmpty()) {
|
||||
buf.writeBoolean(true);
|
||||
writeString(buf, signature);
|
||||
} else {
|
||||
|
@ -10,7 +10,7 @@ import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* A {@link DataOutput} equivalent to {@link ByteBufDataInput}.
|
||||
* A {@link ByteArrayDataOutput} equivalent to {@link ByteBufDataInput}.
|
||||
*/
|
||||
public class ByteBufDataOutput extends OutputStream implements ByteArrayDataOutput {
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
package com.velocitypowered.proxy.util;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.ArgumentBuilder;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
@ -13,7 +11,6 @@ import com.mojang.brigadier.tree.CommandNode;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import java.util.Locale;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Provides utilities for working with Brigadier commands.
|
||||
|
@ -21,8 +21,7 @@ public class VelocityChannelRegistrar implements ChannelRegistrar {
|
||||
public void register(ChannelIdentifier... identifiers) {
|
||||
for (ChannelIdentifier identifier : identifiers) {
|
||||
Preconditions.checkArgument(identifier instanceof LegacyChannelIdentifier
|
||||
|| identifier instanceof MinecraftChannelIdentifier,
|
||||
"identifier is unknown");
|
||||
|| identifier instanceof MinecraftChannelIdentifier, "identifier is unknown");
|
||||
}
|
||||
|
||||
for (ChannelIdentifier identifier : identifiers) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren