Compare commits
36 Commits
3aab2fa1e1
...
16646efb3c
Author | SHA1 | Date | |
---|---|---|---|
16646efb3c | |||
ec1e8483b9 | |||
d39b527c3e | |||
af9e6d9118 | |||
da736d8ad9 | |||
57da3ee6ca | |||
![]() |
296b31bd56 | ||
![]() |
8f6768ae00 | ||
![]() |
70603d5413 | ||
![]() |
2e12caad03 | ||
![]() |
f9ce9fad28 | ||
![]() |
69b476fcbc | ||
![]() |
d37a430f5a | ||
![]() |
4c02676b7a | ||
![]() |
a2558484f5 | ||
![]() |
97c6167272 | ||
![]() |
c2162eeddb | ||
![]() |
0124b66918 | ||
![]() |
7be06f141d | ||
![]() |
01048b4fca | ||
![]() |
d2a317eee2 | ||
![]() |
0be632a4d6 | ||
![]() |
f27f4fbca9 | ||
![]() |
e62fc6c291 | ||
![]() |
8e99a4c5bf | ||
![]() |
df53053677 | ||
![]() |
4cd9a17a40 | ||
![]() |
e9558ab370 | ||
![]() |
3a5c731826 | ||
![]() |
c13e6df67e | ||
![]() |
704e866413 | ||
![]() |
aea5870ac8 | ||
![]() |
f1a4a42d51 | ||
![]() |
a485d9f314 | ||
![]() |
131125c7d2 | ||
![]() |
7fcc62067b |
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
java: [8, 11, 17, 21, 25-ea]
|
java: [8, 11, 17, 21, 25]
|
||||||
|
|
||||||
name: Java ${{ matrix.java }}
|
name: Java ${{ matrix.java }}
|
||||||
|
|
||||||
|
23
api/pom.xml
23
api/pom.xml
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-api</artifactId>
|
<artifactId>bungeecord-api</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-API</name>
|
<name>BungeeCord-API</name>
|
||||||
@@ -20,31 +19,31 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-chat</artifactId>
|
<artifactId>bungeecord-chat</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-config</artifactId>
|
<artifactId>bungeecord-config</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-dialog</artifactId>
|
<artifactId>bungeecord-dialog</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-event</artifactId>
|
<artifactId>bungeecord-event</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-protocol</artifactId>
|
<artifactId>bungeecord-protocol</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
@@ -75,6 +74,12 @@
|
|||||||
<!-- not part of the API proper -->
|
<!-- not part of the API proper -->
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.ow2.asm</groupId>
|
||||||
|
<artifactId>asm-commons</artifactId>
|
||||||
|
<version>9.8</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.yaml</groupId>
|
<groupId>org.yaml</groupId>
|
||||||
<artifactId>snakeyaml</artifactId>
|
<artifactId>snakeyaml</artifactId>
|
||||||
|
77
api/src/main/java/net/md_5/bungee/api/ServerLink.java
Normal file
77
api/src/main/java/net/md_5/bungee/api/ServerLink.java
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
package net.md_5.bungee.api;
|
||||||
|
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a server link which may be sent to the client.
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
|
public final class ServerLink
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The links type.
|
||||||
|
*
|
||||||
|
* Note: This value is nullable, if null, label is non-null.
|
||||||
|
*/
|
||||||
|
private final LinkType type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The label for the link.
|
||||||
|
*
|
||||||
|
* Note: This value is nullable, if null, type is non-null.
|
||||||
|
*/
|
||||||
|
private final BaseComponent label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL that is displayed.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
private final String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a link with a specified type and URL.
|
||||||
|
*
|
||||||
|
* @param type the type of the link
|
||||||
|
* @param url the URL to be displayed
|
||||||
|
*/
|
||||||
|
public ServerLink(@NonNull LinkType type, @NonNull String url)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
this.label = null;
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a link with a label and URL.
|
||||||
|
*
|
||||||
|
* @param label the label to be displayed
|
||||||
|
* @param url the URL to be displayed
|
||||||
|
*/
|
||||||
|
public ServerLink(@NonNull BaseComponent label, @NonNull String url)
|
||||||
|
{
|
||||||
|
this.type = null;
|
||||||
|
this.label = label;
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum LinkType
|
||||||
|
{
|
||||||
|
|
||||||
|
REPORT_BUG,
|
||||||
|
COMMUNITY_GUIDELINES,
|
||||||
|
SUPPORT,
|
||||||
|
STATUS,
|
||||||
|
FEEDBACK,
|
||||||
|
COMMUNITY,
|
||||||
|
WEBSITE,
|
||||||
|
FORUMS,
|
||||||
|
NEWS,
|
||||||
|
ANNOUNCEMENTS;
|
||||||
|
}
|
||||||
|
}
|
@@ -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
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package net.md_5.bungee.api.connection;
|
package net.md_5.bungee.api.connection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -8,6 +9,7 @@ import net.md_5.bungee.api.Callback;
|
|||||||
import net.md_5.bungee.api.ChatMessageType;
|
import net.md_5.bungee.api.ChatMessageType;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ServerConnectRequest;
|
import net.md_5.bungee.api.ServerConnectRequest;
|
||||||
|
import net.md_5.bungee.api.ServerLink;
|
||||||
import net.md_5.bungee.api.SkinConfiguration;
|
import net.md_5.bungee.api.SkinConfiguration;
|
||||||
import net.md_5.bungee.api.Title;
|
import net.md_5.bungee.api.Title;
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
@@ -386,6 +388,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
|
||||||
@@ -410,4 +413,16 @@ public interface ProxiedPlayer extends Connection, CommandSender
|
|||||||
*/
|
*/
|
||||||
@ApiStatus.Experimental
|
@ApiStatus.Experimental
|
||||||
void showDialog(Dialog dialog);
|
void showDialog(Dialog dialog);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends server links to the player.
|
||||||
|
*
|
||||||
|
* Note: The links already sent to the player will be overwritten. Also, the
|
||||||
|
* backend server is able to override links sent by the proxy.
|
||||||
|
*
|
||||||
|
* @param serverLinks the server links to send
|
||||||
|
* @throws IllegalStateException if the player's version is not at least
|
||||||
|
* 1.21
|
||||||
|
*/
|
||||||
|
void sendServerLinks(List<ServerLink> serverLinks);
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,157 @@
|
|||||||
|
package net.md_5.bungee.api.event;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.arguments.ArgumentType;
|
||||||
|
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||||
|
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||||
|
import com.mojang.brigadier.builder.ArgumentBuilder;
|
||||||
|
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
|
||||||
|
import com.mojang.brigadier.suggestion.SuggestionProvider;
|
||||||
|
import com.mojang.brigadier.tree.CommandNode;
|
||||||
|
import com.mojang.brigadier.tree.RootCommandNode;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import net.md_5.bungee.api.CommandSender;
|
||||||
|
import net.md_5.bungee.api.connection.Connection;
|
||||||
|
import net.md_5.bungee.api.plugin.Command;
|
||||||
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
|
import net.md_5.bungee.api.plugin.PluginManager;
|
||||||
|
import net.md_5.bungee.api.plugin.TabExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event called when a downstream server (on 1.13+) sends the command structure
|
||||||
|
* to a player, but before BungeeCord adds the dummy command nodes of
|
||||||
|
* registered commands.
|
||||||
|
* <p>
|
||||||
|
* BungeeCord will not overwrite the modifications made by the listeners.
|
||||||
|
*
|
||||||
|
* <h2>Usage example</h2>
|
||||||
|
* Here is a usage example of this event, to declare a command structure.
|
||||||
|
* This illustrates the commands /server and /send of Bungee.
|
||||||
|
* <pre>
|
||||||
|
* event.getRoot().addChild( LiteralArgumentBuilder.<CommandSender>literal( "server" )
|
||||||
|
* .requires( sender -> sender.hasPermission( "bungeecord.command.server" ) )
|
||||||
|
* .executes( a -> 0 )
|
||||||
|
* .then( RequiredArgumentBuilder.argument( "serverName", StringArgumentType.greedyString() )
|
||||||
|
* .suggests( SuggestionRegistry.ASK_SERVER )
|
||||||
|
* )
|
||||||
|
* .build()
|
||||||
|
* );
|
||||||
|
* event.getRoot().addChild( LiteralArgumentBuilder.<CommandSender>literal( "send" )
|
||||||
|
* .requires( sender -> sender.hasPermission( "bungeecord.command.send" ) )
|
||||||
|
* .then( RequiredArgumentBuilder.argument( "playerName", StringArgumentType.word() )
|
||||||
|
* .suggests( SuggestionRegistry.ASK_SERVER )
|
||||||
|
* .then( RequiredArgumentBuilder.argument( "serverName", StringArgumentType.greedyString() )
|
||||||
|
* .suggests( SuggestionRegistry.ASK_SERVER )
|
||||||
|
* )
|
||||||
|
* )
|
||||||
|
* .build()
|
||||||
|
* );
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <h2>Flag a {@link CommandNode} as executable or not</h2>
|
||||||
|
* The implementation of a {@link com.mojang.brigadier.Command Command} used in
|
||||||
|
* {@link ArgumentBuilder#executes(com.mojang.brigadier.Command)} will never be
|
||||||
|
* executed. This will only tell to the client if the current node is
|
||||||
|
* executable or not.
|
||||||
|
* <ul>
|
||||||
|
* <li>
|
||||||
|
* {@code builder.executes(null)} (default) to mark the node as not
|
||||||
|
* executable.
|
||||||
|
* </li>
|
||||||
|
* <li>
|
||||||
|
* {@code builder.executes(a -> 0)}, or any non null argument, to mark
|
||||||
|
* the node as executable (the child arguments are displayed as
|
||||||
|
* optional).
|
||||||
|
* </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* <h2>{@link CommandNode}’s suggestions management</h2>
|
||||||
|
* The implementation of a SuggestionProvider used in
|
||||||
|
* {@link RequiredArgumentBuilder#suggests(SuggestionProvider)} will never be
|
||||||
|
* executed. This will only tell to the client how to deal with the
|
||||||
|
* auto-completion of the argument.
|
||||||
|
* <ul>
|
||||||
|
* <li>
|
||||||
|
* {@code builder.suggests(null)} (default) to disable auto-completion
|
||||||
|
* for this argument.
|
||||||
|
* </li>
|
||||||
|
* <li>
|
||||||
|
* {@code builder.suggests(SuggestionRegistry.ALL_RECIPES)} to suggest
|
||||||
|
* Minecraft’s recipes.
|
||||||
|
* </li>
|
||||||
|
* <li>
|
||||||
|
* {@code builder.suggests(SuggestionRegistry.AVAILABLE_SOUNDS)} to
|
||||||
|
* suggest Minecraft’s default sound identifiers.
|
||||||
|
* </li>
|
||||||
|
* <li>
|
||||||
|
* {@code builder.suggests(SuggestionRegistry.SUMMONABLE_ENTITIES)} to
|
||||||
|
* suggest Minecraft’s default summonable entities identifiers.
|
||||||
|
* </li>
|
||||||
|
* <li>
|
||||||
|
* {@code builder.suggests(SuggestionRegistry.ASK_SERVER)}, or any
|
||||||
|
* other non null argument, to make the Minecraft client ask
|
||||||
|
* auto-completion to the server. Any specified implementation of
|
||||||
|
* {@link SuggestionProvider} will never be executed.
|
||||||
|
* </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* <h2>Argument types</h2>
|
||||||
|
* When building a new argument command node using
|
||||||
|
* {@link RequiredArgumentBuilder#argument(String, ArgumentType)}, you have to
|
||||||
|
* specify an {@link ArgumentType}. You can use all subclasses of
|
||||||
|
* {@link ArgumentType} provided with brigadier (for instance,
|
||||||
|
* {@link StringArgumentType} or {@link IntegerArgumentType}), or call any
|
||||||
|
* {@code ArgumentRegistry.minecraft*()} methods to use a {@code minecraft:*}
|
||||||
|
* argument type.
|
||||||
|
*
|
||||||
|
* <h2>Limitations with brigadier API</h2>
|
||||||
|
* This event is only used for the client to show command syntax, suggest
|
||||||
|
* sub-commands and color the arguments in the chat box. The command execution
|
||||||
|
* needs to be implemented using {@link PluginManager#registerCommand(Plugin,
|
||||||
|
* Command)} and the server-side tab-completion using {@link TabCompleteEvent}
|
||||||
|
* or {@link TabExecutor}.
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CommandsDeclareEvent extends TargetedEvent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Wether or not the command tree is modified by this event.
|
||||||
|
*
|
||||||
|
* If this value is set to true, BungeeCord will ensure that the
|
||||||
|
* modifications made in the command tree, will be sent to the player.
|
||||||
|
* If this is false, the modifications may not be taken into account.
|
||||||
|
*
|
||||||
|
* When calling {@link #getRoot()}, this value is automatically set
|
||||||
|
* to true.
|
||||||
|
*/
|
||||||
|
@Setter(value = AccessLevel.NONE)
|
||||||
|
private boolean modified = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The root command node of the command structure that will be send to the
|
||||||
|
* player.
|
||||||
|
*/
|
||||||
|
private final RootCommandNode<CommandSender> root;
|
||||||
|
|
||||||
|
public CommandsDeclareEvent(Connection sender, Connection receiver, RootCommandNode<CommandSender> root)
|
||||||
|
{
|
||||||
|
super( sender, receiver );
|
||||||
|
this.root = root;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The root command node of the command structure that will be send to the
|
||||||
|
* player.
|
||||||
|
* @return The root command node
|
||||||
|
*/
|
||||||
|
public RootCommandNode<CommandSender> getRoot()
|
||||||
|
{
|
||||||
|
modified = true;
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
}
|
@@ -9,7 +9,9 @@ import net.md_5.bungee.api.plugin.Cancellable;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Event called when a player uses tab completion.
|
* Event called when a player uses tab completion.
|
||||||
|
* @deprecated please use {@link TabCompleteRequestEvent} to support 1.13+ suggestions.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
@Data
|
@Data
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@@ -0,0 +1,85 @@
|
|||||||
|
package net.md_5.bungee.api.event;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
|
import com.mojang.brigadier.context.StringRange;
|
||||||
|
import com.mojang.brigadier.suggestion.Suggestions;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import net.md_5.bungee.api.connection.Connection;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.plugin.Cancellable;
|
||||||
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event called when a player uses tab completion.
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class TabCompleteRequestEvent extends TargetedEvent implements Cancellable
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancelled state.
|
||||||
|
*/
|
||||||
|
private boolean cancelled;
|
||||||
|
/**
|
||||||
|
* The message the player has already entered.
|
||||||
|
*/
|
||||||
|
private final String cursor;
|
||||||
|
/**
|
||||||
|
* Range corresponding to the last word of {@link #getCursor()}.
|
||||||
|
* If you want your suggestions to be compatible with 1.12 and older
|
||||||
|
* clients, you need to {@link #setSuggestions(Suggestions)} with
|
||||||
|
* a range equals to this one.
|
||||||
|
* For 1.13 and newer clients, any other range that cover any part of
|
||||||
|
* {@link #getCursor()} is fine.<br>
|
||||||
|
* To check if the client supports custom ranges, use
|
||||||
|
* {@link #supportsCustomRange()}.
|
||||||
|
*/
|
||||||
|
private final StringRange legacyCompatibleRange;
|
||||||
|
/**
|
||||||
|
* The suggestions that will be sent to the client. If this list is empty,
|
||||||
|
* the request will be forwarded to the server.
|
||||||
|
*/
|
||||||
|
private Suggestions suggestions;
|
||||||
|
|
||||||
|
public TabCompleteRequestEvent(Connection sender, Connection receiver, String cursor, StringRange legacyCompatibleRange, Suggestions suggestions)
|
||||||
|
{
|
||||||
|
super( sender, receiver );
|
||||||
|
this.cursor = cursor;
|
||||||
|
this.legacyCompatibleRange = legacyCompatibleRange;
|
||||||
|
this.suggestions = suggestions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the suggestions that will be sent to the client.
|
||||||
|
* If this list is empty, the request will be forwarded to the server.
|
||||||
|
* @param suggestions the new Suggestions. Cannot be null.
|
||||||
|
* @throws IllegalArgumentException if the client is on 1.12 or lower and
|
||||||
|
* {@code suggestions.getRange()} is not equals to {@link #legacyCompatibleRange}.
|
||||||
|
*/
|
||||||
|
public void setSuggestions(Suggestions suggestions)
|
||||||
|
{
|
||||||
|
Preconditions.checkNotNull( suggestions );
|
||||||
|
Preconditions.checkArgument( supportsCustomRange() || legacyCompatibleRange.equals( suggestions.getRange() ),
|
||||||
|
"Clients on 1.12 or lower versions don't support the provided range for tab-completion: " + suggestions.getRange()
|
||||||
|
+ ". Please use TabCompleteRequestEvent.getLegacyCompatibleRange() for legacy clients." );
|
||||||
|
this.suggestions = suggestions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenient method to tell if the client supports custom range for
|
||||||
|
* suggestions.
|
||||||
|
* If the client is on 1.13 or above, this methods returns true, and any
|
||||||
|
* range can be used for {@link #setSuggestions(Suggestions)}. Otherwise,
|
||||||
|
* it returns false and the defined range must be equals to
|
||||||
|
* {@link #legacyCompatibleRange}.
|
||||||
|
* @return true if the client is on 1.13 or newer version, false otherwise.
|
||||||
|
*/
|
||||||
|
public boolean supportsCustomRange()
|
||||||
|
{
|
||||||
|
return ( (ProxiedPlayer) getSender() ).getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13;
|
||||||
|
}
|
||||||
|
}
|
@@ -11,6 +11,7 @@ import lombok.Getter;
|
|||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.config.ConfigurationAdapter;
|
import net.md_5.bungee.api.config.ConfigurationAdapter;
|
||||||
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
||||||
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents any Plugin that may be loaded at runtime to enhance existing
|
* Represents any Plugin that may be loaded at runtime to enhance existing
|
||||||
@@ -108,7 +109,14 @@ public class Plugin
|
|||||||
//
|
//
|
||||||
private ExecutorService service;
|
private ExecutorService service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the executor service associated with this plugin.
|
||||||
|
*
|
||||||
|
* @return the executor service for this plugin
|
||||||
|
* @deprecated internal API. Use {@link ProxyServer#getScheduler()} instead
|
||||||
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ApiStatus.Internal
|
||||||
public ExecutorService getExecutorService()
|
public ExecutorService getExecutorService()
|
||||||
{
|
{
|
||||||
if ( service == null )
|
if ( service == null )
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package net.md_5.bungee.api.plugin;
|
package net.md_5.bungee.api.plugin;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -9,13 +10,20 @@ import java.net.URL;
|
|||||||
import java.net.URLClassLoader;
|
import java.net.URLClassLoader;
|
||||||
import java.security.CodeSigner;
|
import java.security.CodeSigner;
|
||||||
import java.security.CodeSource;
|
import java.security.CodeSource;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CopyOnWriteArraySet;
|
import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
import java.util.jar.Manifest;
|
import java.util.jar.Manifest;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import org.objectweb.asm.ClassReader;
|
||||||
|
import org.objectweb.asm.ClassWriter;
|
||||||
|
import org.objectweb.asm.commons.ClassRemapper;
|
||||||
|
import org.objectweb.asm.commons.SimpleRemapper;
|
||||||
|
|
||||||
@ToString(of = "desc")
|
@ToString(of = "desc")
|
||||||
final class PluginClassloader extends URLClassLoader
|
final class PluginClassloader extends URLClassLoader
|
||||||
@@ -121,6 +129,15 @@ final class PluginClassloader extends URLClassLoader
|
|||||||
throw new ClassNotFoundException( name, ex );
|
throw new ClassNotFoundException( name, ex );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
classBytes = remap( classBytes );
|
||||||
|
} catch ( Exception ex )
|
||||||
|
{
|
||||||
|
Logger logger = ( plugin != null ) ? plugin.getLogger() : proxy.getLogger();
|
||||||
|
logger.log( Level.SEVERE, "Error trying to remap class " + path, ex );
|
||||||
|
}
|
||||||
|
|
||||||
int dot = name.lastIndexOf( '.' );
|
int dot = name.lastIndexOf( '.' );
|
||||||
if ( dot != -1 )
|
if ( dot != -1 )
|
||||||
{
|
{
|
||||||
@@ -155,6 +172,27 @@ final class PluginClassloader extends URLClassLoader
|
|||||||
return super.findClass( name );
|
return super.findClass( name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Map<String, String> MAPPINGS = ImmutableMap.of(
|
||||||
|
"net/md_5/bungee/protocol/ChatChain", "net/md_5/bungee/protocol/data/ChatChain",
|
||||||
|
"net/md_5/bungee/protocol/Location", "net/md_5/bungee/protocol/data/Location",
|
||||||
|
"net/md_5/bungee/protocol/NumberFormat", "net/md_5/bungee/protocol/data/NumberFormat",
|
||||||
|
"net/md_5/bungee/protocol/PlayerPublicKey", "net/md_5/bungee/protocol/data/PlayerPublicKey",
|
||||||
|
"net/md_5/bungee/protocol/Property", "net/md_5/bungee/protocol/data/Property",
|
||||||
|
"net/md_5/bungee/protocol/SeenMessages", "net/md_5/bungee/protocol/data/SeenMessages",
|
||||||
|
"net/md_5/bungee/protocol/Either", "net/md_5/bungee/protocol/util/Either",
|
||||||
|
"net/md_5/bungee/protocol/TagUtil", "net/md_5/bungee/protocol/util/TagUtil"
|
||||||
|
);
|
||||||
|
|
||||||
|
private static byte[] remap(byte[] b)
|
||||||
|
{
|
||||||
|
ClassReader cr = new ClassReader( b );
|
||||||
|
ClassWriter cw = new ClassWriter( cr, 0 );
|
||||||
|
|
||||||
|
cr.accept( new ClassRemapper( cw, new SimpleRemapper( MAPPINGS ) ), 0 );
|
||||||
|
|
||||||
|
return cw.toByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException
|
public void close() throws IOException
|
||||||
{
|
{
|
||||||
|
@@ -30,6 +30,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import lombok.Locked;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
@@ -98,10 +99,8 @@ public final class PluginManager
|
|||||||
* @param plugin the plugin owning this command
|
* @param plugin the plugin owning this command
|
||||||
* @param command the command to register
|
* @param command the command to register
|
||||||
*/
|
*/
|
||||||
|
@Locked.Write("commandsLock")
|
||||||
public void registerCommand(Plugin plugin, Command command)
|
public void registerCommand(Plugin plugin, Command command)
|
||||||
{
|
|
||||||
commandsLock.writeLock().lock();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
commandMap.put( command.getName().toLowerCase( Locale.ROOT ), command );
|
commandMap.put( command.getName().toLowerCase( Locale.ROOT ), command );
|
||||||
for ( String alias : command.getAliases() )
|
for ( String alias : command.getAliases() )
|
||||||
@@ -109,10 +108,6 @@ public final class PluginManager
|
|||||||
commandMap.put( alias.toLowerCase( Locale.ROOT ), command );
|
commandMap.put( alias.toLowerCase( Locale.ROOT ), command );
|
||||||
}
|
}
|
||||||
commandsByPlugin.put( plugin, command );
|
commandsByPlugin.put( plugin, command );
|
||||||
} finally
|
|
||||||
{
|
|
||||||
commandsLock.writeLock().unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,17 +115,11 @@ public final class PluginManager
|
|||||||
*
|
*
|
||||||
* @param command the command to unregister
|
* @param command the command to unregister
|
||||||
*/
|
*/
|
||||||
|
@Locked.Write("commandsLock")
|
||||||
public void unregisterCommand(Command command)
|
public void unregisterCommand(Command command)
|
||||||
{
|
|
||||||
commandsLock.writeLock().lock();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
while ( commandMap.values().remove( command ) );
|
while ( commandMap.values().remove( command ) );
|
||||||
commandsByPlugin.values().remove( command );
|
commandsByPlugin.values().remove( command );
|
||||||
} finally
|
|
||||||
{
|
|
||||||
commandsLock.writeLock().unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,10 +127,8 @@ public final class PluginManager
|
|||||||
*
|
*
|
||||||
* @param plugin the plugin to register the commands of
|
* @param plugin the plugin to register the commands of
|
||||||
*/
|
*/
|
||||||
|
@Locked.Write("commandsLock")
|
||||||
public void unregisterCommands(Plugin plugin)
|
public void unregisterCommands(Plugin plugin)
|
||||||
{
|
|
||||||
commandsLock.writeLock().lock();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
for ( Iterator<Command> it = commandsByPlugin.get( plugin ).iterator(); it.hasNext(); )
|
for ( Iterator<Command> it = commandsByPlugin.get( plugin ).iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
@@ -149,10 +136,6 @@ public final class PluginManager
|
|||||||
while ( commandMap.values().remove( command ) );
|
while ( commandMap.values().remove( command ) );
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
} finally
|
|
||||||
{
|
|
||||||
commandsLock.writeLock().unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Command getCommandIfEnabled(String commandName, CommandSender sender)
|
private Command getCommandIfEnabled(String commandName, CommandSender sender)
|
||||||
@@ -467,22 +450,15 @@ public final class PluginManager
|
|||||||
* @param plugin the owning plugin
|
* @param plugin the owning plugin
|
||||||
* @param listener the listener to register events for
|
* @param listener the listener to register events for
|
||||||
*/
|
*/
|
||||||
|
@Locked("listenersLock")
|
||||||
public void registerListener(Plugin plugin, Listener listener)
|
public void registerListener(Plugin plugin, Listener listener)
|
||||||
{
|
|
||||||
listenersLock.lock();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
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 );
|
||||||
} finally
|
|
||||||
{
|
|
||||||
listenersLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -490,17 +466,11 @@ public final class PluginManager
|
|||||||
*
|
*
|
||||||
* @param listener the listener to unregister
|
* @param listener the listener to unregister
|
||||||
*/
|
*/
|
||||||
|
@Locked("listenersLock")
|
||||||
public void unregisterListener(Listener listener)
|
public void unregisterListener(Listener listener)
|
||||||
{
|
|
||||||
listenersLock.lock();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
eventBus.unregister( listener );
|
eventBus.unregister( listener );
|
||||||
listenersByPlugin.values().remove( listener );
|
listenersByPlugin.values().remove( listener );
|
||||||
} finally
|
|
||||||
{
|
|
||||||
listenersLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -508,20 +478,14 @@ public final class PluginManager
|
|||||||
*
|
*
|
||||||
* @param plugin target plugin
|
* @param plugin target plugin
|
||||||
*/
|
*/
|
||||||
|
@Locked("listenersLock")
|
||||||
public void unregisterListeners(Plugin plugin)
|
public void unregisterListeners(Plugin plugin)
|
||||||
{
|
|
||||||
listenersLock.lock();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
for ( Iterator<Listener> it = listenersByPlugin.get( plugin ).iterator(); it.hasNext(); )
|
for ( Iterator<Listener> it = listenersByPlugin.get( plugin ).iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
eventBus.unregister( it.next() );
|
eventBus.unregister( it.next() );
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
} finally
|
|
||||||
{
|
|
||||||
listenersLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -529,16 +493,10 @@ public final class PluginManager
|
|||||||
*
|
*
|
||||||
* @return commands
|
* @return commands
|
||||||
*/
|
*/
|
||||||
|
@Locked.Read("commandsLock")
|
||||||
public Collection<Map.Entry<String, Command>> getCommands()
|
public Collection<Map.Entry<String, Command>> getCommands()
|
||||||
{
|
|
||||||
commandsLock.readLock().lock();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
return Collections.unmodifiableCollection( commandMap.entrySet() );
|
return Collections.unmodifiableCollection( commandMap.entrySet() );
|
||||||
} finally
|
|
||||||
{
|
|
||||||
commandsLock.readLock().unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isTransitiveDepend(PluginDescription plugin, PluginDescription depend)
|
boolean isTransitiveDepend(PluginDescription plugin, PluginDescription depend)
|
||||||
|
@@ -4,31 +4,29 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-bootstrap</artifactId>
|
<artifactId>bungeecord-bootstrap</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Bootstrap</name>
|
<name>BungeeCord-Bootstrap</name>
|
||||||
<description>Java 1.6 loader for BungeeCord</description>
|
<description>Java 1.6 loader for BungeeCord</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
<skipPublishing>true</skipPublishing>
|
||||||
<maven.deploy.skip>true</maven.deploy.skip>
|
<maven.deploy.skip>true</maven.deploy.skip>
|
||||||
<maven.javadoc.skip>true</maven.javadoc.skip>
|
<maven.javadoc.skip>true</maven.javadoc.skip>
|
||||||
<maven.compiler.source>1.6</maven.compiler.source>
|
|
||||||
<maven.compiler.target>1.6</maven.compiler.target>
|
|
||||||
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
|
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-proxy</artifactId>
|
<artifactId>bungeecord-proxy</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
@@ -36,7 +34,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>BungeeCord</finalName>
|
<finalName>BungeeCord-${project.version}-${build.number}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-chat</artifactId>
|
<artifactId>bungeecord-chat</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Chat</name>
|
<name>BungeeCord-Chat</name>
|
||||||
|
@@ -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
|
||||||
*/
|
*/
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package net.md_5.bungee.api.chat;
|
package net.md_5.bungee.api.chat;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -351,6 +352,19 @@ public final class ComponentBuilder
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the shadow color of the current part.
|
||||||
|
*
|
||||||
|
* @param color the new shadow color
|
||||||
|
* @return this ComponentBuilder for chaining
|
||||||
|
* @since Minecraft 1.21.4-pre1
|
||||||
|
*/
|
||||||
|
public ComponentBuilder shadowColor(Color color)
|
||||||
|
{
|
||||||
|
getCurrentComponent().setShadowColor( color );
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the font of the current part.
|
* Sets the font of the current part.
|
||||||
*
|
*
|
||||||
|
@@ -0,0 +1,73 @@
|
|||||||
|
package net.md_5.bungee.api.chat;
|
||||||
|
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import net.md_5.bungee.api.chat.objects.ChatObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An object component that can be used to display objects.
|
||||||
|
* <p>
|
||||||
|
* It can either display a player's head or an object by a specific sprite and
|
||||||
|
* an atlas.
|
||||||
|
* <p>
|
||||||
|
* Note: this was added in Minecraft 1.21.9.
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public final class ObjectComponent extends BaseComponent
|
||||||
|
{
|
||||||
|
|
||||||
|
private ChatObject object;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a ObjectComponent from a given ChatObject.
|
||||||
|
*
|
||||||
|
* See {@link net.md_5.bungee.api.chat.objects.PlayerObject} and
|
||||||
|
* {@link net.md_5.bungee.api.chat.objects.SpriteObject}.
|
||||||
|
*
|
||||||
|
* @param object the ChatObject
|
||||||
|
*/
|
||||||
|
public ObjectComponent(@NonNull ChatObject object)
|
||||||
|
{
|
||||||
|
this.object = object;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an object component from the original to clone it.
|
||||||
|
*
|
||||||
|
* @param original the original for the new score component
|
||||||
|
*/
|
||||||
|
public ObjectComponent(ObjectComponent original)
|
||||||
|
{
|
||||||
|
super( original );
|
||||||
|
setObject( original.object );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ObjectComponent duplicate()
|
||||||
|
{
|
||||||
|
return new ObjectComponent( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void toPlainText(StringVisitor builder)
|
||||||
|
{
|
||||||
|
// I guess we cannot convert this to plain text
|
||||||
|
// builder.append( this.value );
|
||||||
|
super.toPlainText( builder );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void toLegacyText(StringVisitor builder)
|
||||||
|
{
|
||||||
|
addFormat( builder );
|
||||||
|
// Same here...
|
||||||
|
// builder.append( this.value );
|
||||||
|
super.toLegacyText( builder );
|
||||||
|
}
|
||||||
|
}
|
@@ -170,7 +170,7 @@ public final class TextComponent extends BaseComponent
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int pos = message.indexOf( ' ', i );
|
int pos = indexOfSpecial( message, i );
|
||||||
if ( pos == -1 )
|
if ( pos == -1 )
|
||||||
{
|
{
|
||||||
pos = message.length();
|
pos = message.length();
|
||||||
@@ -205,6 +205,20 @@ public final class TextComponent extends BaseComponent
|
|||||||
appender.accept( component );
|
appender.accept( component );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int indexOfSpecial(String message, int pos)
|
||||||
|
{
|
||||||
|
for ( int i = pos; i < message.length(); i++ )
|
||||||
|
{
|
||||||
|
char c = message.charAt( i );
|
||||||
|
|
||||||
|
if ( c == ' ' || Character.isISOControl( c ) )
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal compatibility method to transform an array of components to a
|
* Internal compatibility method to transform an array of components to a
|
||||||
* single component.
|
* single component.
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
package net.md_5.bungee.api.chat.objects;
|
||||||
|
|
||||||
|
public interface ChatObject
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,39 @@
|
|||||||
|
package net.md_5.bungee.api.chat.objects;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import net.md_5.bungee.api.chat.player.Profile;
|
||||||
|
import net.md_5.bungee.api.chat.player.Property;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public final class PlayerObject implements ChatObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The profile of the player.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
private Profile profile;
|
||||||
|
/**
|
||||||
|
* If true, a hat layer will be rendered on the head. (default: true)
|
||||||
|
*/
|
||||||
|
private Boolean hat;
|
||||||
|
|
||||||
|
public PlayerObject(@NonNull String name)
|
||||||
|
{
|
||||||
|
this.profile = new Profile( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerObject(@NonNull UUID uuid)
|
||||||
|
{
|
||||||
|
this.profile = new Profile( uuid );
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerObject(@NonNull Property[] properties)
|
||||||
|
{
|
||||||
|
this.profile = new Profile( properties );
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,21 @@
|
|||||||
|
package net.md_5.bungee.api.chat.objects;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public final class SpriteObject implements ChatObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The namespaced ID of a sprite atlas, default value: minecraft:blocks.
|
||||||
|
*/
|
||||||
|
private String atlas;
|
||||||
|
/**
|
||||||
|
* The namespaced ID of a sprite in atlas, for example item/porkchop.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
private String sprite;
|
||||||
|
}
|
@@ -0,0 +1,40 @@
|
|||||||
|
package net.md_5.bungee.api.chat.player;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Profile
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the profile. Can be null.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* The UUID of the profile. Can be null.
|
||||||
|
*/
|
||||||
|
private UUID uuid;
|
||||||
|
/**
|
||||||
|
* The properties of the profile. Can be null.
|
||||||
|
*/
|
||||||
|
private Property[] properties;
|
||||||
|
|
||||||
|
public Profile(@NonNull String name)
|
||||||
|
{
|
||||||
|
this( name, null, null );
|
||||||
|
}
|
||||||
|
|
||||||
|
public Profile(@NonNull UUID uuid)
|
||||||
|
{
|
||||||
|
this( null, uuid, null );
|
||||||
|
}
|
||||||
|
|
||||||
|
public Profile(@NonNull Property[] properties)
|
||||||
|
{
|
||||||
|
this( null, null, properties );
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
package net.md_5.bungee.api.chat.player;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Property
|
||||||
|
{
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private String name;
|
||||||
|
@NonNull
|
||||||
|
private String value;
|
||||||
|
private String signature;
|
||||||
|
|
||||||
|
public Property(@NonNull String name, @NonNull String value)
|
||||||
|
{
|
||||||
|
this( name, value, null );
|
||||||
|
}
|
||||||
|
}
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-config</artifactId>
|
<artifactId>bungeecord-config</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Config</name>
|
<name>BungeeCord-Config</name>
|
||||||
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-dialog</artifactId>
|
<artifactId>bungeecord-dialog</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Dialog</name>
|
<name>BungeeCord-Dialog</name>
|
||||||
@@ -27,7 +26,7 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-chat</artifactId>
|
<artifactId>bungeecord-chat</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
|
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
@@ -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)
|
||||||
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-event</artifactId>
|
<artifactId>bungeecord-event</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Event</name>
|
<name>BungeeCord-Event</name>
|
||||||
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-log</artifactId>
|
<artifactId>bungeecord-log</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Log</name>
|
<name>BungeeCord-Log</name>
|
||||||
@@ -26,7 +25,7 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-chat</artifactId>
|
<artifactId>bungeecord-chat</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
|
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
|
||||||
<!--
|
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
|
||||||
-->
|
|
||||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>
|
|
||||||
</properties>
|
|
||||||
</project-shared-configuration>
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module-cmd-alert</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>cmd_alert</name>
|
|
||||||
<description>Provides the alert and alertraw commands</description>
|
|
||||||
</project>
|
|
@@ -1,47 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.alert;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
|
||||||
|
|
||||||
public class CommandAlert extends Command
|
|
||||||
{
|
|
||||||
|
|
||||||
public CommandAlert()
|
|
||||||
{
|
|
||||||
super( "alert", "bungeecord.command.alert" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
if ( args.length == 0 )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "message_needed" ) );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
if ( args[0].toLowerCase( Locale.ROOT ).startsWith( "&h" ) )
|
|
||||||
{
|
|
||||||
// Remove &h
|
|
||||||
args[0] = args[0].substring( 2 );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
builder.append( ProxyServer.getInstance().getTranslation( "alert" ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( String s : args )
|
|
||||||
{
|
|
||||||
builder.append( ChatColor.translateAlternateColorCodes( '&', s ) );
|
|
||||||
builder.append( " " );
|
|
||||||
}
|
|
||||||
|
|
||||||
String message = builder.substring( 0, builder.length() - 1 );
|
|
||||||
|
|
||||||
ProxyServer.getInstance().broadcast( TextComponent.fromLegacy( message ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,56 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.alert;
|
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
|
||||||
import net.md_5.bungee.chat.ComponentSerializer;
|
|
||||||
|
|
||||||
public class CommandAlertRaw extends Command
|
|
||||||
{
|
|
||||||
|
|
||||||
public CommandAlertRaw()
|
|
||||||
{
|
|
||||||
super( "alertraw", "bungeecord.command.alertraw" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
if ( args.length == 0 )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "message_needed" ) );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
String message = Joiner.on( ' ' ).join( args );
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ProxyServer.getInstance().broadcast( ComponentSerializer.parse( message ) );
|
|
||||||
} catch ( Exception e )
|
|
||||||
{
|
|
||||||
Throwable error = e;
|
|
||||||
while ( error.getCause() != null )
|
|
||||||
{
|
|
||||||
error = error.getCause();
|
|
||||||
}
|
|
||||||
if ( sender instanceof ProxiedPlayer )
|
|
||||||
{
|
|
||||||
sender.sendMessage( new ComponentBuilder( ProxyServer.getInstance().getTranslation( "error_occurred_player" ) )
|
|
||||||
.event( new HoverEvent( HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( error.getMessage() )
|
|
||||||
.color( ChatColor.RED )
|
|
||||||
.create() ) )
|
|
||||||
.create()
|
|
||||||
);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "error_occurred_console", error.getMessage() ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,14 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.alert;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
|
|
||||||
public class PluginAlert extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable()
|
|
||||||
{
|
|
||||||
getProxy().getPluginManager().registerCommand( this, new CommandAlert() );
|
|
||||||
getProxy().getPluginManager().registerCommand( this, new CommandAlertRaw() );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
name: ${project.name}
|
|
||||||
main: net.md_5.bungee.module.cmd.alert.PluginAlert
|
|
||||||
version: ${describe}
|
|
||||||
description: ${project.description}
|
|
||||||
author: ${module.author}
|
|
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
|
||||||
<!--
|
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
|
||||||
-->
|
|
||||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>
|
|
||||||
</properties>
|
|
||||||
</project-shared-configuration>
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module-cmd-find</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>cmd_find</name>
|
|
||||||
<description>Provides the find command</description>
|
|
||||||
</project>
|
|
@@ -1,58 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.find;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.md_5.bungee.command.PlayerCommand;
|
|
||||||
|
|
||||||
public class CommandFind extends PlayerCommand
|
|
||||||
{
|
|
||||||
|
|
||||||
public CommandFind()
|
|
||||||
{
|
|
||||||
super( "find", "bungeecord.command.find" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
if ( args.length != 1 )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "username_needed" ) );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ProxiedPlayer player = ProxyServer.getInstance().getPlayer( args[0] );
|
|
||||||
if ( player == null || player.getServer() == null )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "user_not_online" ) );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
boolean moduleLoaded = ProxyServer.getInstance().getPluginManager().getPlugin( "cmd_server" ) != null;
|
|
||||||
ServerInfo server = player.getServer().getInfo();
|
|
||||||
ComponentBuilder componentBuilder = new ComponentBuilder().appendLegacy( ProxyServer.getInstance().getTranslation( "user_online_at", player.getName(), server.getName() ) );
|
|
||||||
|
|
||||||
if ( moduleLoaded && server.canAccess( sender ) )
|
|
||||||
{
|
|
||||||
componentBuilder.event( new HoverEvent(
|
|
||||||
HoverEvent.Action.SHOW_TEXT,
|
|
||||||
new ComponentBuilder().appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() )
|
|
||||||
);
|
|
||||||
componentBuilder.event( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
sender.sendMessage( componentBuilder.create() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
return args.length == 1 ? super.onTabComplete( sender, args ) : Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,13 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.find;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
|
|
||||||
public class PluginFind extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable()
|
|
||||||
{
|
|
||||||
getProxy().getPluginManager().registerCommand( this, new CommandFind() );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
name: ${project.name}
|
|
||||||
main: net.md_5.bungee.module.cmd.find.PluginFind
|
|
||||||
version: ${describe}
|
|
||||||
description: ${project.description}
|
|
||||||
author: ${module.author}
|
|
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
|
||||||
<!--
|
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
|
||||||
-->
|
|
||||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>
|
|
||||||
</properties>
|
|
||||||
</project-shared-configuration>
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module-cmd-kick</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>cmd_kick</name>
|
|
||||||
<description>Provides the gkick command</description>
|
|
||||||
</project>
|
|
@@ -1,72 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.kick;
|
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Set;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
|
||||||
import net.md_5.bungee.api.plugin.TabExecutor;
|
|
||||||
|
|
||||||
public class CommandKick extends Command implements TabExecutor
|
|
||||||
{
|
|
||||||
|
|
||||||
public CommandKick()
|
|
||||||
{
|
|
||||||
super( "gkick", "bungeecord.command.kick" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
if ( args.length == 0 )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "username_needed" ) );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ProxiedPlayer player = ProxyServer.getInstance().getPlayer( args[0] );
|
|
||||||
|
|
||||||
if ( player == null )
|
|
||||||
{
|
|
||||||
sender.sendMessage( TextComponent.fromLegacy( ProxyServer.getInstance().getTranslation( "user_not_online" ) ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( args.length == 1 )
|
|
||||||
{
|
|
||||||
player.disconnect( TextComponent.fromLegacy( ProxyServer.getInstance().getTranslation( "kick_message" ) ) );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
String[] reason = new String[ args.length - 1 ];
|
|
||||||
System.arraycopy( args, 1, reason, 0, reason.length );
|
|
||||||
player.disconnect( TextComponent.fromLegacy( ChatColor.translateAlternateColorCodes( '&', Joiner.on( ' ' ).join( reason ) ) ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
if ( args.length == 1 )
|
|
||||||
{
|
|
||||||
Set<String> matches = new HashSet<>();
|
|
||||||
String search = args[0].toLowerCase( Locale.ROOT );
|
|
||||||
for ( ProxiedPlayer player : ProxyServer.getInstance().getPlayers() )
|
|
||||||
{
|
|
||||||
if ( player.getName().toLowerCase( Locale.ROOT ).startsWith( search ) )
|
|
||||||
{
|
|
||||||
matches.add( player.getName() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return matches;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
return ImmutableSet.of();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,13 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.kick;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
|
|
||||||
public class PluginKick extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable()
|
|
||||||
{
|
|
||||||
getProxy().getPluginManager().registerCommand( this, new CommandKick() );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
name: ${project.name}
|
|
||||||
main: net.md_5.bungee.module.cmd.kick.PluginKick
|
|
||||||
version: ${describe}
|
|
||||||
description: ${project.description}
|
|
||||||
author: ${module.author}
|
|
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
|
||||||
<!--
|
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
|
||||||
-->
|
|
||||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>
|
|
||||||
</properties>
|
|
||||||
</project-shared-configuration>
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module-cmd-list</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>cmd_list</name>
|
|
||||||
<description>Provides the glist command</description>
|
|
||||||
</project>
|
|
@@ -1,79 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.list;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.chat.hover.content.Text;
|
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
|
||||||
import net.md_5.bungee.api.plugin.TabExecutor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Command to list all players connected to the proxy.
|
|
||||||
*/
|
|
||||||
public class CommandList extends Command implements TabExecutor
|
|
||||||
{
|
|
||||||
|
|
||||||
public CommandList()
|
|
||||||
{
|
|
||||||
super( "glist", "bungeecord.command.list" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
boolean hideEmptyServers = ( args.length == 0 ) || !args[0].equalsIgnoreCase( "all" );
|
|
||||||
boolean moduleLoaded = ProxyServer.getInstance().getPluginManager().getPlugin( "cmd_server" ) != null;
|
|
||||||
|
|
||||||
for ( ServerInfo server : ProxyServer.getInstance().getServers().values() )
|
|
||||||
{
|
|
||||||
if ( !server.canAccess( sender ) )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Collection<ProxiedPlayer> serverPlayers = server.getPlayers();
|
|
||||||
if ( hideEmptyServers && serverPlayers.isEmpty() )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> players = new ArrayList<>();
|
|
||||||
for ( ProxiedPlayer player : serverPlayers )
|
|
||||||
{
|
|
||||||
players.add( player.getDisplayName() );
|
|
||||||
}
|
|
||||||
Collections.sort( players, String.CASE_INSENSITIVE_ORDER );
|
|
||||||
|
|
||||||
BaseComponent baseComponent = new ComponentBuilder().appendLegacy( ProxyServer.getInstance().getTranslation( "command_list", server.getName(), players.size(), String.join( ChatColor.RESET + ", ", players ) ) ).build();
|
|
||||||
|
|
||||||
if ( moduleLoaded )
|
|
||||||
{
|
|
||||||
baseComponent.setHoverEvent( new HoverEvent(
|
|
||||||
HoverEvent.Action.SHOW_TEXT,
|
|
||||||
new Text( new ComponentBuilder().appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() ) )
|
|
||||||
);
|
|
||||||
baseComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
sender.sendMessage( baseComponent );
|
|
||||||
}
|
|
||||||
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "total_players", ProxyServer.getInstance().getOnlineCount() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
return ( args.length > 1 ) ? Collections.emptyList() : Collections.singletonList( "all" );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,13 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.list;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
|
|
||||||
public class PluginList extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable()
|
|
||||||
{
|
|
||||||
getProxy().getPluginManager().registerCommand( this, new CommandList() );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
name: ${project.name}
|
|
||||||
main: net.md_5.bungee.module.cmd.list.PluginList
|
|
||||||
version: ${describe}
|
|
||||||
description: ${project.description}
|
|
||||||
author: ${module.author}
|
|
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
|
||||||
<!--
|
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
|
||||||
-->
|
|
||||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>
|
|
||||||
</properties>
|
|
||||||
</project-shared-configuration>
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module-cmd-send</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>cmd_send</name>
|
|
||||||
<description>Provides the gsend command</description>
|
|
||||||
</project>
|
|
@@ -1,200 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.send;
|
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import net.md_5.bungee.api.Callback;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.ServerConnectRequest;
|
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.md_5.bungee.api.event.ServerConnectEvent;
|
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
|
||||||
import net.md_5.bungee.api.plugin.TabExecutor;
|
|
||||||
|
|
||||||
public class CommandSend extends Command implements TabExecutor
|
|
||||||
{
|
|
||||||
|
|
||||||
protected static class SendCallback
|
|
||||||
{
|
|
||||||
|
|
||||||
private final Map<ServerConnectRequest.Result, List<String>> results = new HashMap<>();
|
|
||||||
private final CommandSender sender;
|
|
||||||
private int count = 0;
|
|
||||||
|
|
||||||
public SendCallback(CommandSender sender)
|
|
||||||
{
|
|
||||||
this.sender = sender;
|
|
||||||
for ( ServerConnectRequest.Result result : ServerConnectRequest.Result.values() )
|
|
||||||
{
|
|
||||||
results.put( result, Collections.synchronizedList( new ArrayList<>() ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void lastEntryDone()
|
|
||||||
{
|
|
||||||
sender.sendMessage( ChatColor.GREEN.toString() + ChatColor.BOLD + "Send Results:" );
|
|
||||||
for ( Map.Entry<ServerConnectRequest.Result, List<String>> entry : results.entrySet() )
|
|
||||||
{
|
|
||||||
ComponentBuilder builder = new ComponentBuilder( "" );
|
|
||||||
if ( !entry.getValue().isEmpty() )
|
|
||||||
{
|
|
||||||
builder.event( new HoverEvent( HoverEvent.Action.SHOW_TEXT,
|
|
||||||
new ComponentBuilder( Joiner.on( ", " ).join( entry.getValue() ) ).color( ChatColor.YELLOW ).create() ) );
|
|
||||||
}
|
|
||||||
builder.append( entry.getKey().name() + ": " ).color( ChatColor.GREEN );
|
|
||||||
builder.append( "" + entry.getValue().size() ).bold( true );
|
|
||||||
sender.sendMessage( builder.create() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Entry implements Callback<ServerConnectRequest.Result>
|
|
||||||
{
|
|
||||||
|
|
||||||
private final SendCallback callback;
|
|
||||||
private final ProxiedPlayer player;
|
|
||||||
private final ServerInfo target;
|
|
||||||
|
|
||||||
public Entry(SendCallback callback, ProxiedPlayer player, ServerInfo target)
|
|
||||||
{
|
|
||||||
this.callback = callback;
|
|
||||||
this.player = player;
|
|
||||||
this.target = target;
|
|
||||||
this.callback.count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void done(ServerConnectRequest.Result result, Throwable error)
|
|
||||||
{
|
|
||||||
callback.results.get( result ).add( player.getName() );
|
|
||||||
if ( result == ServerConnectRequest.Result.SUCCESS )
|
|
||||||
{
|
|
||||||
player.sendMessage( ProxyServer.getInstance().getTranslation( "you_got_summoned", target.getName(), callback.sender.getName() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( --callback.count == 0 )
|
|
||||||
{
|
|
||||||
callback.lastEntryDone();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public CommandSend()
|
|
||||||
{
|
|
||||||
super( "send", "bungeecord.command.send" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
if ( args.length != 2 )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "send_cmd_usage" ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ServerInfo server = ProxyServer.getInstance().getServerInfo( args[1] );
|
|
||||||
if ( server == null )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "no_server" ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ProxiedPlayer> targets;
|
|
||||||
if ( args[0].equalsIgnoreCase( "all" ) )
|
|
||||||
{
|
|
||||||
targets = new ArrayList<>( ProxyServer.getInstance().getPlayers() );
|
|
||||||
} else if ( args[0].equalsIgnoreCase( "current" ) )
|
|
||||||
{
|
|
||||||
if ( !( sender instanceof ProxiedPlayer ) )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "player_only" ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
|
||||||
targets = new ArrayList<>( player.getServer().getInfo().getPlayers() );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
// If we use a server name, send the entire server. This takes priority over players.
|
|
||||||
ServerInfo serverTarget = ProxyServer.getInstance().getServerInfo( args[0] );
|
|
||||||
if ( serverTarget != null )
|
|
||||||
{
|
|
||||||
targets = new ArrayList<>( serverTarget.getPlayers() );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ProxiedPlayer player = ProxyServer.getInstance().getPlayer( args[0] );
|
|
||||||
if ( player == null )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "user_not_online" ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
targets = Collections.singletonList( player );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final SendCallback callback = new SendCallback( sender );
|
|
||||||
for ( ProxiedPlayer player : targets )
|
|
||||||
{
|
|
||||||
ServerConnectRequest request = ServerConnectRequest.builder()
|
|
||||||
.target( server )
|
|
||||||
.reason( ServerConnectEvent.Reason.COMMAND )
|
|
||||||
.callback( new SendCallback.Entry( callback, player, server ) )
|
|
||||||
.build();
|
|
||||||
player.connect( request );
|
|
||||||
}
|
|
||||||
|
|
||||||
sender.sendMessage( ChatColor.DARK_GREEN + "Attempting to send " + targets.size() + " players to " + server.getName() );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
if ( args.length > 2 || args.length == 0 )
|
|
||||||
{
|
|
||||||
return ImmutableSet.of();
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<String> matches = new HashSet<>();
|
|
||||||
if ( args.length == 1 )
|
|
||||||
{
|
|
||||||
String search = args[0].toLowerCase( Locale.ROOT );
|
|
||||||
for ( ProxiedPlayer player : ProxyServer.getInstance().getPlayers() )
|
|
||||||
{
|
|
||||||
if ( player.getName().toLowerCase( Locale.ROOT ).startsWith( search ) )
|
|
||||||
{
|
|
||||||
matches.add( player.getName() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( "all".startsWith( search ) )
|
|
||||||
{
|
|
||||||
matches.add( "all" );
|
|
||||||
}
|
|
||||||
if ( "current".startsWith( search ) )
|
|
||||||
{
|
|
||||||
matches.add( "current" );
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
String search = args[1].toLowerCase( Locale.ROOT );
|
|
||||||
for ( String server : ProxyServer.getInstance().getServers().keySet() )
|
|
||||||
{
|
|
||||||
if ( server.toLowerCase( Locale.ROOT ).startsWith( search ) )
|
|
||||||
{
|
|
||||||
matches.add( server );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return matches;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,13 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.send;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
|
|
||||||
public class PluginSend extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable()
|
|
||||||
{
|
|
||||||
getProxy().getPluginManager().registerCommand( this, new CommandSend() );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
name: ${project.name}
|
|
||||||
main: net.md_5.bungee.module.cmd.send.PluginSend
|
|
||||||
version: ${describe}
|
|
||||||
description: ${project.description}
|
|
||||||
author: ${module.author}
|
|
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
|
||||||
<!--
|
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
|
||||||
-->
|
|
||||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>
|
|
||||||
</properties>
|
|
||||||
</project-shared-configuration>
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module-cmd-server</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>cmd_server</name>
|
|
||||||
<description>Provides the server command</description>
|
|
||||||
</project>
|
|
@@ -1,104 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.server;
|
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
import com.google.common.collect.Iterables;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.md_5.bungee.api.event.ServerConnectEvent;
|
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
|
||||||
import net.md_5.bungee.api.plugin.TabExecutor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Command to list and switch a player between available servers.
|
|
||||||
*/
|
|
||||||
public class CommandServer extends Command implements TabExecutor
|
|
||||||
{
|
|
||||||
|
|
||||||
public CommandServer()
|
|
||||||
{
|
|
||||||
super( "server", "bungeecord.command.server" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(CommandSender sender, String[] args)
|
|
||||||
{
|
|
||||||
Map<String, ServerInfo> servers = ProxyServer.getInstance().getServers();
|
|
||||||
if ( args.length == 0 )
|
|
||||||
{
|
|
||||||
if ( sender instanceof ProxiedPlayer )
|
|
||||||
{
|
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "current_server", ( (ProxiedPlayer) sender ).getServer().getInfo().getName() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
ComponentBuilder serverList = new ComponentBuilder().appendLegacy( ProxyServer.getInstance().getTranslation( "server_list" ) );
|
|
||||||
boolean first = true;
|
|
||||||
for ( ServerInfo server : servers.values() )
|
|
||||||
{
|
|
||||||
if ( server.canAccess( sender ) )
|
|
||||||
{
|
|
||||||
TextComponent serverTextComponent = new TextComponent( first ? server.getName() : ", " + server.getName() );
|
|
||||||
int count = server.getPlayers().size();
|
|
||||||
serverTextComponent.setHoverEvent( new HoverEvent(
|
|
||||||
HoverEvent.Action.SHOW_TEXT,
|
|
||||||
new ComponentBuilder( count + ( count == 1 ? " player" : " players" ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() )
|
|
||||||
);
|
|
||||||
serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) );
|
|
||||||
serverList.append( serverTextComponent );
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sender.sendMessage( serverList.create() );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
if ( !( sender instanceof ProxiedPlayer ) )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
|
||||||
|
|
||||||
ServerInfo server = servers.get( args[0] );
|
|
||||||
if ( server == null )
|
|
||||||
{
|
|
||||||
player.sendMessage( ProxyServer.getInstance().getTranslation( "no_server" ) );
|
|
||||||
} else if ( !server.canAccess( player ) )
|
|
||||||
{
|
|
||||||
player.sendMessage( ProxyServer.getInstance().getTranslation( "no_server_permission" ) );
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
player.connect( server, ServerConnectEvent.Reason.COMMAND );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<String> onTabComplete(final CommandSender sender, final String[] args)
|
|
||||||
{
|
|
||||||
return ( args.length > 1 ) ? Collections.EMPTY_LIST : Iterables.transform( Iterables.filter( ProxyServer.getInstance().getServers().values(), new Predicate<ServerInfo>()
|
|
||||||
{
|
|
||||||
private final String lower = ( args.length == 0 ) ? "" : args[0].toLowerCase( Locale.ROOT );
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(ServerInfo input)
|
|
||||||
{
|
|
||||||
return input.getName().toLowerCase( Locale.ROOT ).startsWith( lower ) && input.canAccess( sender );
|
|
||||||
}
|
|
||||||
} ), new Function<ServerInfo, String>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public String apply(ServerInfo input)
|
|
||||||
{
|
|
||||||
return input.getName();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,13 +0,0 @@
|
|||||||
package net.md_5.bungee.module.cmd.server;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
|
|
||||||
public class PluginServer extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable()
|
|
||||||
{
|
|
||||||
getProxy().getPluginManager().registerCommand( this, new CommandServer() );
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
name: ${project.name}
|
|
||||||
main: net.md_5.bungee.module.cmd.server.PluginServer
|
|
||||||
version: ${describe}
|
|
||||||
description: ${project.description}
|
|
||||||
author: ${module.author}
|
|
@@ -1,55 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
<name>BungeeCord Modules</name>
|
|
||||||
<description>Parent project for all BungeeCord modules.</description>
|
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>cmd-alert</module>
|
|
||||||
<module>cmd-find</module>
|
|
||||||
<module>cmd-kick</module>
|
|
||||||
<module>cmd-list</module>
|
|
||||||
<module>cmd-send</module>
|
|
||||||
<module>cmd-server</module>
|
|
||||||
<module>reconnect-yaml</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<module.author>SpigotMC</module.author>
|
|
||||||
<maven.deploy.skip>true</maven.deploy.skip>
|
|
||||||
<maven.javadoc.skip>true</maven.javadoc.skip>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<finalName>${project.name}</finalName>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
<directory>${basedir}/src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project-shared-configuration>
|
|
||||||
<!--
|
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
|
||||||
The configuration is intended to be shared among all the users of project and
|
|
||||||
therefore it is assumed to be part of version control checkout.
|
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
|
||||||
-->
|
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
|
||||||
<!--
|
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
|
||||||
-->
|
|
||||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinMethodCallParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSwitchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinCatchParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinTryParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinSynchronizedParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinArrayInitBrackets>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinWhileParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinIfParens>
|
|
||||||
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceWithinForParens>
|
|
||||||
</properties>
|
|
||||||
</project-shared-configuration>
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-module-reconnect-yaml</artifactId>
|
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>reconnect_yaml</name>
|
|
||||||
<description>Provides reconnect location functionality in locations.yml</description>
|
|
||||||
</project>
|
|
@@ -1,22 +0,0 @@
|
|||||||
package net.md_5.bungee.module.reconnect.yaml;
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.config.ListenerInfo;
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
|
|
||||||
public class PluginYaml extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable()
|
|
||||||
{
|
|
||||||
// TODO: Abstract this for other reconnect modules
|
|
||||||
for ( ListenerInfo info : getProxy().getConfig().getListeners() )
|
|
||||||
{
|
|
||||||
if ( !info.isForceDefault() && getProxy().getReconnectHandler() == null )
|
|
||||||
{
|
|
||||||
getProxy().setReconnectHandler( new YamlReconnectHandler() );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,115 +0,0 @@
|
|||||||
package net.md_5.bungee.module.reconnect.yaml;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileReader;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.locks.ReadWriteLock;
|
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import net.md_5.bungee.api.AbstractReconnectHandler;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|
||||||
import net.md_5.bungee.util.CaseInsensitiveMap;
|
|
||||||
import org.yaml.snakeyaml.Yaml;
|
|
||||||
|
|
||||||
public class YamlReconnectHandler extends AbstractReconnectHandler
|
|
||||||
{
|
|
||||||
|
|
||||||
private final Yaml yaml = new Yaml();
|
|
||||||
private final File file = new File( "locations.yml" );
|
|
||||||
private final ReadWriteLock lock = new ReentrantReadWriteLock();
|
|
||||||
/*========================================================================*/
|
|
||||||
private CaseInsensitiveMap<String> data;
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public YamlReconnectHandler()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
file.createNewFile();
|
|
||||||
try ( FileReader rd = new FileReader( file ) )
|
|
||||||
{
|
|
||||||
Map map = yaml.loadAs( rd, Map.class );
|
|
||||||
if ( map != null )
|
|
||||||
{
|
|
||||||
data = new CaseInsensitiveMap<>( map );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch ( Exception ex )
|
|
||||||
{
|
|
||||||
file.renameTo( new File( "locations.yml.old" ) );
|
|
||||||
ProxyServer.getInstance().getLogger().log( Level.WARNING, "Could not load reconnect locations, resetting them" );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( data == null )
|
|
||||||
{
|
|
||||||
data = new CaseInsensitiveMap<>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ServerInfo getStoredServer(ProxiedPlayer player)
|
|
||||||
{
|
|
||||||
ServerInfo server = null;
|
|
||||||
lock.readLock().lock();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
server = ProxyServer.getInstance().getServerInfo( data.get( key( player ) ) );
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
lock.readLock().unlock();
|
|
||||||
}
|
|
||||||
return server;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setServer(ProxiedPlayer player)
|
|
||||||
{
|
|
||||||
lock.writeLock().lock();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
data.put( key( player ), ( player.getReconnectServer() != null ) ? player.getReconnectServer().getName() : player.getServer().getInfo().getName() );
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
lock.writeLock().unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String key(ProxiedPlayer player)
|
|
||||||
{
|
|
||||||
InetSocketAddress host = player.getPendingConnection().getVirtualHost();
|
|
||||||
return player.getName() + ";" + host.getHostString() + ":" + host.getPort();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
Map<String, String> copy = new HashMap<>();
|
|
||||||
lock.readLock().lock();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
copy.putAll( data );
|
|
||||||
} finally
|
|
||||||
{
|
|
||||||
lock.readLock().unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
try ( FileWriter wr = new FileWriter( file ) )
|
|
||||||
{
|
|
||||||
yaml.dump( copy, wr );
|
|
||||||
} catch ( IOException ex )
|
|
||||||
{
|
|
||||||
ProxyServer.getInstance().getLogger().log( Level.WARNING, "Could not save reconnect locations", ex );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
name: ${project.name}
|
|
||||||
main: net.md_5.bungee.module.reconnect.yaml.PluginYaml
|
|
||||||
version: ${describe}
|
|
||||||
description: ${project.description}
|
|
||||||
author: ${module.author}
|
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-native</artifactId>
|
<artifactId>bungeecord-native</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Native</name>
|
<name>BungeeCord-Native</name>
|
||||||
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-nbt</artifactId>
|
<artifactId>bungeecord-nbt</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-NBT</name>
|
<name>BungeeCord-NBT</name>
|
||||||
|
@@ -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
|
||||||
|
23
pom.xml
23
pom.xml
@@ -3,9 +3,9 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Parent</name>
|
<name>BungeeCord-Parent</name>
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
<module>dialog</module>
|
<module>dialog</module>
|
||||||
<module>event</module>
|
<module>event</module>
|
||||||
<module>log</module>
|
<module>log</module>
|
||||||
<module>module</module>
|
|
||||||
<module>protocol</module>
|
<module>protocol</module>
|
||||||
<module>proxy</module>
|
<module>proxy</module>
|
||||||
<module>query</module>
|
<module>query</module>
|
||||||
@@ -64,12 +63,12 @@
|
|||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<snapshotRepository>
|
<snapshotRepository>
|
||||||
<id>sonatype-nexus-snapshots</id>
|
<id>central-portal-snapshots</id>
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
|
||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>sonatype-nexus-staging</id>
|
<id>ossrh-staging-api</id>
|
||||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
@@ -86,7 +85,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-bom</artifactId>
|
<artifactId>netty-bom</artifactId>
|
||||||
<version>4.2.1.Final</version>
|
<version>4.2.3.Final</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@@ -135,7 +134,7 @@
|
|||||||
<artifactId>scriptus</artifactId>
|
<artifactId>scriptus</artifactId>
|
||||||
<version>0.5.0</version>
|
<version>0.5.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<format>git:${project.name}:${project.version}:%s:${build.number}</format>
|
<format>git:${project.name}-Pandacube:${project.version}:%s:${build.number}</format>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
@@ -373,6 +372,12 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.sonatype.central</groupId>
|
||||||
|
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||||
|
<version>0.9.0</version>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
|
@@ -4,15 +4,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-protocol</artifactId>
|
<artifactId>bungeecord-protocol</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Protocol</name>
|
<name>BungeeCord-Protocol</name>
|
||||||
@@ -35,13 +34,13 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-serializer</artifactId>
|
<artifactId>bungeecord-serializer</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-nbt</artifactId>
|
<artifactId>bungeecord-nbt</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
|
@@ -26,17 +26,22 @@ import net.md_5.bungee.nbt.Tag;
|
|||||||
import net.md_5.bungee.nbt.TypedTag;
|
import net.md_5.bungee.nbt.TypedTag;
|
||||||
import net.md_5.bungee.nbt.limit.NBTLimiter;
|
import net.md_5.bungee.nbt.limit.NBTLimiter;
|
||||||
import net.md_5.bungee.nbt.type.EndTag;
|
import net.md_5.bungee.nbt.type.EndTag;
|
||||||
|
import net.md_5.bungee.protocol.data.NumberFormat;
|
||||||
|
import net.md_5.bungee.protocol.data.PlayerPublicKey;
|
||||||
|
import net.md_5.bungee.protocol.data.Property;
|
||||||
|
import net.md_5.bungee.protocol.util.Either;
|
||||||
|
import net.md_5.bungee.protocol.util.TagUtil;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public abstract class DefinedPacket
|
public abstract class DefinedPacket
|
||||||
{
|
{
|
||||||
|
|
||||||
public <T> T readNullable(Function<ByteBuf, T> reader, ByteBuf buf)
|
public static <T> T readNullable(Function<ByteBuf, T> reader, ByteBuf buf)
|
||||||
{
|
{
|
||||||
return buf.readBoolean() ? reader.apply( buf ) : null;
|
return buf.readBoolean() ? reader.apply( buf ) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void writeNullable(T t0, BiConsumer<T, ByteBuf> writer, ByteBuf buf)
|
public static <T> void writeNullable(T t0, BiConsumer<T, ByteBuf> writer, ByteBuf buf)
|
||||||
{
|
{
|
||||||
if ( t0 != null )
|
if ( t0 != null )
|
||||||
{
|
{
|
||||||
@@ -48,7 +53,7 @@ public abstract class DefinedPacket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T readLengthPrefixed(Function<ByteBuf, T> reader, ByteBuf buf, int maxSize)
|
public static <T> T readLengthPrefixed(Function<ByteBuf, T> reader, ByteBuf buf, int maxSize)
|
||||||
{
|
{
|
||||||
int size = readVarInt( buf );
|
int size = readVarInt( buf );
|
||||||
|
|
||||||
@@ -60,7 +65,7 @@ public abstract class DefinedPacket
|
|||||||
return reader.apply( buf.readSlice( size ) );
|
return reader.apply( buf.readSlice( size ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void writeLengthPrefixed(T value, BiConsumer<T, ByteBuf> writer, ByteBuf buf, int maxSize)
|
public static <T> void writeLengthPrefixed(T value, BiConsumer<T, ByteBuf> writer, ByteBuf buf, int maxSize)
|
||||||
{
|
{
|
||||||
ByteBuf tempBuffer = buf.alloc().buffer();
|
ByteBuf tempBuffer = buf.alloc().buffer();
|
||||||
try
|
try
|
||||||
@@ -124,8 +129,7 @@ public abstract class DefinedPacket
|
|||||||
throw new OverflowPacketException( "Cannot receive string longer than " + maxLen * 3 + " (got " + len + " bytes)" );
|
throw new OverflowPacketException( "Cannot receive string longer than " + maxLen * 3 + " (got " + len + " bytes)" );
|
||||||
}
|
}
|
||||||
|
|
||||||
String s = buf.toString( buf.readerIndex(), len, StandardCharsets.UTF_8 );
|
String s = buf.readString( len, StandardCharsets.UTF_8 );
|
||||||
buf.readerIndex( buf.readerIndex() + len );
|
|
||||||
|
|
||||||
if ( s.length() > maxLen )
|
if ( s.length() > maxLen )
|
||||||
{
|
{
|
||||||
|
@@ -110,7 +110,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x24 ),
|
map( ProtocolConstants.MINECRAFT_1_20_2, 0x24 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x26 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x26 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x27 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x27 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x26 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x26 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x2B )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Login.class,
|
Login.class,
|
||||||
@@ -129,11 +130,13 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x29 ),
|
map( ProtocolConstants.MINECRAFT_1_20_2, 0x29 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x2B ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x2B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x2C ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x2C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x2B )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x2B ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x30 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Chat.class,
|
Chat.class,
|
||||||
Chat::new,
|
Chat::new,
|
||||||
|
RegisterType.ENCODE,
|
||||||
map( ProtocolConstants.MINECRAFT_1_8, 0x02 ),
|
map( ProtocolConstants.MINECRAFT_1_8, 0x02 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_9, 0x0F ),
|
map( ProtocolConstants.MINECRAFT_1_9, 0x0F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_13, 0x0E ),
|
map( ProtocolConstants.MINECRAFT_1_13, 0x0E ),
|
||||||
@@ -163,7 +166,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x45 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x45 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x47 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x47 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x4C ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x4C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x4B )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x4B ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x50 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
BossBar.class,
|
BossBar.class,
|
||||||
@@ -227,7 +231,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5C ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x5E ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x5E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x64 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x64 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x63 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x63 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x68 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ScoreboardScore.class,
|
ScoreboardScore.class,
|
||||||
@@ -247,7 +252,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5F ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x61 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x61 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x68 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x68 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x67 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x67 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x6C )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ScoreboardScoreReset.class,
|
ScoreboardScoreReset.class,
|
||||||
@@ -255,7 +261,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x42 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x42 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x44 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x44 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x49 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x49 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x48 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x48 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x4D )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ScoreboardDisplay.class,
|
ScoreboardDisplay.class,
|
||||||
@@ -275,7 +282,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x55 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x55 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x57 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x57 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x5C ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x5C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x5B )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x5B ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x60 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Team.class,
|
Team.class,
|
||||||
@@ -295,7 +303,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5E ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x60 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x60 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x67 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x67 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x66 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x66 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x6B )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PluginMessage.class,
|
PluginMessage.class,
|
||||||
@@ -333,7 +342,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1A ),
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1B ),
|
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1D ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x1C )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x1C ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x20 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Title.class,
|
Title.class,
|
||||||
@@ -355,7 +365,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x63 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x63 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x65 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x65 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6C ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6B )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6B ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x70 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ClearTitles.class,
|
ClearTitles.class,
|
||||||
@@ -381,7 +392,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x61 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x61 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x63 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x63 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6A ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x69 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x69 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x6E )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
TitleTimes.class,
|
TitleTimes.class,
|
||||||
@@ -396,7 +408,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x64 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x64 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x66 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x66 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6D ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x6D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6C )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6C ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x71 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
SystemChat.class,
|
SystemChat.class,
|
||||||
@@ -410,7 +423,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x69 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x69 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6C ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x73 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x73 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x72 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x72 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x77 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PlayerListHeaderFooter.class,
|
PlayerListHeaderFooter.class,
|
||||||
@@ -435,7 +449,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x6A ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x6A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6D ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x74 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x74 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x73 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x73 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x78 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
EntityStatus.class,
|
EntityStatus.class,
|
||||||
@@ -455,7 +470,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1C ),
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1D ),
|
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1F ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x1E )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x1E ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x22 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Commands.class,
|
Commands.class,
|
||||||
@@ -486,7 +502,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x20 ),
|
map( ProtocolConstants.MINECRAFT_1_20_2, 0x20 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x22 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x22 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x23 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x23 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x22 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x22 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x26 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ViewDistance.class,
|
ViewDistance.class,
|
||||||
@@ -504,7 +521,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x53 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x53 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x55 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x55 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x59 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x59 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x58 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x58 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x5D )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ServerData.class,
|
ServerData.class,
|
||||||
@@ -517,7 +535,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x49 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x49 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x4B ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x4B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x50 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x50 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x4F )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x4F ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x54 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PlayerListItemRemove.class,
|
PlayerListItemRemove.class,
|
||||||
@@ -527,7 +546,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3B ),
|
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3D ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x3F ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x3F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x3E )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x3E ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x43 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PlayerListItemUpdate.class,
|
PlayerListItemUpdate.class,
|
||||||
@@ -537,7 +557,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3C ),
|
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3E ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x40 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x40 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x3F )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x3F ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x44 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
StartConfiguration.class,
|
StartConfiguration.class,
|
||||||
@@ -546,7 +567,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x67 ),
|
map( ProtocolConstants.MINECRAFT_1_20_3, 0x67 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x69 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x69 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x70 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x70 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6F )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x6F ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x74 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
CookieRequest.class,
|
CookieRequest.class,
|
||||||
@@ -560,40 +582,46 @@ public enum Protocol
|
|||||||
RegisterType.ENCODE,
|
RegisterType.ENCODE,
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6B ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x72 ),
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x72 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_5, 0x71 )
|
map( ProtocolConstants.MINECRAFT_1_21_5, 0x71 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x76 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Transfer.class,
|
Transfer.class,
|
||||||
Transfer::new,
|
Transfer::new,
|
||||||
RegisterType.ENCODE,
|
RegisterType.ENCODE,
|
||||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x73 ),
|
map( ProtocolConstants.MINECRAFT_1_20_5, 0x73 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x7A )
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x7A ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x7F )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
DisconnectReportDetails.class,
|
DisconnectReportDetails.class,
|
||||||
DisconnectReportDetails::new,
|
DisconnectReportDetails::new,
|
||||||
RegisterType.ENCODE,
|
RegisterType.ENCODE,
|
||||||
map( ProtocolConstants.MINECRAFT_1_21, 0x7A ),
|
map( ProtocolConstants.MINECRAFT_1_21, 0x7A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x81 )
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x81 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x86 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ServerLinks.class,
|
ServerLinks.class,
|
||||||
ServerLinks::new,
|
ServerLinks::new,
|
||||||
RegisterType.ENCODE,
|
RegisterType.ENCODE,
|
||||||
map( ProtocolConstants.MINECRAFT_1_21, 0x7B ),
|
map( ProtocolConstants.MINECRAFT_1_21, 0x7B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_2, 0x82 )
|
map( ProtocolConstants.MINECRAFT_1_21_2, 0x82 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x87 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ClearDialog.class,
|
ClearDialog.class,
|
||||||
ClearDialog::new,
|
ClearDialog::new,
|
||||||
RegisterType.ENCODE,
|
RegisterType.ENCODE,
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_6, 0x84 )
|
map( ProtocolConstants.MINECRAFT_1_21_6, 0x84 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x89 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ShowDialog.class,
|
ShowDialog.class,
|
||||||
ShowDialog::new,
|
ShowDialog::new,
|
||||||
RegisterType.ENCODE,
|
RegisterType.ENCODE,
|
||||||
map( ProtocolConstants.MINECRAFT_1_21_6, 0x85 )
|
map( ProtocolConstants.MINECRAFT_1_21_6, 0x85 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_21_9, 0x8A )
|
||||||
);
|
);
|
||||||
|
|
||||||
TO_SERVER.registerPacket(
|
TO_SERVER.registerPacket(
|
||||||
|
@@ -52,6 +52,7 @@ public class ProtocolConstants
|
|||||||
public static final int MINECRAFT_1_21_5 = 770;
|
public static final int MINECRAFT_1_21_5 = 770;
|
||||||
public static final int MINECRAFT_1_21_6 = 771;
|
public static final int MINECRAFT_1_21_6 = 771;
|
||||||
public static final int MINECRAFT_1_21_7 = 772;
|
public static final int MINECRAFT_1_21_7 = 772;
|
||||||
|
public static final int MINECRAFT_1_21_9 = 773;
|
||||||
public static final List<String> SUPPORTED_VERSIONS;
|
public static final List<String> SUPPORTED_VERSIONS;
|
||||||
public static final List<Integer> SUPPORTED_VERSION_IDS;
|
public static final List<Integer> SUPPORTED_VERSION_IDS;
|
||||||
|
|
||||||
@@ -118,13 +119,14 @@ public class ProtocolConstants
|
|||||||
ProtocolConstants.MINECRAFT_1_21_4,
|
ProtocolConstants.MINECRAFT_1_21_4,
|
||||||
ProtocolConstants.MINECRAFT_1_21_5,
|
ProtocolConstants.MINECRAFT_1_21_5,
|
||||||
ProtocolConstants.MINECRAFT_1_21_6,
|
ProtocolConstants.MINECRAFT_1_21_6,
|
||||||
ProtocolConstants.MINECRAFT_1_21_7
|
ProtocolConstants.MINECRAFT_1_21_7,
|
||||||
|
ProtocolConstants.MINECRAFT_1_21_9
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( SNAPSHOT_SUPPORT )
|
if ( SNAPSHOT_SUPPORT )
|
||||||
{
|
{
|
||||||
// supportedVersions.add( "1.21.x" );
|
// supportedVersions.add( "1.21.x" );
|
||||||
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_21_6 );
|
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_21_9 );
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPPORTED_VERSIONS = supportedVersions.build();
|
SUPPORTED_VERSIONS = supportedVersions.build();
|
||||||
|
@@ -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
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.data;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
@@ -9,6 +9,9 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.data;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.data;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.data;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.data;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.data;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import java.util.BitSet;
|
import java.util.BitSet;
|
||||||
@@ -6,6 +6,9 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
@@ -6,10 +6,10 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.ChatChain;
|
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
import net.md_5.bungee.protocol.SeenMessages;
|
import net.md_5.bungee.protocol.data.ChatChain;
|
||||||
|
import net.md_5.bungee.protocol.data.SeenMessages;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -9,10 +9,10 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.ChatChain;
|
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
import net.md_5.bungee.protocol.SeenMessages;
|
import net.md_5.bungee.protocol.data.ChatChain;
|
||||||
|
import net.md_5.bungee.protocol.data.SeenMessages;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
|
|||||||
import com.mojang.brigadier.Command;
|
import com.mojang.brigadier.Command;
|
||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.arguments.ArgumentType;
|
import com.mojang.brigadier.arguments.ArgumentType;
|
||||||
|
import com.mojang.brigadier.arguments.BoolArgumentType;
|
||||||
import com.mojang.brigadier.arguments.DoubleArgumentType;
|
import com.mojang.brigadier.arguments.DoubleArgumentType;
|
||||||
import com.mojang.brigadier.arguments.FloatArgumentType;
|
import com.mojang.brigadier.arguments.FloatArgumentType;
|
||||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||||
@@ -303,7 +304,7 @@ public class Commands extends DefinedPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
private static class ArgumentRegistry
|
public static class ArgumentRegistry
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final Map<String, ArgumentSerializer> PROVIDERS = new HashMap<>();
|
private static final Map<String, ArgumentSerializer> PROVIDERS = new HashMap<>();
|
||||||
@@ -329,18 +330,29 @@ public class Commands extends DefinedPacket
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ArgumentSerializer<Boolean> BOOLEAN = new ArgumentSerializer<Boolean>()
|
private static final ProperArgumentSerializer<BoolArgumentType> BOOLEAN = new ProperArgumentSerializer<BoolArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected Boolean read(ByteBuf buf)
|
protected BoolArgumentType read(ByteBuf buf)
|
||||||
{
|
{
|
||||||
return buf.readBoolean();
|
return BoolArgumentType.bool();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void write(ByteBuf buf, Boolean t)
|
protected void write(ByteBuf buf, BoolArgumentType t)
|
||||||
{
|
{
|
||||||
buf.writeBoolean( t );
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getIntKey()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getKey()
|
||||||
|
{
|
||||||
|
return "brigadier:bool";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ArgumentSerializer<Byte> BYTE = new ArgumentSerializer<Byte>()
|
private static final ArgumentSerializer<Byte> BYTE = new ArgumentSerializer<Byte>()
|
||||||
@@ -357,7 +369,7 @@ public class Commands extends DefinedPacket
|
|||||||
buf.writeByte( t );
|
buf.writeByte( t );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ArgumentSerializer<FloatArgumentType> FLOAT_RANGE = new ArgumentSerializer<FloatArgumentType>()
|
private static final ProperArgumentSerializer<FloatArgumentType> FLOAT_RANGE = new ProperArgumentSerializer<FloatArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected FloatArgumentType read(ByteBuf buf)
|
protected FloatArgumentType read(ByteBuf buf)
|
||||||
@@ -385,8 +397,20 @@ public class Commands extends DefinedPacket
|
|||||||
buf.writeFloat( t.getMaximum() );
|
buf.writeFloat( t.getMaximum() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getIntKey()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getKey()
|
||||||
|
{
|
||||||
|
return "brigadier:float";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
private static final ArgumentSerializer<DoubleArgumentType> DOUBLE_RANGE = new ArgumentSerializer<DoubleArgumentType>()
|
private static final ProperArgumentSerializer<DoubleArgumentType> DOUBLE_RANGE = new ProperArgumentSerializer<DoubleArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected DoubleArgumentType read(ByteBuf buf)
|
protected DoubleArgumentType read(ByteBuf buf)
|
||||||
@@ -414,8 +438,20 @@ public class Commands extends DefinedPacket
|
|||||||
buf.writeDouble( t.getMaximum() );
|
buf.writeDouble( t.getMaximum() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getIntKey()
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getKey()
|
||||||
|
{
|
||||||
|
return "brigadier:double";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
private static final ArgumentSerializer<IntegerArgumentType> INTEGER_RANGE = new ArgumentSerializer<IntegerArgumentType>()
|
private static final ProperArgumentSerializer<IntegerArgumentType> INTEGER_RANGE = new ProperArgumentSerializer<IntegerArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected IntegerArgumentType read(ByteBuf buf)
|
protected IntegerArgumentType read(ByteBuf buf)
|
||||||
@@ -443,6 +479,18 @@ public class Commands extends DefinedPacket
|
|||||||
buf.writeInt( t.getMaximum() );
|
buf.writeInt( t.getMaximum() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getIntKey()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getKey()
|
||||||
|
{
|
||||||
|
return "brigadier:integer";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
private static final ArgumentSerializer<Integer> INTEGER = new ArgumentSerializer<Integer>()
|
private static final ArgumentSerializer<Integer> INTEGER = new ArgumentSerializer<Integer>()
|
||||||
{
|
{
|
||||||
@@ -458,7 +506,7 @@ public class Commands extends DefinedPacket
|
|||||||
buf.writeInt( t );
|
buf.writeInt( t );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ArgumentSerializer<LongArgumentType> LONG_RANGE = new ArgumentSerializer<LongArgumentType>()
|
private static final ProperArgumentSerializer<LongArgumentType> LONG_RANGE = new ProperArgumentSerializer<LongArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected LongArgumentType read(ByteBuf buf)
|
protected LongArgumentType read(ByteBuf buf)
|
||||||
@@ -486,6 +534,18 @@ public class Commands extends DefinedPacket
|
|||||||
buf.writeLong( t.getMaximum() );
|
buf.writeLong( t.getMaximum() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getIntKey()
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getKey()
|
||||||
|
{
|
||||||
|
return "brigadier:long";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
private static final ProperArgumentSerializer<StringArgumentType> STRING = new ProperArgumentSerializer<StringArgumentType>()
|
private static final ProperArgumentSerializer<StringArgumentType> STRING = new ProperArgumentSerializer<StringArgumentType>()
|
||||||
{
|
{
|
||||||
@@ -541,11 +601,20 @@ public class Commands extends DefinedPacket
|
|||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
register( "brigadier:bool", VOID );
|
register( "brigadier:bool", BOOLEAN );
|
||||||
|
PROPER_PROVIDERS.put( BoolArgumentType.class, BOOLEAN );
|
||||||
|
|
||||||
register( "brigadier:float", FLOAT_RANGE );
|
register( "brigadier:float", FLOAT_RANGE );
|
||||||
|
PROPER_PROVIDERS.put( FloatArgumentType.class, FLOAT_RANGE );
|
||||||
|
|
||||||
register( "brigadier:double", DOUBLE_RANGE );
|
register( "brigadier:double", DOUBLE_RANGE );
|
||||||
|
PROPER_PROVIDERS.put( DoubleArgumentType.class, DOUBLE_RANGE );
|
||||||
|
|
||||||
register( "brigadier:integer", INTEGER_RANGE );
|
register( "brigadier:integer", INTEGER_RANGE );
|
||||||
register( "brigadier:long", LONG_RANGE );
|
PROPER_PROVIDERS.put( IntegerArgumentType.class, INTEGER_RANGE );
|
||||||
|
|
||||||
|
register( "brigadier:long", LONG_RANGE ); // 1.14+
|
||||||
|
PROPER_PROVIDERS.put( LongArgumentType.class, LONG_RANGE );
|
||||||
|
|
||||||
register( "brigadier:string", STRING );
|
register( "brigadier:string", STRING );
|
||||||
PROPER_PROVIDERS.put( StringArgumentType.class, STRING );
|
PROPER_PROVIDERS.put( StringArgumentType.class, STRING );
|
||||||
@@ -992,6 +1061,404 @@ public class Commands extends DefinedPacket
|
|||||||
return serializer;
|
return serializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:entity}.
|
||||||
|
* @param singleEntity if the argument restrict to only one entity
|
||||||
|
* @param onlyPlayers if the argument restrict to players only
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftEntity(boolean singleEntity, boolean onlyPlayers)
|
||||||
|
{
|
||||||
|
byte flags = 0;
|
||||||
|
if ( singleEntity )
|
||||||
|
{
|
||||||
|
flags |= 1;
|
||||||
|
}
|
||||||
|
if ( onlyPlayers )
|
||||||
|
{
|
||||||
|
flags |= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return minecraftArgumentType( "minecraft:entity", flags );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:game_profile}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftGameProfile()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:game_profile", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:block_pos}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftBlockPos()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:block_pos", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:column_pos}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftColumnPos()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:column_pos", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:vec3}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftVec3()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:vec3", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:vec2}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftVec2()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:vec2", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:block_state}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftBlockState()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:block_state", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:block_predicate}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftBlockPredicate()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:block_predicate", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:item_stack}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftItemStack()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:item_stack", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:item_predicate}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftItemPredicate()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:item_predicate", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:color}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftColor()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:color", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:component}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftComponent()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:component", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:message}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftMessage()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:message", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:nbt_compound_tag}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftNBTCompoundTag()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:nbt_compound_tag", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:nbt_tag}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftNBTTag()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:nbt_tag", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:nbt}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftNBT()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:nbt", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:nbt_path}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftNBTPath()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:nbt_path", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:objective}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftObjective()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:objective", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:objective_criteria}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftObjectiveCriteria()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:objective_criteria", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:operation}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftOperation()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:operation", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:particle}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftParticle()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:particle", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:rotation}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftRotation()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:rotation", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:scoreboard_slot}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftScoreboardSlot()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:scoreboard_slot", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:score_holder}.
|
||||||
|
* @param allowMultiple if the argument allows multiple entities
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftScoreHolder(boolean allowMultiple)
|
||||||
|
{
|
||||||
|
byte flags = 0;
|
||||||
|
if ( allowMultiple )
|
||||||
|
{
|
||||||
|
flags |= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return minecraftArgumentType( "minecraft:score_holder", flags );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:swizzle}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftSwizzle()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:swizzle", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:team}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftTeam()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:team", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:item_slot}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftItemSlot()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:item_slot", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:resource_location}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftResourceLocation()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:resource_location", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:mob_effect}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftMobEffect()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:mob_effect", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:function}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftFunction()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:function", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:entity_anchor}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftEntityAnchor()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:entity_anchor", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:int_range}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftIntRange()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:int_range", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:float_range}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftFloatRange()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:float_range", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:item_enchantment}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftItemEnchantment()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:item_enchantment", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:entity_summon}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftEntitySummon()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:entity_summon", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:dimension}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftDimension()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:dimension", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:time}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftTime()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:time", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:uuid}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftUUID()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:uuid", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:angle}.
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftAngle()
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:angle", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:resource}.
|
||||||
|
* @param rawString the raw string for the argument
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftResource(String rawString)
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:resource", rawString );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Minecraft ArgumentType {@code minecraft:resource_or_tag}.
|
||||||
|
* @param rawString the raw string for the argument
|
||||||
|
* @return an ArgumentType instance
|
||||||
|
*/
|
||||||
|
public static ArgumentType<?> minecraftResourceOrTag(String rawString)
|
||||||
|
{
|
||||||
|
return minecraftArgumentType( "minecraft:resource_or_tag", rawString );
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ArgumentType<?> minecraftArgumentType(String key, Object rawValue)
|
||||||
|
{
|
||||||
|
ArgumentSerializer reader = PROVIDERS.get( key );
|
||||||
|
Preconditions.checkArgument( reader != null, "No provider for argument " + key );
|
||||||
|
|
||||||
|
return new DummyType( key, reader, rawValue );
|
||||||
|
}
|
||||||
|
|
||||||
private static ArgumentType<?> read(ByteBuf buf, int protocolVersion)
|
private static ArgumentType<?> read(ByteBuf buf, int protocolVersion)
|
||||||
{
|
{
|
||||||
Object key;
|
Object key;
|
||||||
@@ -1127,11 +1594,15 @@ public class Commands extends DefinedPacket
|
|||||||
|
|
||||||
private static String getKey(SuggestionProvider<DummyProvider> provider)
|
private static String getKey(SuggestionProvider<DummyProvider> provider)
|
||||||
{
|
{
|
||||||
Preconditions.checkArgument( provider instanceof DummyProvider, "Non dummy provider " + provider );
|
Preconditions.checkNotNull( provider );
|
||||||
|
if ( provider instanceof DummyProvider )
|
||||||
|
{
|
||||||
return ( (DummyProvider) provider ).key;
|
return ( (DummyProvider) provider ).key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ( (DummyProvider) ASK_SERVER ).key;
|
||||||
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
private static final class DummyProvider implements SuggestionProvider<DummyProvider>
|
private static final class DummyProvider implements SuggestionProvider<DummyProvider>
|
||||||
{
|
{
|
||||||
|
@@ -10,8 +10,8 @@ import lombok.NoArgsConstructor;
|
|||||||
import net.md_5.bungee.nbt.Tag;
|
import net.md_5.bungee.nbt.Tag;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.Location;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.Location;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -8,8 +8,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.PlayerPublicKey;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.PlayerPublicKey;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -8,8 +8,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.Property;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.Property;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -8,9 +8,9 @@ import lombok.NoArgsConstructor;
|
|||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.PlayerPublicKey;
|
|
||||||
import net.md_5.bungee.protocol.Property;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.PlayerPublicKey;
|
||||||
|
import net.md_5.bungee.protocol.data.Property;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -7,8 +7,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.PlayerPublicKey;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.PlayerPublicKey;
|
||||||
import net.md_5.bungee.protocol.packet.PlayerListItem.Item;
|
import net.md_5.bungee.protocol.packet.PlayerListItem.Item;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@@ -8,8 +8,8 @@ import lombok.NoArgsConstructor;
|
|||||||
import net.md_5.bungee.nbt.Tag;
|
import net.md_5.bungee.nbt.Tag;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.Location;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.Location;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -9,9 +9,9 @@ import lombok.NoArgsConstructor;
|
|||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.Either;
|
|
||||||
import net.md_5.bungee.protocol.NumberFormat;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.NumberFormat;
|
||||||
|
import net.md_5.bungee.protocol.util.Either;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -8,8 +8,8 @@ import lombok.NoArgsConstructor;
|
|||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.NumberFormat;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.data.NumberFormat;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -8,8 +8,8 @@ import lombok.NoArgsConstructor;
|
|||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.Either;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.util.Either;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@@ -27,10 +27,10 @@ public class ServerLinks extends DefinedPacket
|
|||||||
links = new Link[ len ];
|
links = new Link[ len ];
|
||||||
for ( int i = 0; i < len; i++ )
|
for ( int i = 0; i < len; i++ )
|
||||||
{
|
{
|
||||||
Either<LinkType, BaseComponent> type;
|
Either<Integer, BaseComponent> type;
|
||||||
if ( buf.readBoolean() )
|
if ( buf.readBoolean() )
|
||||||
{
|
{
|
||||||
type = Either.left( LinkType.values()[readVarInt( buf )] );
|
type = Either.left( readVarInt( buf ) );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
type = Either.right( readBaseComponent( buf, protocolVersion ) );
|
type = Either.right( readBaseComponent( buf, protocolVersion ) );
|
||||||
@@ -47,11 +47,11 @@ public class ServerLinks extends DefinedPacket
|
|||||||
writeVarInt( links.length, buf );
|
writeVarInt( links.length, buf );
|
||||||
for ( Link link : links )
|
for ( Link link : links )
|
||||||
{
|
{
|
||||||
Either<LinkType, BaseComponent> type = link.getType();
|
Either<Integer, BaseComponent> type = link.getType();
|
||||||
if ( type.isLeft() )
|
if ( type.isLeft() )
|
||||||
{
|
{
|
||||||
buf.writeBoolean( true );
|
buf.writeBoolean( true );
|
||||||
writeVarInt( type.getLeft().ordinal(), buf );
|
writeVarInt( type.getLeft(), buf );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
buf.writeBoolean( false );
|
buf.writeBoolean( false );
|
||||||
@@ -67,26 +67,11 @@ public class ServerLinks extends DefinedPacket
|
|||||||
handler.handle( this );
|
handler.handle( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum LinkType
|
|
||||||
{
|
|
||||||
|
|
||||||
REPORT_BUG,
|
|
||||||
COMMUNITY_GUIDELINES,
|
|
||||||
SUPPORT,
|
|
||||||
STATUS,
|
|
||||||
FEEDBACK,
|
|
||||||
COMMUNITY,
|
|
||||||
WEBSITE,
|
|
||||||
FORUMS,
|
|
||||||
NEWS,
|
|
||||||
ANNOUNCEMENTS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Link
|
public static class Link
|
||||||
{
|
{
|
||||||
|
|
||||||
private final Either<LinkType, BaseComponent> type;
|
private final Either<Integer, BaseComponent> type;
|
||||||
private final String url;
|
private final String url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,9 +11,9 @@ import net.md_5.bungee.nbt.TypedTag;
|
|||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.ChatSerializer;
|
import net.md_5.bungee.protocol.ChatSerializer;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.Either;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
import net.md_5.bungee.protocol.TagUtil;
|
import net.md_5.bungee.protocol.util.Either;
|
||||||
|
import net.md_5.bungee.protocol.util.TagUtil;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -6,8 +6,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.md_5.bungee.api.dialog.Dialog;
|
import net.md_5.bungee.api.dialog.Dialog;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.Either;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.util.Either;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -10,8 +10,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.Either;
|
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||||
|
import net.md_5.bungee.protocol.util.Either;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.util;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.util;
|
||||||
|
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
@@ -1,4 +1,4 @@
|
|||||||
package net.md_5.bungee.protocol;
|
package net.md_5.bungee.protocol.util;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
@@ -4,21 +4,21 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-parent</artifactId>
|
<artifactId>bungeecord-parent</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>net.md-5</groupId>
|
|
||||||
<artifactId>bungeecord-proxy</artifactId>
|
<artifactId>bungeecord-proxy</artifactId>
|
||||||
<version>1.21-R0.4-SNAPSHOT</version>
|
<version>1.21-R0.5-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BungeeCord-Proxy</name>
|
<name>BungeeCord-Proxy</name>
|
||||||
<description>Proxy component of the Elastic Portal Suite</description>
|
<description>Proxy component of the Elastic Portal Suite</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
<skipPublishing>true</skipPublishing>
|
||||||
<maven.deploy.skip>true</maven.deploy.skip>
|
<maven.deploy.skip>true</maven.deploy.skip>
|
||||||
<maven.javadoc.skip>true</maven.javadoc.skip>
|
<maven.javadoc.skip>true</maven.javadoc.skip>
|
||||||
</properties>
|
</properties>
|
||||||
@@ -64,37 +64,37 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-api</artifactId>
|
<artifactId>bungeecord-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-log</artifactId>
|
<artifactId>bungeecord-log</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-native</artifactId>
|
<artifactId>bungeecord-native</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-protocol</artifactId>
|
<artifactId>bungeecord-protocol</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-query</artifactId>
|
<artifactId>bungeecord-query</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.md-5</groupId>
|
<groupId>fr.pandacube.bungeecord</groupId>
|
||||||
<artifactId>bungeecord-slf4j</artifactId>
|
<artifactId>bungeecord-slf4j</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user