Don't need to maintain rain or held item state. Closes issues #12 and #3

This commit is contained in:
md_5 2012-10-25 16:26:42 +11:00
parent b12953f2dc
commit d9bd0e3ee6
3 changed files with 0 additions and 58 deletions

View File

@ -9,11 +9,9 @@ import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import net.md_5.bungee.command.CommandSender;
import net.md_5.bungee.packet.DefinedPacket;
import net.md_5.bungee.packet.Packet10HeldItem;
import net.md_5.bungee.packet.Packet1Login;
import net.md_5.bungee.packet.Packet2Handshake;
import net.md_5.bungee.packet.Packet3Chat;
import net.md_5.bungee.packet.Packet46GameState;
import net.md_5.bungee.packet.Packet9Respawn;
import net.md_5.bungee.packet.PacketFAPluginMessage;
import net.md_5.bungee.packet.PacketInputStream;
@ -27,7 +25,6 @@ public class UserConnection extends GenericConnection implements CommandSender
private UpstreamBridge upBridge;
private DownstreamBridge downBridge;
// reconnect stuff
private Packet10HeldItem heldItem;
private int clientEntityId;
private int serverEntityId;
private volatile boolean reconnecting;
@ -81,11 +78,6 @@ public class UserConnection extends GenericConnection implements CommandSender
Packet1Login login = newServer.loginPacket;
serverEntityId = login.entityId;
out.write(new Packet9Respawn(login.dimension, login.difficulty, login.gameMode, (short) 256, login.levelType).getPacket());
out.write(new Packet46GameState((byte) 2, (byte) 0).getPacket());
if (heldItem != null)
{
newServer.out.write(heldItem.getPacket());
}
}
reconnecting = false;
downBridge = new DownstreamBridge();
@ -158,9 +150,6 @@ public class UserConnection extends GenericConnection implements CommandSender
{
sendPacket = !BungeeCord.instance.dispatchCommand(message.substring(1), UserConnection.this);
}
} else if (id == 0x10)
{
heldItem = new Packet10HeldItem(packet);
}
EntityMap.rewrite(packet, clientEntityId, serverEntityId);

View File

@ -1,24 +0,0 @@
package net.md_5.bungee.packet;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ToString
@EqualsAndHashCode(callSuper = false)
public class Packet10HeldItem extends DefinedPacket
{
public short slot;
public Packet10HeldItem(short slot)
{
super(0x10);
writeShort(slot);
}
public Packet10HeldItem(byte[] buf)
{
super(0x10, buf);
this.slot = readShort();
}
}

View File

@ -1,23 +0,0 @@
package net.md_5.bungee.packet;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ToString
@EqualsAndHashCode(callSuper = false)
public class Packet46GameState extends DefinedPacket
{
/**
* Update game state. When sent with a state of 2, rain will cease.
*
* @param state the new game state
* @param mode the new game mode. Used when state == 3.
*/
public Packet46GameState(byte state, byte mode)
{
super(0x46);
writeByte(state);
writeByte(mode);
}
}