3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-17 01:23:43 +02:00

Merge pull request #232 from Matsv/dropcreative

Throw items when you try to put things in your second hand in creative.
Dieser Commit ist enthalten in:
Myles 2016-03-15 21:06:04 +00:00
Commit 71e27b4799

Datei anzeigen

@ -329,8 +329,17 @@ public class IncomingTransformer {
}
if (packet == PacketType.PLAY_CREATIVE_INVENTORY_ACTION) {
short slot = input.readShort();
if (slot == 45) {
ByteBuf buf = info.getChannel().alloc().buffer();
PacketUtil.writeVarInt(PacketType.PLAY_SET_SLOT.getNewPacketID(), buf);
buf.writeByte(0);
buf.writeShort(slot);
buf.writeShort(-1); // empty
info.sendRawPacket(buf);
// Continue the packet simulating throw
slot = -999;
}
output.writeShort(slot);
ItemSlotRewriter.rewrite1_9To1_8(input, output);
}
output.writeBytes(input);