3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-20 06:50:10 +01:00

Merge pull request #91 from creeper123123321/dev

Login plugin request and response
Dieser Commit ist enthalten in:
Mats 2019-02-03 13:54:59 +01:00 committet von GitHub
Commit 19d2c8fcb9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -9,6 +9,7 @@ import us.myles.ViaVersion.api.minecraft.Position;
import us.myles.ViaVersion.api.minecraft.item.Item; import us.myles.ViaVersion.api.minecraft.item.Item;
import us.myles.ViaVersion.api.remapper.PacketHandler; import us.myles.ViaVersion.api.remapper.PacketHandler;
import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.remapper.PacketRemapper;
import us.myles.ViaVersion.api.remapper.ValueCreator;
import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.packets.State; import us.myles.ViaVersion.packets.State;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter;
@ -17,6 +18,25 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPacke
public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> { public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
@Override @Override
protected void registerPackets(Protocol1_12_2To1_13 protocol) { protected void registerPackets(Protocol1_12_2To1_13 protocol) {
// Login Plugin Request
protocol.out(State.LOGIN, 0x04, -1, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper packetWrapper) throws Exception {
packetWrapper.cancel();
packetWrapper.create(0x02, new ValueCreator() { // Plugin response
@Override
public void write(PacketWrapper newWrapper) throws Exception {
newWrapper.write(Type.VAR_INT, packetWrapper.read(Type.VAR_INT)); // Packet id
newWrapper.write(Type.BOOLEAN, false); // Success
}
}).sendToServer(Protocol1_12_2To1_13.class);
}
});
}
});
//Plugin Message //Plugin Message
protocol.out(State.PLAY, 0x19, 0x18, new PacketRemapper() { protocol.out(State.PLAY, 0x19, 0x18, new PacketRemapper() {