Cleanup some formatting

This commit is contained in:
md_5
2025-07-19 10:43:44 +10:00
parent df53053677
commit 8e99a4c5bf
13 changed files with 37 additions and 26 deletions

View File

@@ -87,8 +87,10 @@ public interface Connection
/** /**
* Queue a packet to this connection. * Queue a packet to this connection.
* If the packet is not registered for the connections current encoder protocol, it will be queued until it is, *
* otherwise it will be sent immediately. * If the packet is not registered for the connections current encoder
* protocol, it will be queued until it is, otherwise it will be sent
* immediately.
* *
* @param packet the packet to be queued * @param packet the packet to be queued
* @throws UnsupportedOperationException if used for a PendingConnection * @throws UnsupportedOperationException if used for a PendingConnection

View File

@@ -386,6 +386,7 @@ public interface ProxiedPlayer extends Connection, CommandSender
/** /**
* Gets the client brand of this player. * Gets the client brand of this player.
*
* If the player has not sent a brand packet yet, it will return null. * If the player has not sent a brand packet yet, it will return null.
* *
* @return the brand of the client, or null if not received yet * @return the brand of the client, or null if not received yet

View File

@@ -474,8 +474,7 @@ public final class PluginManager
{ {
for ( Method method : listener.getClass().getDeclaredMethods() ) for ( Method method : listener.getClass().getDeclaredMethods() )
{ {
Preconditions.checkArgument( !method.isAnnotationPresent( Subscribe.class ), Preconditions.checkArgument( !method.isAnnotationPresent( Subscribe.class ), "Listener %s has registered using deprecated subscribe annotation! Please update to @EventHandler.", listener );
"Listener %s has registered using deprecated subscribe annotation! Please update to @EventHandler.", listener );
} }
eventBus.register( listener ); eventBus.register( listener );
listenersByPlugin.put( plugin, listener ); listenersByPlugin.put( plugin, listener );

View File

@@ -313,8 +313,9 @@ public abstract class BaseComponent
} }
/** /**
* Returns the shadow color of this component. This uses the parent's shadow color if this * Returns the shadow color of this component. This uses the parent's shadow
* component doesn't have one. null is returned if no shadow color is found. * color if this component doesn't have one. null is returned if no shadow
* color is found.
* *
* @return the shadow color of this component * @return the shadow color of this component
*/ */

View File

@@ -38,7 +38,8 @@ public final class DialogListDialog implements Dialog
*/ */
private Integer columns; private Integer columns;
/** /**
* The width of the dialog buttons (default: 150, minimum: 1, maximum: 1024). * The width of the dialog buttons (default: 150, minimum: 1, maximum:
* 1024).
*/ */
@SerializedName("button_width") @SerializedName("button_width")
private Integer buttonWidth; private Integer buttonWidth;

View File

@@ -37,7 +37,8 @@ public final class ServerLinksDialog implements Dialog
*/ */
private Integer columns; private Integer columns;
/** /**
* The width of the dialog buttons (default: 150, minimum: 1, maximum: 1024). * The width of the dialog buttons (default: 150, minimum: 1, maximum:
* 1024).
*/ */
@SerializedName("button_width") @SerializedName("button_width")
private Integer buttonWidth; private Integer buttonWidth;

View File

@@ -6,8 +6,8 @@ import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
/** /**
* Executes a command. If the command requires a permission * Executes a command. If the command requires a permission higher than 0, a
* higher than 0, a confirmation dialog will be shown by the client. * confirmation dialog will be shown by the client.
*/ */
@Data @Data
@Accessors(fluent = true) @Accessors(fluent = true)

View File

