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