Compare commits
15 Commits
dc1b540470
...
ab9955af93
Author | SHA1 | Date | |
---|---|---|---|
ab9955af93 | |||
fc32fc3f83 | |||
2d987260cd | |||
6ed66d9af8 | |||
31461d9d88 | |||
9e84eb399c | |||
|
b47ae0944c | ||
|
f9712cbc7c | ||
|
1b6d845530 | ||
|
19424aba9d | ||
|
71ac9b34fa | ||
|
7651d4a249 | ||
|
f8e0bccdf0 | ||
|
a5b6eb6afa | ||
|
41471da9db |
@ -23,4 +23,4 @@ Binaries
|
|||||||
--------
|
--------
|
||||||
Precompiled binaries are available for end users on [Jenkins](https://www.spigotmc.org/go/bungeecord-dl).
|
Precompiled binaries are available for end users on [Jenkins](https://www.spigotmc.org/go/bungeecord-dl).
|
||||||
|
|
||||||
(c) 2012-2022 SpigotMC Pty. Ltd.
|
(c) 2012-2023 SpigotMC Pty. Ltd.
|
||||||
|
@ -15,7 +15,7 @@ import net.md_5.bungee.api.event.ServerConnectEvent;
|
|||||||
import net.md_5.bungee.api.score.Scoreboard;
|
import net.md_5.bungee.api.score.Scoreboard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a player who's connection is being connected to somewhere else,
|
* Represents a player whose connection is being connected to somewhere else,
|
||||||
* whether it be a remote or embedded server.
|
* whether it be a remote or embedded server.
|
||||||
*/
|
*/
|
||||||
public interface ProxiedPlayer extends Connection, CommandSender
|
public interface ProxiedPlayer extends Connection, CommandSender
|
||||||
|
@ -9,6 +9,13 @@ import net.md_5.bungee.api.config.ServerInfo;
|
|||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.api.plugin.Event;
|
import net.md_5.bungee.api.plugin.Event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the player is disconnected from a server, for example during
|
||||||
|
* server switching.
|
||||||
|
*
|
||||||
|
* If the player is kicked from a server, {@link ServerKickEvent} will be called
|
||||||
|
* instead.
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@ToString(callSuper = false)
|
@ToString(callSuper = false)
|
||||||
|
@ -33,6 +33,7 @@ import net.md_5.bungee.api.ProxyServer;
|
|||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.event.EventBus;
|
import net.md_5.bungee.event.EventBus;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
import org.yaml.snakeyaml.LoaderOptions;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
import org.yaml.snakeyaml.constructor.Constructor;
|
import org.yaml.snakeyaml.constructor.Constructor;
|
||||||
import org.yaml.snakeyaml.introspector.PropertyUtils;
|
import org.yaml.snakeyaml.introspector.PropertyUtils;
|
||||||
@ -64,7 +65,7 @@ public final class PluginManager
|
|||||||
this.proxy = proxy;
|
this.proxy = proxy;
|
||||||
|
|
||||||
// Ignore unknown entries in the plugin descriptions
|
// Ignore unknown entries in the plugin descriptions
|
||||||
Constructor yamlConstructor = new Constructor();
|
Constructor yamlConstructor = new Constructor( new LoaderOptions() );
|
||||||
PropertyUtils propertyUtils = yamlConstructor.getPropertyUtils();
|
PropertyUtils propertyUtils = yamlConstructor.getPropertyUtils();
|
||||||
propertyUtils.setSkipMissingProperties( true );
|
propertyUtils.setSkipMissingProperties( true );
|
||||||
yamlConstructor.setPropertyUtils( propertyUtils );
|
yamlConstructor.setPropertyUtils( propertyUtils );
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.3.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifestEntries>
|
<manifestEntries>
|
||||||
@ -52,7 +52,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.3</version>
|
<version>3.4.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
|
@ -30,6 +30,10 @@ public final class TranslatableComponent extends BaseComponent
|
|||||||
* The components to substitute into the translation
|
* The components to substitute into the translation
|
||||||
*/
|
*/
|
||||||
private List<BaseComponent> with;
|
private List<BaseComponent> with;
|
||||||
|
/**
|
||||||
|
* The fallback, if the translation is not found
|
||||||
|
*/
|
||||||
|
private String fallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a translatable component from the original to clone it.
|
* Creates a translatable component from the original to clone it.
|
||||||
@ -153,6 +157,11 @@ public final class TranslatableComponent extends BaseComponent
|
|||||||
{
|
{
|
||||||
String trans = TranslationRegistry.INSTANCE.translate( translate );
|
String trans = TranslationRegistry.INSTANCE.translate( translate );
|
||||||
|
|
||||||
|
if ( trans.equals( translate ) && fallback != null )
|
||||||
|
{
|
||||||
|
trans = fallback;
|
||||||
|
}
|
||||||
|
|
||||||
Matcher matcher = format.matcher( trans );
|
Matcher matcher = format.matcher( trans );
|
||||||
int position = 0;
|
int position = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -28,7 +28,11 @@ public class TranslatableComponentSerializer extends BaseComponentSerializer imp
|
|||||||
component.setTranslate( object.get( "translate" ).getAsString() );
|
component.setTranslate( object.get( "translate" ).getAsString() );
|
||||||
if ( object.has( "with" ) )
|
if ( object.has( "with" ) )
|
||||||
{
|
{
|
||||||
component.setWith( Arrays.asList( context.<BaseComponent[]>deserialize( object.get( "with" ), BaseComponent[].class ) ) );
|
component.setWith( Arrays.asList( context.deserialize( object.get( "with" ), BaseComponent[].class ) ) );
|
||||||
|
}
|
||||||
|
if ( object.has( "fallback" ) )
|
||||||
|
{
|
||||||
|
component.setFallback( object.get( "fallback" ).getAsString() );
|
||||||
}
|
}
|
||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
@ -43,6 +47,10 @@ public class TranslatableComponentSerializer extends BaseComponentSerializer imp
|
|||||||
{
|
{
|
||||||
object.add( "with", context.serialize( src.getWith() ) );
|
object.add( "with", context.serialize( src.getWith() ) );
|
||||||
}
|
}
|
||||||
|
if ( src.getFallback() != null )
|
||||||
|
{
|
||||||
|
object.addProperty( "fallback", src.getFallback() );
|
||||||
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ import java.util.Map;
|
|||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.yaml.snakeyaml.DumperOptions;
|
import org.yaml.snakeyaml.DumperOptions;
|
||||||
|
import org.yaml.snakeyaml.LoaderOptions;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
import org.yaml.snakeyaml.constructor.Constructor;
|
import org.yaml.snakeyaml.constructor.Constructor;
|
||||||
import org.yaml.snakeyaml.nodes.Node;
|
import org.yaml.snakeyaml.nodes.Node;
|
||||||
@ -29,7 +30,10 @@ public class YamlConfiguration extends ConfigurationProvider
|
|||||||
@Override
|
@Override
|
||||||
protected Yaml initialValue()
|
protected Yaml initialValue()
|
||||||
{
|
{
|
||||||
Representer representer = new Representer()
|
DumperOptions options = new DumperOptions();
|
||||||
|
options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK );
|
||||||
|
|
||||||
|
Representer representer = new Representer( options )
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
representers.put( Configuration.class, new Represent()
|
representers.put( Configuration.class, new Represent()
|
||||||
@ -43,10 +47,7 @@ public class YamlConfiguration extends ConfigurationProvider
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
DumperOptions options = new DumperOptions();
|
return new Yaml( new Constructor( new LoaderOptions() ), representer, options );
|
||||||
options.setDefaultFlowStyle( DumperOptions.FlowStyle.BLOCK );
|
|
||||||
|
|
||||||
return new Yaml( new Constructor(), representer, options );
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
12
pom.xml
12
pom.xml
@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<build.number>unknown</build.number>
|
<build.number>unknown</build.number>
|
||||||
<lombok.version>1.18.22</lombok.version>
|
<lombok.version>1.18.26</lombok.version>
|
||||||
<netty.version>4.1.85.Final</netty.version>
|
<netty.version>4.1.85.Final</netty.version>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
@ -126,12 +126,12 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.11.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>3.1.2</version>
|
<version>3.2.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>process-classes</phase>
|
<phase>process-classes</phase>
|
||||||
@ -156,7 +156,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
||||||
<version>1.20</version>
|
<version>1.22</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>process-classes</phase>
|
<phase>process-classes</phase>
|
||||||
@ -269,7 +269,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.5.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<!-- Execute Javadoc once normally to catch any warnings -->
|
<!-- Execute Javadoc once normally to catch any warnings -->
|
||||||
<execution>
|
<execution>
|
||||||
@ -307,7 +307,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
<version>1.6</version>
|
<version>3.0.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>verify</phase>
|
<phase>verify</phase>
|
||||||
|
@ -84,7 +84,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x21 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x21 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x1E ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x1E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x20 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x20 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x1F )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x1F ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x23 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Login.class,
|
Login.class,
|
||||||
@ -98,7 +99,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x26 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x26 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x23 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x23 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x25 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x25 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x24 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x24 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x28 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket( Chat.class,
|
TO_CLIENT.registerPacket( Chat.class,
|
||||||
Chat::new,
|
Chat::new,
|
||||||
@ -125,7 +127,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x3D ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x3D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x3B ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x3B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x3E ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x3E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x3D )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x3D ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x41 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
BossBar.class,
|
BossBar.class,
|
||||||
@ -134,7 +137,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_15, 0x0D ),
|
map( ProtocolConstants.MINECRAFT_1_15, 0x0D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_16, 0x0C ),
|
map( ProtocolConstants.MINECRAFT_1_16, 0x0C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x0D ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x0D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x0A )
|
map( ProtocolConstants.MINECRAFT_1_19, 0x0A ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0xB )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PlayerListItem.class, // PlayerInfo
|
PlayerListItem.class, // PlayerInfo
|
||||||
@ -163,7 +167,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_16_2, 0x0F ),
|
map( ProtocolConstants.MINECRAFT_1_16_2, 0x0F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x11 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x11 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x0E ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x0E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0D )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0D ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0xF )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ScoreboardObjective.class,
|
ScoreboardObjective.class,
|
||||||
@ -177,7 +182,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_15, 0x4A ),
|
map( ProtocolConstants.MINECRAFT_1_15, 0x4A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x53 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x53 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x56 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x56 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x54 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x54 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x58 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ScoreboardScore.class,
|
ScoreboardScore.class,
|
||||||
@ -191,7 +197,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_15, 0x4D ),
|
map( ProtocolConstants.MINECRAFT_1_15, 0x4D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x56 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x56 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x59 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x59 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x57 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x57 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5B )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ScoreboardDisplay.class,
|
ScoreboardDisplay.class,
|
||||||
@ -205,7 +212,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_15, 0x43 ),
|
map( ProtocolConstants.MINECRAFT_1_15, 0x43 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x4C ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x4C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x4F ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x4F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x4D )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x4D ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x51 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Team.class,
|
Team.class,
|
||||||
@ -219,7 +227,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_15, 0x4C ),
|
map( ProtocolConstants.MINECRAFT_1_15, 0x4C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x55 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x55 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x58 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x58 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x56 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x56 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5A )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PluginMessage.class,
|
PluginMessage.class,
|
||||||
@ -234,7 +243,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x18 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x18 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x15 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x15 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x16 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x16 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x15 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x15 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x17 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Kick.class,
|
Kick.class,
|
||||||
@ -249,7 +259,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x1A ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x1A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x17 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x17 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x19 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x19 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x17 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x17 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1A )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Title.class,
|
Title.class,
|
||||||
@ -264,14 +275,16 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x59 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x59 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_18, 0x5A ),
|
map( ProtocolConstants.MINECRAFT_1_18, 0x5A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x5D ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x5D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x5B )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x5B ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5F )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ClearTitles.class,
|
ClearTitles.class,
|
||||||
ClearTitles::new,
|
ClearTitles::new,
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x10 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x10 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x0D ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x0D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0C )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0C ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0xE )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Subtitle.class,
|
Subtitle.class,
|
||||||
@ -279,7 +292,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x57 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x57 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_18, 0x58 ),
|
map( ProtocolConstants.MINECRAFT_1_18, 0x58 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x5B ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x5B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x59 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x59 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5D )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
TitleTimes.class,
|
TitleTimes.class,
|
||||||
@ -287,14 +301,16 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x5A ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x5A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_18, 0x5B ),
|
map( ProtocolConstants.MINECRAFT_1_18, 0x5B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x5E ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x5E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x5C )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x5C ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x60 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
SystemChat.class,
|
SystemChat.class,
|
||||||
SystemChat::new,
|
SystemChat::new,
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x5F ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x5F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x62 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x62 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x60 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x60 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x64 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PlayerListHeaderFooter.class,
|
PlayerListHeaderFooter.class,
|
||||||
@ -312,7 +328,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_18, 0x5F ),
|
map( ProtocolConstants.MINECRAFT_1_18, 0x5F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x60 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x60 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x63 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x63 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x61 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x61 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x65 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
EntityStatus.class,
|
EntityStatus.class,
|
||||||
@ -327,7 +344,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x1B ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x1B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x18 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x18 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x1A ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x1A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x19 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x19 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1C )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
Commands.class,
|
Commands.class,
|
||||||
@ -338,7 +356,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_16_2, 0x10 ),
|
map( ProtocolConstants.MINECRAFT_1_16_2, 0x10 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x12 ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x12 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x0F ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x0F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0E )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0E ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x10 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
GameState.class,
|
GameState.class,
|
||||||
@ -349,7 +368,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x1E ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x1E ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x1B ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x1B ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x1D ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x1D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x1C )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x1C ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1F )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ViewDistance.class,
|
ViewDistance.class,
|
||||||
@ -360,24 +380,28 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x4A ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x4A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x49 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x49 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x4C ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x4C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x4B )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x4B ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x4F )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
ServerData.class,
|
ServerData.class,
|
||||||
ServerData::new,
|
ServerData::new,
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x3F ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x3F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x42 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x42 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x41 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x41 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x45 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PlayerListItemRemove.class,
|
PlayerListItemRemove.class,
|
||||||
PlayerListItemRemove::new,
|
PlayerListItemRemove::new,
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x35 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x35 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x39 )
|
||||||
);
|
);
|
||||||
TO_CLIENT.registerPacket(
|
TO_CLIENT.registerPacket(
|
||||||
PlayerListItemUpdate.class,
|
PlayerListItemUpdate.class,
|
||||||
PlayerListItemUpdate::new,
|
PlayerListItemUpdate::new,
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x36 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x36 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x3A )
|
||||||
);
|
);
|
||||||
|
|
||||||
TO_SERVER.registerPacket(
|
TO_SERVER.registerPacket(
|
||||||
@ -393,7 +417,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x0F ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x0F ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x11 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x11 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x12 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x12 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x11 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x11 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x12 )
|
||||||
);
|
);
|
||||||
TO_SERVER.registerPacket( Chat.class,
|
TO_SERVER.registerPacket( Chat.class,
|
||||||
Chat::new,
|
Chat::new,
|
||||||
@ -427,7 +452,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_14, 0x06 ),
|
map( ProtocolConstants.MINECRAFT_1_14, 0x06 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x08 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x08 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x09 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x09 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x08 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x08 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x09 )
|
||||||
);
|
);
|
||||||
TO_SERVER.registerPacket(
|
TO_SERVER.registerPacket(
|
||||||
ClientSettings.class,
|
ClientSettings.class,
|
||||||
@ -439,7 +465,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_14, 0x05 ),
|
map( ProtocolConstants.MINECRAFT_1_14, 0x05 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x07 ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x07 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x08 ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x08 ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x07 )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x07 ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x08 )
|
||||||
);
|
);
|
||||||
TO_SERVER.registerPacket(
|
TO_SERVER.registerPacket(
|
||||||
PluginMessage.class,
|
PluginMessage.class,
|
||||||
@ -453,7 +480,8 @@ public enum Protocol
|
|||||||
map( ProtocolConstants.MINECRAFT_1_17, 0x0A ),
|
map( ProtocolConstants.MINECRAFT_1_17, 0x0A ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19, 0x0C ),
|
map( ProtocolConstants.MINECRAFT_1_19, 0x0C ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x0D ),
|
map( ProtocolConstants.MINECRAFT_1_19_1, 0x0D ),
|
||||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0C )
|
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0C ),
|
||||||
|
map( ProtocolConstants.MINECRAFT_1_19_4, 0x0D )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -41,6 +41,7 @@ public class ProtocolConstants
|
|||||||
public static final int MINECRAFT_1_19 = 759;
|
public static final int MINECRAFT_1_19 = 759;
|
||||||
public static final int MINECRAFT_1_19_1 = 760;
|
public static final int MINECRAFT_1_19_1 = 760;
|
||||||
public static final int MINECRAFT_1_19_3 = 761;
|
public static final int MINECRAFT_1_19_3 = 761;
|
||||||
|
public static final int MINECRAFT_1_19_4 = 762;
|
||||||
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;
|
||||||
|
|
||||||
@ -94,7 +95,8 @@ public class ProtocolConstants
|
|||||||
ProtocolConstants.MINECRAFT_1_18_2,
|
ProtocolConstants.MINECRAFT_1_18_2,
|
||||||
ProtocolConstants.MINECRAFT_1_19,
|
ProtocolConstants.MINECRAFT_1_19,
|
||||||
ProtocolConstants.MINECRAFT_1_19_1,
|
ProtocolConstants.MINECRAFT_1_19_1,
|
||||||
ProtocolConstants.MINECRAFT_1_19_3
|
ProtocolConstants.MINECRAFT_1_19_3,
|
||||||
|
ProtocolConstants.MINECRAFT_1_19_4
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( SNAPSHOT_SUPPORT )
|
if ( SNAPSHOT_SUPPORT )
|
||||||
|
@ -310,6 +310,7 @@ public class Commands extends DefinedPacket
|
|||||||
private static final Map<String, ArgumentSerializer> PROVIDERS = new HashMap<>();
|
private static final Map<String, ArgumentSerializer> PROVIDERS = new HashMap<>();
|
||||||
private static final ArgumentSerializer[] IDS_1_19;
|
private static final ArgumentSerializer[] IDS_1_19;
|
||||||
private static final ArgumentSerializer[] IDS_1_19_3;
|
private static final ArgumentSerializer[] IDS_1_19_3;
|
||||||
|
private static final ArgumentSerializer[] IDS_1_19_4;
|
||||||
private static final Map<Class<?>, ProperArgumentSerializer<?>> PROPER_PROVIDERS = new HashMap<>();
|
private static final Map<Class<?>, ProperArgumentSerializer<?>> PROPER_PROVIDERS = new HashMap<>();
|
||||||
//
|
//
|
||||||
private static final ArgumentSerializer<Void> VOID = new ArgumentSerializer<Void>()
|
private static final ArgumentSerializer<Void> VOID = new ArgumentSerializer<Void>()
|
||||||
@ -364,7 +365,7 @@ public class Commands extends DefinedPacket
|
|||||||
buf.writeByte( t );
|
buf.writeByte( t );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ProperArgumentSerializer<FloatArgumentType> FLOAT = new ProperArgumentSerializer<FloatArgumentType>()
|
private static final ProperArgumentSerializer<FloatArgumentType> FLOAT_RANGE = new ProperArgumentSerializer<FloatArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected FloatArgumentType read(ByteBuf buf)
|
protected FloatArgumentType read(ByteBuf buf)
|
||||||
@ -405,7 +406,7 @@ public class Commands extends DefinedPacket
|
|||||||
return "brigadier:float";
|
return "brigadier:float";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ProperArgumentSerializer<DoubleArgumentType> DOUBLE = new ProperArgumentSerializer<DoubleArgumentType>()
|
private static final ProperArgumentSerializer<DoubleArgumentType> DOUBLE_RANGE = new ProperArgumentSerializer<DoubleArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected DoubleArgumentType read(ByteBuf buf)
|
protected DoubleArgumentType read(ByteBuf buf)
|
||||||
@ -446,7 +447,7 @@ public class Commands extends DefinedPacket
|
|||||||
return "brigadier:double";
|
return "brigadier:double";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ProperArgumentSerializer<IntegerArgumentType> INTEGER = new ProperArgumentSerializer<IntegerArgumentType>()
|
private static final ProperArgumentSerializer<IntegerArgumentType> INTEGER_RANGE = new ProperArgumentSerializer<IntegerArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected IntegerArgumentType read(ByteBuf buf)
|
protected IntegerArgumentType read(ByteBuf buf)
|
||||||
@ -487,7 +488,21 @@ public class Commands extends DefinedPacket
|
|||||||
return "brigadier:integer";
|
return "brigadier:integer";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final ProperArgumentSerializer<LongArgumentType> LONG = new ProperArgumentSerializer<LongArgumentType>()
|
private static final ArgumentSerializer<Integer> INTEGER = new ArgumentSerializer<Integer>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected Integer read(ByteBuf buf)
|
||||||
|
{
|
||||||
|
return buf.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void write(ByteBuf buf, Integer t)
|
||||||
|
{
|
||||||
|
buf.writeInt( t );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private static final ProperArgumentSerializer<LongArgumentType> LONG_RANGE = new ProperArgumentSerializer<LongArgumentType>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected LongArgumentType read(ByteBuf buf)
|
protected LongArgumentType read(ByteBuf buf)
|
||||||
@ -585,17 +600,17 @@ public class Commands extends DefinedPacket
|
|||||||
register( "brigadier:bool", BOOLEAN );
|
register( "brigadier:bool", BOOLEAN );
|
||||||
PROPER_PROVIDERS.put( BoolArgumentType.class, BOOLEAN );
|
PROPER_PROVIDERS.put( BoolArgumentType.class, BOOLEAN );
|
||||||
|
|
||||||
register( "brigadier:float", FLOAT );
|
register( "brigadier:float", FLOAT_RANGE );
|
||||||
PROPER_PROVIDERS.put( FloatArgumentType.class, FLOAT );
|
PROPER_PROVIDERS.put( FloatArgumentType.class, FLOAT_RANGE );
|
||||||
|
|
||||||
register( "brigadier:double", DOUBLE );
|
register( "brigadier:double", DOUBLE_RANGE );
|
||||||
PROPER_PROVIDERS.put( DoubleArgumentType.class, DOUBLE );
|
PROPER_PROVIDERS.put( DoubleArgumentType.class, DOUBLE_RANGE );
|
||||||
|
|
||||||
register( "brigadier:integer", INTEGER );
|
register( "brigadier:integer", INTEGER_RANGE );
|
||||||
PROPER_PROVIDERS.put( IntegerArgumentType.class, INTEGER );
|
PROPER_PROVIDERS.put( IntegerArgumentType.class, INTEGER_RANGE );
|
||||||
|
|
||||||
register( "brigadier:long", LONG ); // 1.14+
|
register( "brigadier:long", LONG_RANGE ); // 1.14+
|
||||||
PROPER_PROVIDERS.put( LongArgumentType.class, LONG );
|
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 );
|
||||||
@ -636,7 +651,7 @@ public class Commands extends DefinedPacket
|
|||||||
register( "minecraft:item_enchantment", VOID );
|
register( "minecraft:item_enchantment", VOID );
|
||||||
register( "minecraft:entity_summon", VOID );
|
register( "minecraft:entity_summon", VOID );
|
||||||
register( "minecraft:dimension", VOID );
|
register( "minecraft:dimension", VOID );
|
||||||
register( "minecraft:time", VOID ); // 1.14
|
register( "minecraft:time_legacy", VOID ); // 1.14
|
||||||
register( "minecraft:resource_or_tag", RAW_STRING ); // 1.18.2
|
register( "minecraft:resource_or_tag", RAW_STRING ); // 1.18.2
|
||||||
register( "minecraft:resource", RAW_STRING ); // 1.18.2
|
register( "minecraft:resource", RAW_STRING ); // 1.18.2
|
||||||
register( "minecraft:template_mirror", VOID ); // 1.19
|
register( "minecraft:template_mirror", VOID ); // 1.19
|
||||||
@ -647,6 +662,9 @@ public class Commands extends DefinedPacket
|
|||||||
register( "minecraft:resource_or_tag_key", RAW_STRING ); // 1.19.3
|
register( "minecraft:resource_or_tag_key", RAW_STRING ); // 1.19.3
|
||||||
register( "minecraft:resource_key", RAW_STRING ); // 1.19.3
|
register( "minecraft:resource_key", RAW_STRING ); // 1.19.3
|
||||||
|
|
||||||
|
register( "minecraft:heightmap", VOID ); // 1.19.4
|
||||||
|
register( "minecraft:time", INTEGER ); // 1.19.4
|
||||||
|
|
||||||
register( "minecraft:nbt", VOID ); // 1.13 // removed
|
register( "minecraft:nbt", VOID ); // 1.13 // removed
|
||||||
IDS_1_19 = new ArgumentSerializer[]
|
IDS_1_19 = new ArgumentSerializer[]
|
||||||
{
|
{
|
||||||
@ -692,7 +710,7 @@ public class Commands extends DefinedPacket
|
|||||||
get( "minecraft:item_enchantment" ),
|
get( "minecraft:item_enchantment" ),
|
||||||
get( "minecraft:entity_summon" ),
|
get( "minecraft:entity_summon" ),
|
||||||
get( "minecraft:dimension" ),
|
get( "minecraft:dimension" ),
|
||||||
get( "minecraft:time" ),
|
get( "minecraft:time_legacy" ),
|
||||||
get( "minecraft:resource_or_tag" ),
|
get( "minecraft:resource_or_tag" ),
|
||||||
get( "minecraft:resource" ),
|
get( "minecraft:resource" ),
|
||||||
get( "minecraft:template_mirror" ),
|
get( "minecraft:template_mirror" ),
|
||||||
@ -742,7 +760,7 @@ public class Commands extends DefinedPacket
|
|||||||
get( "minecraft:float_range" ),
|
get( "minecraft:float_range" ),
|
||||||
get( "minecraft:dimension" ),
|
get( "minecraft:dimension" ),
|
||||||
get( "minecraft:gamemode" ),
|
get( "minecraft:gamemode" ),
|
||||||
get( "minecraft:time" ),
|
get( "minecraft:time_legacy" ),
|
||||||
get( "minecraft:resource_or_tag" ),
|
get( "minecraft:resource_or_tag" ),
|
||||||
get( "minecraft:resource_or_tag_key" ),
|
get( "minecraft:resource_or_tag_key" ),
|
||||||
get( "minecraft:resource" ),
|
get( "minecraft:resource" ),
|
||||||
@ -751,6 +769,59 @@ public class Commands extends DefinedPacket
|
|||||||
get( "minecraft:template_rotation" ),
|
get( "minecraft:template_rotation" ),
|
||||||
get( "minecraft:uuid" )
|
get( "minecraft:uuid" )
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IDS_1_19_4 = new ArgumentSerializer[]
|
||||||
|
{
|
||||||
|
get( "brigadier:bool" ),
|
||||||
|
get( "brigadier:float" ),
|
||||||
|
get( "brigadier:double" ),
|
||||||
|
get( "brigadier:integer" ),
|
||||||
|
get( "brigadier:long" ),
|
||||||
|
get( "brigadier:string" ),
|
||||||
|
get( "minecraft:entity" ),
|
||||||
|
get( "minecraft:game_profile" ),
|
||||||
|
get( "minecraft:block_pos" ),
|
||||||
|
get( "minecraft:column_pos" ),
|
||||||
|
get( "minecraft:vec3" ),
|
||||||
|
get( "minecraft:vec2" ),
|
||||||
|
get( "minecraft:block_state" ),
|
||||||
|
get( "minecraft:block_predicate" ),
|
||||||
|
get( "minecraft:item_stack" ),
|
||||||
|
get( "minecraft:item_predicate" ),
|
||||||
|
get( "minecraft:color" ),
|
||||||
|
get( "minecraft:component" ),
|
||||||
|
get( "minecraft:message" ),
|
||||||
|
get( "minecraft:nbt_compound_tag" ),
|
||||||
|
get( "minecraft:nbt_tag" ),
|
||||||
|
get( "minecraft:nbt_path" ),
|
||||||
|
get( "minecraft:objective" ),
|
||||||
|
get( "minecraft:objective_criteria" ),
|
||||||
|
get( "minecraft:operation" ),
|
||||||
|
get( "minecraft:particle" ),
|
||||||
|
get( "minecraft:angle" ),
|
||||||
|
get( "minecraft:rotation" ),
|
||||||
|
get( "minecraft:scoreboard_slot" ),
|
||||||
|
get( "minecraft:score_holder" ),
|
||||||
|
get( "minecraft:swizzle" ),
|
||||||
|
get( "minecraft:team" ),
|
||||||
|
get( "minecraft:item_slot" ),
|
||||||
|
get( "minecraft:resource_location" ),
|
||||||
|
get( "minecraft:function" ),
|
||||||
|
get( "minecraft:entity_anchor" ),
|
||||||
|
get( "minecraft:int_range" ),
|
||||||
|
get( "minecraft:float_range" ),
|
||||||
|
get( "minecraft:dimension" ),
|
||||||
|
get( "minecraft:gamemode" ),
|
||||||
|
get( "minecraft:time" ),
|
||||||
|
get( "minecraft:resource_or_tag" ),
|
||||||
|
get( "minecraft:resource_or_tag_key" ),
|
||||||
|
get( "minecraft:resource" ),
|
||||||
|
get( "minecraft:resource_key" ),
|
||||||
|
get( "minecraft:template_mirror" ),
|
||||||
|
get( "minecraft:template_rotation" ),
|
||||||
|
get( "minecraft:uuid" ),
|
||||||
|
get( "minecraft:heightmap" )
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void register(String name, ArgumentSerializer serializer)
|
private static void register(String name, ArgumentSerializer serializer)
|
||||||
@ -1170,7 +1241,10 @@ public class Commands extends DefinedPacket
|
|||||||
{
|
{
|
||||||
key = readVarInt( buf );
|
key = readVarInt( buf );
|
||||||
|
|
||||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_3 )
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 )
|
||||||
|
{
|
||||||
|
reader = IDS_1_19_4[(Integer) key];
|
||||||
|
} else if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_3 )
|
||||||
{
|
{
|
||||||
reader = IDS_1_19_3[(Integer) key];
|
reader = IDS_1_19_3[(Integer) key];
|
||||||
} else
|
} else
|
||||||
|
@ -17,21 +17,27 @@ public class ServerData extends DefinedPacket
|
|||||||
{
|
{
|
||||||
|
|
||||||
private String motd;
|
private String motd;
|
||||||
private String icon;
|
private Object icon;
|
||||||
private boolean preview;
|
private boolean preview;
|
||||||
private boolean enforceSecure;
|
private boolean enforceSecure;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||||
{
|
{
|
||||||
if ( buf.readBoolean() )
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 || buf.readBoolean() )
|
||||||
{
|
{
|
||||||
motd = readString( buf, 262144 );
|
motd = readString( buf, 262144 );
|
||||||
}
|
}
|
||||||
if ( buf.readBoolean() )
|
if ( buf.readBoolean() )
|
||||||
|
{
|
||||||
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 )
|
||||||
|
{
|
||||||
|
icon = DefinedPacket.readArray( buf );
|
||||||
|
} else
|
||||||
{
|
{
|
||||||
icon = readString( buf );
|
icon = readString( buf );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_19_3 )
|
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_19_3 )
|
||||||
{
|
{
|
||||||
@ -48,18 +54,32 @@ public class ServerData extends DefinedPacket
|
|||||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||||
{
|
{
|
||||||
if ( motd != null )
|
if ( motd != null )
|
||||||
|
{
|
||||||
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 )
|
||||||
{
|
{
|
||||||
buf.writeBoolean( true );
|
buf.writeBoolean( true );
|
||||||
|
}
|
||||||
writeString( motd, buf, 262144 );
|
writeString( motd, buf, 262144 );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 )
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException( "MOTD required for this version" );
|
||||||
|
}
|
||||||
|
|
||||||
buf.writeBoolean( false );
|
buf.writeBoolean( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( icon != null )
|
if ( icon != null )
|
||||||
{
|
{
|
||||||
buf.writeBoolean( true );
|
buf.writeBoolean( true );
|
||||||
writeString( icon, buf );
|
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 )
|
||||||
|
{
|
||||||
|
DefinedPacket.writeArray( (byte[]) icon, buf );
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
writeString( (String) icon, buf );
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
buf.writeBoolean( false );
|
buf.writeBoolean( false );
|
||||||
|
@ -98,9 +98,9 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<version>8.0.29</version>
|
<version>8.0.32</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- add these back in as they are not exposed by the API -->
|
<!-- add these back in as they are not exposed by the API -->
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package net.md_5.bungee.command;
|
package net.md_5.bungee.command;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
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.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
public class CommandIP extends PlayerCommand
|
public class CommandIP extends PlayerCommand
|
||||||
@ -26,7 +29,17 @@ public class CommandIP extends PlayerCommand
|
|||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "user_not_online" ) );
|
sender.sendMessage( ProxyServer.getInstance().getTranslation( "user_not_online" ) );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
sender.sendMessage( ProxyServer.getInstance().getTranslation( "command_ip", args[0], user.getSocketAddress() ) );
|
sender.sendMessage( new ComponentBuilder()
|
||||||
|
.appendLegacy( ProxyServer.getInstance().getTranslation( "command_ip", user.getName(), user.getSocketAddress() ) )
|
||||||
|
.event( new ClickEvent( ClickEvent.Action.COPY_TO_CLIPBOARD, user.getSocketAddress().toString() ) )
|
||||||
|
.create()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterable<String> onTabComplete(CommandSender sender, String[] args)
|
||||||
|
{
|
||||||
|
return ( args.length == 1 ) ? super.onTabComplete( sender, args ) : Collections.emptyList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -762,9 +762,10 @@ public class DownstreamBridge extends PacketHandler
|
|||||||
@Override
|
@Override
|
||||||
public void handle(ServerData serverData) throws Exception
|
public void handle(ServerData serverData) throws Exception
|
||||||
{
|
{
|
||||||
serverData.setMotd( null );
|
// 1.19.4 doesn't allow empty MOTD and we probably don't want to simulate a ping event to get the "correct" one
|
||||||
serverData.setIcon( null );
|
// serverData.setMotd( null );
|
||||||
con.unsafe().sendPacket( serverData );
|
// serverData.setIcon( null );
|
||||||
|
// con.unsafe().sendPacket( serverData );
|
||||||
throw CancelSendSignal.INSTANCE;
|
throw CancelSendSignal.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,14 +575,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
if ( oldName != null )
|
if ( oldName != null )
|
||||||
{
|
{
|
||||||
// TODO See #1218
|
// TODO See #1218
|
||||||
oldName.disconnect( bungee.getTranslation( "already_connected_proxy" ) );
|
disconnect( bungee.getTranslation( "already_connected_proxy" ) );
|
||||||
}
|
}
|
||||||
// And then also for their old UUID
|
// And then also for their old UUID
|
||||||
ProxiedPlayer oldID = bungee.getPlayer( getUniqueId() );
|
ProxiedPlayer oldID = bungee.getPlayer( getUniqueId() );
|
||||||
if ( oldID != null )
|
if ( oldID != null )
|
||||||
{
|
{
|
||||||
// TODO See #1218
|
// TODO See #1218
|
||||||
oldID.disconnect( bungee.getTranslation( "already_connected_proxy" ) );
|
disconnect( bungee.getTranslation( "already_connected_proxy" ) );
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
@ -79,6 +79,8 @@ public abstract class EntityMap
|
|||||||
case ProtocolConstants.MINECRAFT_1_19_1:
|
case ProtocolConstants.MINECRAFT_1_19_1:
|
||||||
case ProtocolConstants.MINECRAFT_1_19_3:
|
case ProtocolConstants.MINECRAFT_1_19_3:
|
||||||
return EntityMap_1_16_2.INSTANCE_1_19_1;
|
return EntityMap_1_16_2.INSTANCE_1_19_1;
|
||||||
|
case ProtocolConstants.MINECRAFT_1_19_4:
|
||||||
|
return EntityMap_1_16_2.INSTANCE_1_19_4;
|
||||||
}
|
}
|
||||||
throw new RuntimeException( "Version " + version + " has no entity map" );
|
throw new RuntimeException( "Version " + version + " has no entity map" );
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ class EntityMap_1_16_2 extends EntityMap
|
|||||||
static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D );
|
static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D );
|
||||||
static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F );
|
static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F );
|
||||||
static final EntityMap_1_16_2 INSTANCE_1_19_1 = new EntityMap_1_16_2( 0x02, 0x30 );
|
static final EntityMap_1_16_2 INSTANCE_1_19_1 = new EntityMap_1_16_2( 0x02, 0x30 );
|
||||||
|
static final EntityMap_1_16_2 INSTANCE_1_19_4 = new EntityMap_1_16_2( 0x03, 0x30 );
|
||||||
//
|
//
|
||||||
private final int spawnPlayerId;
|
private final int spawnPlayerId;
|
||||||
private final int spectateId;
|
private final int spectateId;
|
||||||
|
Loading…
Reference in New Issue
Block a user