Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-09-07 21:32:52 +02:00
Merge pull request #97 from creeper123123321/master
Workaround for #48
Dieser Commit ist enthalten in:
Commit
44d71ec538
@ -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);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren