Skip to content

Commit 9e63550

Browse files
committed
Improve bungee mode
1 parent b4ea5a7 commit 9e63550

File tree

15 files changed

+73
-387
lines changed

15 files changed

+73
-387
lines changed

bungee/src/main/java/com/github/caoli5288/playersql/bungee/Constants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ public class Constants {
55
public static final boolean DEBUG = Boolean.getBoolean("psql.debug");
66
public static final String PLUGIN_CHANNEL = "psql:psql";
77
public static final String MAGIC_KICK = "psql:done";
8+
public static final byte[] EMPTY_ARRAY = new byte[0];
89
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package com.github.caoli5288.playersql.bungee.protocol;
22

3-
import java.util.Objects;
3+
import org.jetbrains.annotations.NotNull;
44

55
public enum ProtocolId {
66

77
READY,
88
CONTENTS,
99
REQUEST;
1010

11-
public static AbstractSqlPacket ofPacket(ProtocolId id) {
11+
@NotNull
12+
public static AbstractSqlPacket ofPacket(@NotNull ProtocolId id) {
1213
switch (id) {
1314
case READY:
1415
return new PeerReady();
@@ -17,6 +18,6 @@ public static AbstractSqlPacket ofPacket(ProtocolId id) {
1718
case REQUEST:
1819
return new DataRequest();
1920
}
20-
throw new IllegalStateException("unknown ProtocolId " + id);
21+
throw new EnumConstantNotPresentException(ProtocolId.class, "Unknown " + id);
2122
}
2223
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
main: com.mengcraft.playersql.bungee.PlayerSqlBungee
2-
name: PlayerSQLPeerSupport
1+
main: com.github.caoli5288.playersql.bungee.PlayerSqlBungee
2+
name: PlayerSqlBungee
33
version: ${project.version}
44
website: http://www.spigotmc.org/resources/playersql.552/
55

playersql/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@
3939
</build>
4040

4141
<dependencies>
42-
<dependency>
43-
<groupId>org.jetbrains</groupId>
44-
<artifactId>annotations</artifactId>
45-
<version>22.0.0</version>
46-
<scope>provided</scope>
47-
</dependency>
4842
<dependency>
4943
<groupId>org.spigotmc</groupId>
5044
<artifactId>spigot-api</artifactId>

playersql/src/main/java/com/mengcraft/playersql/Commands.java

Lines changed: 0 additions & 157 deletions
This file was deleted.

playersql/src/main/java/com/mengcraft/playersql/Config.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public class Config {
1414
public static final boolean SYN_HEALTH;
1515
public static final boolean SYN_INVENTORY;
1616
public static final boolean KICK_LOAD_FAILED;
17-
public static final boolean TRANSFER_ORIGIN;
1817
public static final boolean OMIT_PLAYER_DEATH;
1918
public static final boolean FORCE_PROTOCOLLIB;
2019

@@ -33,7 +32,6 @@ public class Config {
3332
DEBUG = CONF.getBoolean("plugin.debug", false);
3433
OMIT_PLAYER_DEATH = CONF.getBoolean("plugin.omit-player-death", false);
3534
KICK_LOAD_FAILED = CONF.getBoolean("kick-load-failed", true);
36-
TRANSFER_ORIGIN = CONF.getBoolean("transfer-origin", false);
3735
FORCE_PROTOCOLLIB = CONF.getBoolean("plugin.use-protocollib-default", false);
3836
}
3937

playersql/src/main/java/com/mengcraft/playersql/DataSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class DataSerializer {
3434
break;
3535
}
3636
}
37-
System.out.println(String.format("PACKET_DATA_SERIALIZER_FACTORY = %s", PACKET_DATA_SERIALIZER_FACTORY));
37+
Bukkit.getLogger().info(String.format("PACKET_DATA_SERIALIZER_FACTORY = %s", PACKET_DATA_SERIALIZER_FACTORY));
3838
}
3939

4040
@SneakyThrows

0 commit comments

Comments
 (0)