mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-24 17:47:41 +01:00
Code format.
This commit is contained in:
parent
ad0da59267
commit
738ed99d54
@ -35,7 +35,7 @@ public class ServerKickEvent extends Event implements Cancellable
|
||||
private ServerInfo cancelServer;
|
||||
/**
|
||||
* State in which the kick occured.
|
||||
*/
|
||||
*/
|
||||
private State state;
|
||||
|
||||
public enum State
|
||||
@ -46,7 +46,7 @@ public class ServerKickEvent extends Event implements Cancellable
|
||||
|
||||
public ServerKickEvent(ProxiedPlayer player, String kickReason, ServerInfo cancelServer)
|
||||
{
|
||||
this(player, kickReason, cancelServer, State.UNKNOWN);
|
||||
this( player, kickReason, cancelServer, State.UNKNOWN );
|
||||
}
|
||||
|
||||
public ServerKickEvent(ProxiedPlayer player, String kickReason, ServerInfo cancelServer, State state)
|
||||
|
@ -21,7 +21,6 @@ import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -156,7 +156,7 @@ public class ServerConnector extends PacketHandler
|
||||
user.unsafe().sendPacket( modLogin );
|
||||
|
||||
MinecraftOutput out = new MinecraftOutput();
|
||||
out.writeStringUTF8WithoutLengthHeaderBecauseDinnerboneStuffedUpTheMCBrandPacket(ProxyServer.getInstance().getName() + " (" + ProxyServer.getInstance().getVersion() + ")" );
|
||||
out.writeStringUTF8WithoutLengthHeaderBecauseDinnerboneStuffedUpTheMCBrandPacket( ProxyServer.getInstance().getName() + " (" + ProxyServer.getInstance().getVersion() + ")" );
|
||||
user.unsafe().sendPacket( new PacketFAPluginMessage( "MC|Brand", out.toArray() ) );
|
||||
} else
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.md_5.bungee.connection;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import java.io.DataInput;
|
||||
@ -10,7 +9,6 @@ import net.md_5.bungee.EntityMap;
|
||||
import net.md_5.bungee.ServerConnection;
|
||||
import net.md_5.bungee.UserConnection;
|
||||
import net.md_5.bungee.Util;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
@ -32,7 +30,6 @@ import net.md_5.bungee.protocol.packet.PacketD1Team;
|
||||
import net.md_5.bungee.protocol.packet.PacketFAPluginMessage;
|
||||
import net.md_5.bungee.protocol.packet.PacketFFKick;
|
||||
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class DownstreamBridge extends PacketHandler
|
||||
{
|
||||
@ -61,7 +58,7 @@ public class DownstreamBridge extends PacketHandler
|
||||
{
|
||||
// We lost connection to the server
|
||||
server.getInfo().removePlayer( con );
|
||||
if (bungee.getReconnectHandler() != null)
|
||||
if ( bungee.getReconnectHandler() != null )
|
||||
{
|
||||
bungee.getReconnectHandler().setServer( con );
|
||||
}
|
||||
|
@ -5,9 +5,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.handler.timeout.ReadTimeoutException;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.logging.Level;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.connection.CancelSendSignal;
|
||||
import net.md_5.bungee.connection.InitialHandler;
|
||||
@ -62,27 +60,25 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
|
||||
{
|
||||
if ( handler != null )
|
||||
{
|
||||
if ( handler != null )
|
||||
if ( msg instanceof PacketWrapper )
|
||||
{
|
||||
if ( msg instanceof PacketWrapper )
|
||||
boolean sendPacket = true;
|
||||
try
|
||||
{
|
||||
boolean sendPacket = true;
|
||||
try
|
||||
{
|
||||
( (PacketWrapper) msg ).packet.handle( handler );
|
||||
} catch ( CancelSendSignal ex )
|
||||
{
|
||||
sendPacket = false;
|
||||
}
|
||||
if ( sendPacket )
|
||||
{
|
||||
handler.handle( ( (PacketWrapper) msg ).buf );
|
||||
}
|
||||
} else
|
||||
( (PacketWrapper) msg ).packet.handle( handler );
|
||||
} catch ( CancelSendSignal ex )
|
||||
{
|
||||
handler.handle( (byte[]) msg );
|
||||
sendPacket = false;
|
||||
}
|
||||
if ( sendPacket )
|
||||
{
|
||||
handler.handle( ( (PacketWrapper) msg ).buf );
|
||||
}
|
||||
} else
|
||||
{
|
||||
handler.handle( (byte[]) msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user