3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-27 08:30:10 +01:00

Merge branch 'master' into dev

Dieser Commit ist enthalten in:
Myles 2019-04-19 16:29:57 +01:00
Commit 2d0db67a29

Datei anzeigen

@ -27,6 +27,7 @@ import us.myles.ViaVersion.packets.State;
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type;
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
import us.myles.viaversion.libs.opennbt.tag.builtin.DoubleTag;
import us.myles.viaversion.libs.opennbt.tag.builtin.ListTag;
import java.util.Collections;
@ -172,6 +173,21 @@ public class BlockItemPackets1_12 extends BlockItemRewriter<Protocol1_11_1To1_12
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
if (wrapper.get(Type.VAR_INT, 0) == 1) { // Shift click
CompoundTag tag = new CompoundTag("");
tag.put(new DoubleTag("force reject", Double.NaN));
wrapper.set(Type.ITEM, 0, new Item((short) 1, (byte) 1, (short) 1, tag));
PacketWrapper confirm = wrapper.create(0x6);
confirm.write(Type.BYTE, wrapper.get(Type.UNSIGNED_BYTE, 0).byteValue());
confirm.write(Type.SHORT, wrapper.get(Type.SHORT, 1));
confirm.write(Type.BOOLEAN, false);
wrapper.sendToServer(Protocol1_11_1To1_12.class, true, true);
wrapper.cancel();
confirm.sendToServer(Protocol1_11_1To1_12.class, true, true);
return;
}
Item item = wrapper.get(Type.ITEM, 0);
handleItemToServer(item);
}