Less deprecated warnings + Clean up
This commit is contained in:
1 parent
07d0aededa
commit
4292e9aaa0
16 files changed
+94
-58
No files matched your search
@@ -159,8 +159,9 @@ public class FastLoginBukkit extends JavaPlugin {
|
||||
*
|
||||
* @return interface to any supported auth plugin
|
||||
*/
|
||||
@Deprecated
|
||||
public BukkitAuthPlugin getAuthPlugin() {
|
||||
AuthPlugin<Player> authPlugin = core.getAuthPlugin();
|
||||
AuthPlugin<Player> authPlugin = core.getAuthPluginHook();
|
||||
if (authPlugin == null) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
@@ -172,8 +173,9 @@ public class FastLoginBukkit extends JavaPlugin {
|
||||
return (BukkitAuthPlugin) authPlugin;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setAuthPluginHook(BukkitAuthPlugin authPlugin) {
|
||||
core.setAuthPlugin(authPlugin);
|
||||
core.setAuthPluginHook(authPlugin);
|
||||
}
|
||||
|
||||
public boolean isBungeeCord() {
|
||||
|
||||
@@ -161,6 +161,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void playNote(Location loc, byte instrument, byte note) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -181,6 +182,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void playEffect(Location loc, Effect effect, int data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -191,16 +193,19 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void sendBlockChange(Location loc, Material material, byte data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void sendBlockChange(Location loc, int material, byte data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -476,6 +481,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean isOnGround() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -511,6 +517,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setTexturePack(String url) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -561,11 +568,13 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void sendTitle(String title, String subtitle) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void resetTitle() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -686,11 +695,13 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ItemStack getItemInHand() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setItemInHand(ItemStack item) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -751,6 +762,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -761,6 +773,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -771,6 +784,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -816,6 +830,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int _INVALID_getLastDamage() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -826,6 +841,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void _INVALID_setLastDamage(int damage) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -1226,6 +1242,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void _INVALID_damage(int amount) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -1236,6 +1253,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void _INVALID_damage(int amount, Entity source) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -1246,6 +1264,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int _INVALID_getHealth() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -1256,6 +1275,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void _INVALID_setHealth(int health) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -1266,6 +1286,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int _INVALID_getMaxHealth() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -1276,6 +1297,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void _INVALID_setMaxHealth(int health) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
@@ -1331,6 +1353,7 @@ public class FakePlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setBanned(boolean banned) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
package com.github.games647.fastlogin.bukkit.listener;
|
||||
|
||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||
import com.github.games647.fastlogin.bukkit.tasks.ForceLoginTask;
|
||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||
import com.github.games647.fastlogin.bukkit.hooks.BukkitAuthPlugin;
|
||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
@@ -80,7 +80,7 @@ public class BungeeCordListener implements PluginMessageListener {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
|
||||
AuthPlugin<Player> authPlugin = plugin.getCore().getAuthPluginHook();
|
||||
try {
|
||||
//we need to check if the player is registered on Bukkit too
|
||||
if (authPlugin == null || !authPlugin.isRegistered(playerName)) {
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||
import com.github.games647.fastlogin.core.PlayerProfile;
|
||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
@@ -23,7 +23,7 @@ public class NameCheckTask extends JoinManagement<Player, ProtocolLibLoginSource
|
||||
private final String username;
|
||||
|
||||
public NameCheckTask(FastLoginBukkit plugin, PacketEvent packetEvent, Random random, Player player, String username) {
|
||||
super(plugin.getCore(), plugin.getAuthPlugin());
|
||||
super(plugin.getCore(), plugin.getCore().getAuthPluginHook());
|
||||
|
||||
this.plugin = plugin;
|
||||
this.packetEvent = packetEvent;
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ public class ProtocolSupportListener extends JoinManagement<Player, ProtocolLogi
|
||||
protected final FastLoginBukkit plugin;
|
||||
|
||||
public ProtocolSupportListener(FastLoginBukkit plugin) {
|
||||
super(plugin.getCore(), plugin.getAuthPlugin());
|
||||
super(plugin.getCore(), plugin.getCore().getAuthPluginHook());
|
||||
|
||||
this.plugin = plugin;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class ProtocolSupportListener extends JoinManagement<Player, ProtocolLogi
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onLoginStart(PlayerLoginStartEvent loginStartEvent) {
|
||||
plugin.setServerStarted();
|
||||
if (loginStartEvent.isLoginDenied() || plugin.getAuthPlugin() == null) {
|
||||
if (loginStartEvent.isLoginDenied() || plugin.getCore().getAuthPluginHook() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -63,8 +63,8 @@ public class DelayedAuthHook implements Runnable {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (plugin.getAuthPlugin() == null) {
|
||||
plugin.getCore().setAuthPlugin(authPluginHook);
|
||||
if (plugin.getCore().getAuthPluginHook() == null) {
|
||||
plugin.getCore().setAuthPluginHook(authPluginHook);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.github.games647.fastlogin.bukkit.tasks;
|
||||
|
||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||
import com.github.games647.fastlogin.bukkit.hooks.BukkitAuthPlugin;
|
||||
import com.github.games647.fastlogin.core.AuthStorage;
|
||||
import com.github.games647.fastlogin.core.PlayerProfile;
|
||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ForceLoginTask implements Runnable {
|
||||
//check if it's the same player as we checked before
|
||||
if (session.isVerified() && player.getName().equals(session.getUsername())) {
|
||||
//premium player
|
||||
BukkitAuthPlugin authPlugin = plugin.getAuthPlugin();
|
||||
AuthPlugin<Player> authPlugin = plugin.getCore().getAuthPluginHook();
|
||||
if (authPlugin == null) {
|
||||
//maybe only bungeecord plugin
|
||||
sendSuccessNotification();
|
||||
@@ -85,7 +85,7 @@ public class ForceLoginTask implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean forceRegister(BukkitAuthPlugin authPlugin, Player player) {
|
||||
private boolean forceRegister(AuthPlugin<Player> authPlugin, Player player) {
|
||||
plugin.getLogger().log(Level.FINE, "Register player {0}", player.getName());
|
||||
|
||||
String generatedPassword = plugin.getCore().getPasswordGenerator().getRandomPassword(player);
|
||||
@@ -99,7 +99,7 @@ public class ForceLoginTask implements Runnable {
|
||||
return success;
|
||||
}
|
||||
|
||||
private boolean forceLogin(BukkitAuthPlugin authPlugin, Player player) {
|
||||
private boolean forceLogin(AuthPlugin<Player> authPlugin, Player player) {
|
||||
plugin.getLogger().log(Level.FINE, "Logging player {0} in", player.getName());
|
||||
boolean success = authPlugin.forceLogin(player);
|
||||
|
||||
|
||||
@@ -15,17 +15,9 @@ dev-url: ${project.url}
|
||||
load: STARTUP
|
||||
|
||||
softdepend:
|
||||
# We require either ProtocolLib or ProtocolSupport
|
||||
# We depend either ProtocolLib or ProtocolSupport
|
||||
- ProtocolSupport
|
||||
- ProtocolLib
|
||||
# Auth plugins - we delay the hook
|
||||
# - xAuth
|
||||
# - AuthMe
|
||||
# - LogIt
|
||||
# - CrazyLogin
|
||||
# - LoginSecurity
|
||||
# - RoyalAuth
|
||||
# - UltraAuth
|
||||
|
||||
commands:
|
||||
${project.parent.name}:
|
||||
|
||||
Reference in new issue
Block a user