Don't send place block twice (1.9 will use use_item to handle items), fixes #244 (may fix more)

This commit is contained in:
Myles 2016-03-23 13:37:45 +00:00
parent 9adf6040fa
commit 6c8ccb1b1e
1 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,7 @@ public class IncomingTransformer {
if (packet.getPacketID() != -1) {
packetID = packet.getPacketID();
}
if (plugin.isDebug()) {
if (packet != PacketType.PLAY_PLAYER_POSITION_LOOK_REQUEST && packet != PacketType.PLAY_KEEP_ALIVE_REQUEST && packet != PacketType.PLAY_PLAYER_POSITION_REQUEST && packet != PacketType.PLAY_PLAYER_LOOK_REQUEST) {
System.out.println("Direction " + packet.getDirection().name() + " Packet Type: " + packet + " New ID: " + packetID + " Original: " + original + " Size: " + input.readableBytes());
@ -293,6 +294,12 @@ public class IncomingTransformer {
} catch (Exception e) {
e.printStackTrace();
}
// Check item
if (inHand != null) {
if (!inHand.getType().isBlock()) {
throw new CancelException();
}
}
short curX = input.readUnsignedByte();
output.writeByte(curX);
short curY = input.readUnsignedByte();