3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

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

Dieser Commit ist enthalten in:
Myles 2016-03-23 13:37:45 +00:00
Ursprung 9adf6040fa
Commit 6c8ccb1b1e

Datei anzeigen

@ -35,6 +35,7 @@ public class IncomingTransformer {
if (packet.getPacketID() != -1) { if (packet.getPacketID() != -1) {
packetID = packet.getPacketID(); packetID = packet.getPacketID();
} }
if (plugin.isDebug()) { 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) { 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()); 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) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
// Check item
if (inHand != null) {
if (!inHand.getType().isBlock()) {
throw new CancelException();
}
}
short curX = input.readUnsignedByte(); short curX = input.readUnsignedByte();
output.writeByte(curX); output.writeByte(curX);
short curY = input.readUnsignedByte(); short curY = input.readUnsignedByte();