3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 00:22:51 +01:00

map packet changes.

Dieser Commit ist enthalten in:
Matsv 2016-08-10 15:59:13 +02:00
Ursprung 7cadf832f5
Commit 44544925a1
2 geänderte Dateien mit 31 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -51,7 +51,7 @@ public class ProtocolVersion {
register(v1_9_2 = new ProtocolVersion(109, "1.9.2")); register(v1_9_2 = new ProtocolVersion(109, "1.9.2"));
register(v1_9_3 = new ProtocolVersion(110, "1.9.3/4")); register(v1_9_3 = new ProtocolVersion(110, "1.9.3/4"));
register(v1_10 = new ProtocolVersion(210, "1.10")); register(v1_10 = new ProtocolVersion(210, "1.10"));
register(vSNAPSHOT = new ProtocolVersion(1337, "1.11-SNAPSHOT")); register(vSNAPSHOT = new ProtocolVersion(301, "1.11-SNAPSHOT"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN")); register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
} }

Datei anzeigen

@ -1,12 +1,42 @@
package us.myles.ViaVersion.protocols.protocolsnapshotto1_10; package us.myles.ViaVersion.protocols.protocolsnapshotto1_10;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.protocol.Protocol;
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.packets.State;
public class ProtocolSnapshotTo1_10 extends Protocol { public class ProtocolSnapshotTo1_10 extends Protocol {
@Override @Override
protected void registerPackets() { protected void registerPackets() {
// Spawn mob packet
registerOutgoing(State.PLAY, 0x03, 0x03, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
map(Type.UUID); // 1 - Entity UUID
map(Type.UNSIGNED_BYTE, Type.VAR_INT); // 2 - Entity Type
}
});
// Collect item packet
registerOutgoing(State.PLAY, 0x48, 0x48, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Collected entity id
map(Type.VAR_INT); // 1 - Collector entity id
create(new ValueCreator() {
@Override
public void write(PacketWrapper wrapper) throws Exception {
// TODO FIND OUT WHAT THE NEW VAR_INT IS
}
});
}
});
} }
@Override @Override