Skip to content

Commit 04428fe

Browse files
author
games647
authored
Merge pull request #543 from Smart123s/fix-warnings
Get rid of several warning messages
2 parents d1109ac + 9656aad commit 04428fe

File tree

11 files changed

+5
-29
lines changed

11 files changed

+5
-29
lines changed

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitLoginSession.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,32 @@ public class BukkitLoginSession extends LoginSession {
4040

4141
private static final byte[] EMPTY_ARRAY = {};
4242

43-
private final String serverId;
4443
private final byte[] verifyToken;
4544

4645
private boolean verified;
4746

4847
private SkinProperty skinProperty;
4948

50-
public BukkitLoginSession(String username, String serverId, byte[] verifyToken, boolean registered
49+
public BukkitLoginSession(String username, byte[] verifyToken, boolean registered
5150
, StoredProfile profile) {
5251
super(username, registered, profile);
5352

54-
this.serverId = serverId;
5553
this.verifyToken = verifyToken.clone();
5654
}
5755

5856
//available for BungeeCord
5957
public BukkitLoginSession(String username, boolean registered) {
60-
this(username, "", EMPTY_ARRAY, registered, null);
58+
this(username, EMPTY_ARRAY, registered, null);
6159
}
6260

6361
//cracked player
6462
public BukkitLoginSession(String username, StoredProfile profile) {
65-
this(username, "", EMPTY_ARRAY, false, profile);
63+
this(username, EMPTY_ARRAY, false, profile);
6664
}
6765

6866
//ProtocolSupport
6967
public BukkitLoginSession(String username, boolean registered, StoredProfile profile) {
70-
this(username, "", EMPTY_ARRAY, registered, profile);
68+
this(username, EMPTY_ARRAY, registered, profile);
7169
}
7270

7371
/**

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitScheduler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@
3636

3737
public class BukkitScheduler extends AsyncScheduler {
3838

39-
private final Plugin plugin;
4039
private final Executor syncExecutor;
4140

4241
public BukkitScheduler(Plugin plugin, Logger logger, ThreadFactory threadFactory) {
4342
super(logger, threadFactory);
44-
this.plugin = plugin;
4543

4644
syncExecutor = r -> Bukkit.getScheduler().runTask(plugin, r);
4745
}

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@
4848
import java.util.concurrent.ConcurrentMap;
4949

5050
import org.bukkit.Bukkit;
51-
import org.bukkit.Server.Spigot;
5251
import org.bukkit.command.CommandSender;
5352
import org.bukkit.entity.Player;
5453
import org.bukkit.plugin.PluginManager;
5554
import org.bukkit.plugin.java.JavaPlugin;
56-
import org.geysermc.floodgate.api.FloodgateApi;
5755
import org.slf4j.Logger;
5856

5957
/**

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/command/PremiumCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
import java.util.UUID;
3333

34-
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent;
3534
import com.github.games647.fastlogin.core.shared.event.FastLoginPremiumToggleEvent.PremiumToggleReason;
3635
import org.bukkit.command.Command;
3736
import org.bukkit.command.CommandSender;

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hook/UltraAuthHook.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333

3434
import org.bukkit.Bukkit;
3535
import org.bukkit.entity.Player;
36-
import org.bukkit.plugin.Plugin;
3736
import ultraauth.api.UltraAuthAPI;
38-
import ultraauth.main.Main;
3937
import ultraauth.managers.PlayerManager;
4038

4139
/**
@@ -47,7 +45,6 @@
4745
*/
4846
public class UltraAuthHook implements AuthPlugin<Player> {
4947

50-
private final Plugin ultraAuthPlugin = Main.main;
5148
private final FastLoginBukkit plugin;
5249

5350
public UltraAuthHook(FastLoginBukkit plugin) {

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ public void requestPremiumLogin(ProtocolLibLoginSource source, StoredProfile pro
104104
String ip = player.getAddress().getAddress().getHostAddress();
105105
core.getPendingLogin().put(ip + username, new Object());
106106

107-
String serverId = source.getServerId();
108107
byte[] verify = source.getVerifyToken();
109108

110-
BukkitLoginSession playerSession = new BukkitLoginSession(username, serverId, verify, registered, profile);
109+
BukkitLoginSession playerSession = new BukkitLoginSession(username, verify, registered, profile);
111110
plugin.putSession(player.getAddress(), playerSession);
112111
//cancel only if the player has a paid account otherwise login as normal offline player
113112
synchronized (packetEvent.getAsyncMarker().getProcessingLock()) {

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocolsupport/ProtocolSupportListener.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.net.InetSocketAddress;
3838
import java.util.Optional;
3939

40-
import org.bukkit.Bukkit;
4140
import org.bukkit.command.CommandSender;
4241
import org.bukkit.entity.Player;
4342
import org.bukkit.event.EventHandler;

bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
import net.md_5.bungee.api.plugin.PluginManager;
6060
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
6161

62-
import org.bukkit.Bukkit;
63-
import org.bukkit.entity.Player;
6462
import org.slf4j.Logger;
6563

6664
/**

bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
import red.mohist.sodionauth.core.SodionAuthApi;
3333
import red.mohist.sodionauth.core.exception.AuthenticatedException;
3434

35-
import java.util.concurrent.ExecutionException;
36-
3735
/**
3836
* GitHub: https://github.com/Mohist-Community/SodionAuth
3937
* <p>

bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
import net.md_5.bungee.event.EventHandler;
5959
import net.md_5.bungee.event.EventPriority;
6060

61-
import org.geysermc.floodgate.FloodgateAPI;
6261
import org.slf4j.Logger;
6362
import org.slf4j.LoggerFactory;
6463

@@ -69,17 +68,14 @@
6968
public class ConnectListener implements Listener {
7069

7170
private static final String UUID_FIELD_NAME = "uniqueId";
72-
private static final boolean initialHandlerClazzFound;
7371
private static final MethodHandle uniqueIdSetter;
7472

7573
static {
7674
MethodHandle setHandle = null;
77-
boolean handlerFound = false;
7875
try {
7976
Lookup lookup = MethodHandles.lookup();
8077

8178
Class.forName("net.md_5.bungee.connection.InitialHandler");
82-
handlerFound = true;
8379

8480
Field uuidField = InitialHandler.class.getDeclaredField(UUID_FIELD_NAME);
8581
uuidField.setAccessible(true);
@@ -94,20 +90,17 @@ public class ConnectListener implements Listener {
9490
reflectiveOperationException.printStackTrace();
9591
}
9692

97-
initialHandlerClazzFound = handlerFound;
9893
uniqueIdSetter = setHandle;
9994
}
10095

10196
private final FastLoginBungee plugin;
10297
private final RateLimiter rateLimiter;
10398
private final Property[] emptyProperties = {};
104-
private final String floodgateVersion;
10599
private final FloodgateHook floodgateHook;
106100

107101
public ConnectListener(FastLoginBungee plugin, RateLimiter rateLimiter, String floodgateVersion) {
108102
this.plugin = plugin;
109103
this.rateLimiter = rateLimiter;
110-
this.floodgateVersion = floodgateVersion;
111104

112105
// Get the appropriate floodgate api hook based on the version
113106
if (floodgateVersion.startsWith("1")) {

0 commit comments

Comments
 (0)