Skip to content

Commit

Permalink
Improve bungee mode
Browse files Browse the repository at this point in the history
  • Loading branch information
caoli5288 committed Nov 7, 2021
1 parent b4ea5a7 commit 9e63550
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 387 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ public class Constants {
public static final boolean DEBUG = Boolean.getBoolean("psql.debug");
public static final String PLUGIN_CHANNEL = "psql:psql";
public static final String MAGIC_KICK = "psql:done";
public static final byte[] EMPTY_ARRAY = new byte[0];
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.github.caoli5288.playersql.bungee.protocol;

import java.util.Objects;
import org.jetbrains.annotations.NotNull;

public enum ProtocolId {

READY,
CONTENTS,
REQUEST;

public static AbstractSqlPacket ofPacket(ProtocolId id) {
@NotNull
public static AbstractSqlPacket ofPacket(@NotNull ProtocolId id) {
switch (id) {
case READY:
return new PeerReady();
Expand All @@ -17,6 +18,6 @@ public static AbstractSqlPacket ofPacket(ProtocolId id) {
case REQUEST:
return new DataRequest();
}
throw new IllegalStateException("unknown ProtocolId " + id);
throw new EnumConstantNotPresentException(ProtocolId.class, "Unknown " + id);
}
}
4 changes: 2 additions & 2 deletions bungee/src/main/resources/bungee.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
main: com.mengcraft.playersql.bungee.PlayerSqlBungee
name: PlayerSQLPeerSupport
main: com.github.caoli5288.playersql.bungee.PlayerSqlBungee
name: PlayerSqlBungee
version: ${project.version}
website: http://www.spigotmc.org/resources/playersql.552/
author: [email protected]
6 changes: 0 additions & 6 deletions playersql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
</build>

<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
Expand Down
157 changes: 0 additions & 157 deletions playersql/src/main/java/com/mengcraft/playersql/Commands.java

This file was deleted.

2 changes: 0 additions & 2 deletions playersql/src/main/java/com/mengcraft/playersql/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class Config {
public static final boolean SYN_HEALTH;
public static final boolean SYN_INVENTORY;
public static final boolean KICK_LOAD_FAILED;
public static final boolean TRANSFER_ORIGIN;
public static final boolean OMIT_PLAYER_DEATH;
public static final boolean FORCE_PROTOCOLLIB;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DataSerializer {
break;
}
}
System.out.println(String.format("PACKET_DATA_SERIALIZER_FACTORY = %s", PACKET_DATA_SERIALIZER_FACTORY));
Bukkit.getLogger().info(String.format("PACKET_DATA_SERIALIZER_FACTORY = %s", PACKET_DATA_SERIALIZER_FACTORY));
}

@SneakyThrows
Expand Down
Loading

0 comments on commit 9e63550

Please sign in to comment.