Fix some compiler warnings
This commit is contained in:
parent
4e2897710b
commit
0fc5694b6a
@ -10,6 +10,7 @@ import joptsimple.OptionParser;
|
|||||||
import joptsimple.OptionSet;
|
import joptsimple.OptionSet;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
import net.md_5.bungee.command.ConsoleCommandSender;
|
import net.md_5.bungee.command.ConsoleCommandSender;
|
||||||
|
|
||||||
public class BungeeCordLauncher
|
public class BungeeCordLauncher
|
||||||
@ -61,7 +62,7 @@ public class BungeeCordLauncher
|
|||||||
{
|
{
|
||||||
if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) )
|
if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) )
|
||||||
{
|
{
|
||||||
bungee.getConsole().sendMessage( ChatColor.RED + "Command not found" );
|
bungee.getConsole().sendMessage( new ComponentBuilder( "Command not found" ).color( ChatColor.RED ).create() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package net.md_5.bungee.module.cmd.alert;
|
|||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.plugin.Command;
|
import net.md_5.bungee.api.plugin.Command;
|
||||||
|
|
||||||
public class CommandAlert extends Command
|
public class CommandAlert extends Command
|
||||||
@ -39,7 +40,7 @@ public class CommandAlert extends Command
|
|||||||
|
|
||||||
String message = builder.substring( 0, builder.length() - 1 );
|
String message = builder.substring( 0, builder.length() - 1 );
|
||||||
|
|
||||||
ProxyServer.getInstance().broadcast( message );
|
ProxyServer.getInstance().broadcast( TextComponent.fromLegacyText( message ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package net.md_5.bungee.module.cmd.find;
|
|||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.command.PlayerCommand;
|
import net.md_5.bungee.command.PlayerCommand;
|
||||||
|
|
||||||
@ -19,16 +20,16 @@ public class CommandFind extends PlayerCommand
|
|||||||
{
|
{
|
||||||
if ( args.length != 1 )
|
if ( args.length != 1 )
|
||||||
{
|
{
|
||||||
sender.sendMessage( ChatColor.RED + "Please follow this command by a user name" );
|
sender.sendMessage( new ComponentBuilder( "Please follow this command by a user name" ).color( ChatColor.RED ).create() );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
ProxiedPlayer player = ProxyServer.getInstance().getPlayer( args[0] );
|
ProxiedPlayer player = ProxyServer.getInstance().getPlayer( args[0] );
|
||||||
if ( player == null || player.getServer() == null )
|
if ( player == null || player.getServer() == null )
|
||||||
{
|
{
|
||||||
sender.sendMessage( ChatColor.RED + "That user is not online" );
|
sender.sendMessage( new ComponentBuilder( "That user is not online" ).color( ChatColor.RED ).create() );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
sender.sendMessage( ChatColor.GREEN + args[0] + " is online at " + player.getServer().getInfo().getName() );
|
sender.sendMessage( new ComponentBuilder( args[0] ).color( ChatColor.GREEN ).append( " is online at " ).append( player.getServer().getInfo().getName() ).create() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,12 @@ public final class NativeCode<T>
|
|||||||
{
|
{
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final Class<T> javaImpl;
|
private final Class<? extends T> javaImpl;
|
||||||
private final Class<T> nativeImpl;
|
private final Class<? extends T> nativeImpl;
|
||||||
//
|
//
|
||||||
private boolean loaded;
|
private boolean loaded;
|
||||||
|
|
||||||
public NativeCode(String name, Class<T> javaImpl, Class<T> nativeImpl)
|
public NativeCode(String name, Class<? extends T> javaImpl, Class<? extends T> nativeImpl)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.javaImpl = javaImpl;
|
this.javaImpl = javaImpl;
|
||||||
|
@ -26,7 +26,7 @@ public class NativeCipherTest
|
|||||||
private final SecretKey secret = new SecretKeySpec( new byte[ 16 ], "AES" );
|
private final SecretKey secret = new SecretKeySpec( new byte[ 16 ], "AES" );
|
||||||
private static final int BENCHMARK_COUNT = 4096;
|
private static final int BENCHMARK_COUNT = 4096;
|
||||||
//
|
//
|
||||||
private static final NativeCode<BungeeCipher> factory = new NativeCode( "native-cipher", JavaCipher.class, NativeCipher.class );
|
private static final NativeCode<BungeeCipher> factory = new NativeCode<>( "native-cipher", JavaCipher.class, NativeCipher.class );
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNative() throws Exception
|
public void testNative() throws Exception
|
||||||
|
@ -15,7 +15,7 @@ import org.junit.Test;
|
|||||||
public class NativeZlibTest
|
public class NativeZlibTest
|
||||||
{
|
{
|
||||||
|
|
||||||
private final NativeCode<BungeeZlib> factory = new NativeCode( "native-compress", JavaZlib.class, NativeZlib.class );
|
private final NativeCode<BungeeZlib> factory = new NativeCode<>( "native-compress", JavaZlib.class, NativeZlib.class );
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void doTest() throws DataFormatException
|
public void doTest() throws DataFormatException
|
||||||
|
@ -66,7 +66,7 @@ public class BungeeServerInfo implements ServerInfo
|
|||||||
@Override
|
@Override
|
||||||
public Collection<ProxiedPlayer> getPlayers()
|
public Collection<ProxiedPlayer> getPlayers()
|
||||||
{
|
{
|
||||||
return Collections.unmodifiableCollection( new HashSet( players ) );
|
return Collections.unmodifiableCollection( new HashSet<>( players ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,7 +31,7 @@ public class EncryptionUtil
|
|||||||
public static final KeyPair keys;
|
public static final KeyPair keys;
|
||||||
@Getter
|
@Getter
|
||||||
private static final SecretKey secret = new SecretKeySpec( new byte[ 16 ], "AES" );
|
private static final SecretKey secret = new SecretKeySpec( new byte[ 16 ], "AES" );
|
||||||
public static final NativeCode<BungeeCipher> nativeFactory = new NativeCode( "native-cipher", JavaCipher.class, NativeCipher.class );
|
public static final NativeCode<BungeeCipher> nativeFactory = new NativeCode<>( "native-cipher", JavaCipher.class, NativeCipher.class );
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
|
@ -8,5 +8,5 @@ import net.md_5.bungee.jni.zlib.NativeZlib;
|
|||||||
public class CompressFactory
|
public class CompressFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final NativeCode<BungeeZlib> zlib = new NativeCode( "native-compress", JavaZlib.class, NativeZlib.class );
|
public static final NativeCode<BungeeZlib> zlib = new NativeCode<>( "native-compress", JavaZlib.class, NativeZlib.class );
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public class YamlConfig implements ConfigurationAdapter
|
|||||||
GLOBAL(), GLOBAL_PING(), SERVER();
|
GLOBAL(), GLOBAL_PING(), SERVER();
|
||||||
}
|
}
|
||||||
private final Yaml yaml;
|
private final Yaml yaml;
|
||||||
private Map config;
|
private Map<String, Object> config;
|
||||||
private final File file = new File( "config.yml" );
|
private final File file = new File( "config.yml" );
|
||||||
|
|
||||||
public YamlConfig()
|
public YamlConfig()
|
||||||
@ -72,10 +72,10 @@ public class YamlConfig implements ConfigurationAdapter
|
|||||||
|
|
||||||
if ( config == null )
|
if ( config == null )
|
||||||
{
|
{
|
||||||
config = new CaseInsensitiveMap();
|
config = new CaseInsensitiveMap<>();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
config = new CaseInsensitiveMap( config );
|
config = new CaseInsensitiveMap<>( config );
|
||||||
}
|
}
|
||||||
} catch ( IOException ex )
|
} catch ( IOException ex )
|
||||||
{
|
{
|
||||||
|
@ -63,10 +63,10 @@ public class ModuleManager
|
|||||||
|
|
||||||
if ( config == null )
|
if ( config == null )
|
||||||
{
|
{
|
||||||
config = new CaseInsensitiveMap();
|
config = new CaseInsensitiveMap<>();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
config = new CaseInsensitiveMap( config );
|
config = new CaseInsensitiveMap<>( config );
|
||||||
}
|
}
|
||||||
// End yaml
|
// End yaml
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user