@@ -81,9 +81,8 @@ public interface Tag
void write(DataOutput output) throws IOException; void write(DataOutput output) throws IOException;
/** /**
* Reads a {@link Tag} from the given {@link DataInput}, * Reads a {@link Tag} from the given {@link DataInput}, based on the
* based on the specified tag type, with limitations of the * specified tag type, with limitations of the {@link NBTLimiter}.
* {@link NBTLimiter}.
* *
* @param id the nbt type * @param id the nbt type
* @param input the input to read from * @param input the input to read from
@@ -104,8 +103,8 @@ public interface Tag
} }
/** /**
* Reads a {@link NamedTag} from the given {@link DataInput}, * Reads a {@link NamedTag} from the given {@link DataInput}, with
* with limitations of the {@link NBTLimiter}. * limitations of the {@link NBTLimiter}.
* *
* @param input the data input to read from * @param input the data input to read from
* @param limiter the limiter for this read operation * @param limiter the limiter for this read operation
@@ -120,8 +119,8 @@ public interface Tag
} }
/** /**
* Serializes the given {@link TypedTag} into a byte array. * Serializes the given {@link TypedTag} into a byte array. This is the
* This is the inverse operation of {@link #fromByteArray(byte[])}. * inverse operation of {@link #fromByteArray(byte[])}.
* *
* @param tag the tag to convert * @param tag the tag to convert
* @return the serialized byte array * @return the serialized byte array
@@ -137,8 +136,8 @@ public interface Tag
} }
/** /**
* Deserializes the given byte array into a {@link TypedTag}. * Deserializes the given byte array into a {@link TypedTag}. This is the
* This is the inverse operation of {@link #toByteArray(TypedTag)}. * inverse operation of {@link #toByteArray(TypedTag)}.
* *
* @param data the byte array to read from * @param data the byte array to read from
* @return the deserialized {@link TypedTag} * @return the deserialized {@link TypedTag}
@@ -150,8 +149,8 @@ public interface Tag
} }
/** /**
* Deserializes the given byte array into a {@link TypedTag}, * Deserializes the given byte array into a {@link TypedTag}, with
* with limitations of the {@link NBTLimiter}. * limitations of the {@link NBTLimiter}.
* *
* @param data the byte array to read from * @param data the byte array to read from
* @param limiter the limiter for this read operation * @param limiter the limiter for this read operation

View File

@@ -7,8 +7,11 @@ import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* This class hold a netty channel initializer that calls the given {@link ChannelAcceptor}. * This class hold a netty channel initializer that calls the given
* Use {@link BungeeChannelInitializer#create(ChannelAcceptor)} to create a new instance. * {@link ChannelAcceptor}.
*
* Use {@link BungeeChannelInitializer#create(ChannelAcceptor)} to create a new
* instance.
* <p> * <p>
* Please note that this API is unsafe and doesn't provide any guarantees about * Please note that this API is unsafe and doesn't provide any guarantees about
* the stability of the channel pipeline or the API itself. Use at your own * the stability of the channel pipeline or the API itself. Use at your own

View File

@@ -13,10 +13,12 @@ import net.md_5.bungee.protocol.DefinedPacket;
/** /**
* prepends length of message and optionally compresses message beforehand * prepends length of message and optionally compresses message beforehand
* <br> * <br>
* combining these operations allows to keep space infront of compressed data for length varint * combining these operations allows to keep space infront of compressed data
* for length varint
*/ */
public class LengthPrependerAndCompressor extends MessageToMessageEncoder<ByteBuf> public class LengthPrependerAndCompressor extends MessageToMessageEncoder<ByteBuf>
{ {
// reasonable to not support length varints > 4 byte (268435455 byte > 268MB) // reasonable to not support length varints > 4 byte (268435455 byte > 268MB)
// if ever changed to smaller than 4, also change varintSize method to check for that // if ever changed to smaller than 4, also change varintSize method to check for that
private static final byte MAX_SUPPORTED_VARINT_LENGTH_LEN = 4; private static final byte MAX_SUPPORTED_VARINT_LENGTH_LEN = 4;

View File

@@ -20,11 +20,12 @@ public class ClickEventSerializer
public static final ClickEventSerializer NEW = new ClickEventSerializer( ClickType.NEW ); public static final ClickEventSerializer NEW = new ClickEventSerializer( ClickType.NEW );
public static final ClickEventSerializer DIALOG = new ClickEventSerializer( ClickType.DIALOG ); public static final ClickEventSerializer DIALOG = new ClickEventSerializer( ClickType.DIALOG );
// //
private final ClickType type;
public enum ClickType public enum ClickType
{ {
OLD, NEW, DIALOG; OLD, NEW, DIALOG;
} }
private final ClickType type;
public ClickEvent deserialize(JsonObject clickEvent, JsonDeserializationContext context) throws JsonParseException public ClickEvent deserialize(JsonObject clickEvent, JsonDeserializationContext context) throws JsonParseException
{ {

View File

@@ -265,7 +265,7 @@ public class VersionedComponentSerializer implements JsonDeserializer<BaseCompon
if ( json.isJsonArray() ) if ( json.isJsonArray() )
{ {
JsonArray arr = json.getAsJsonArray(); JsonArray arr = json.getAsJsonArray();
BaseComponent[] components = new BaseComponent[arr.size()]; BaseComponent[] components = new BaseComponent[ arr.size() ];
for ( int i = 0; i < arr.size(); i++ ) for ( int i = 0; i < arr.size(); i++ )
{ {
components[i] = deserialize( arr.get( i ), BaseComponent.class, context ); components[i] = deserialize( arr.get( i ), BaseComponent.class, context );

View File

@@ -29,6 +29,7 @@ import net.md_5.bungee.chat.VersionedComponentSerializer;
@RequiredArgsConstructor @RequiredArgsConstructor
public class DialogSerializer implements JsonDeserializer<Dialog>, JsonSerializer<Dialog> public class DialogSerializer implements JsonDeserializer<Dialog>, JsonSerializer<Dialog>
{ {
private static final ThreadLocal<Set<Dialog>> serializedDialogs = new ThreadLocal<>(); private static final ThreadLocal<Set<Dialog>> serializedDialogs = new ThreadLocal<>();
private static final BiMap<String, Class<? extends Dialog>> TYPES; private static final BiMap<String, Class<? extends Dialog>> TYPES;
private final VersionedComponentSerializer serializer; private final VersionedComponentSerializer serializer;