3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Basic support for the new 1.10 snapshot 16w20a

Dieser Commit ist enthalten in:
Matsv 2016-05-18 16:43:57 +02:00
Ursprung 9828e4ae1d
Commit 2456c3cf17
3 geänderte Dateien mit 50 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -8,6 +8,7 @@ import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1TO1_9;
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.Protocol1_9_3TO1_9_1_2;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
import us.myles.ViaVersion.protocols.protocol1_9to1_9_1.Protocol1_9TO1_9_1;
import us.myles.ViaVersion.protocols.protocolsnapshotto1_9_3.ProtocolSnapshotTo1_9_3;
import java.util.*;
@ -29,6 +30,7 @@ public class ProtocolRegistry {
// Only supported for 1.9.4 server to 1.9 (nothing else)
registerProtocol(new Protocol1_9TO1_9_1(), Arrays.asList(ProtocolVersion.v1_9.getId()), ProtocolVersion.v1_9_2.getId());
registerProtocol(new Protocol1_9_1_2TO1_9_3(), Arrays.asList(ProtocolVersion.v1_9_1.getId(), ProtocolVersion.v1_9_2.getId()), ProtocolVersion.v1_9_3.getId());
registerProtocol(new ProtocolSnapshotTo1_9_3(), Collections.singletonList(ProtocolVersion.SNAPSHOT.getId()), ProtocolVersion.v1_9_3.getId());
}

Datei anzeigen

@ -16,6 +16,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_9_1;
public static final ProtocolVersion v1_9_2;
public static final ProtocolVersion v1_9_3;
public static final ProtocolVersion SNAPSHOT;
private final int id;
private final String name;
@ -28,6 +29,7 @@ public class ProtocolVersion {
register(v1_9_1 = new ProtocolVersion(108, "1.9.1"));
register(v1_9_2 = new ProtocolVersion(109, "1.9.2"));
register(v1_9_3 = new ProtocolVersion(110, "1.9.3"));
register(SNAPSHOT = new ProtocolVersion(201, "16w20a"));
}
public static void register(@NonNull ProtocolVersion protocol) {

Datei anzeigen

@ -0,0 +1,46 @@
package us.myles.ViaVersion.protocols.protocolsnapshotto1_9_3;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.Protocol;
import us.myles.ViaVersion.api.remapper.PacketRemapper;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.packets.State;
public class ProtocolSnapshotTo1_9_3 extends Protocol {
@Override
protected void registerPackets() {
// Named sound effect
registerOutgoing(State.PLAY, 0x19, 0x19, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // 0 - Sound name
map(Type.VAR_INT); // 1 - Sound Category
map(Type.INT); // 2 - x
map(Type.INT); // 3 - y
map(Type.INT); // 4 - z
map(Type.FLOAT); // 5 - Volume
map(Type.UNSIGNED_BYTE, Type.FLOAT); // 6 - Pitch
}
});
// Sound effect
registerOutgoing(State.PLAY, 0x46, 0x46, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Sound name
map(Type.VAR_INT); // 1 - Sound Category
map(Type.INT); // 2 - x
map(Type.INT); // 3 - y
map(Type.INT); // 4 - z
map(Type.FLOAT); // 5 - Volume
map(Type.UNSIGNED_BYTE, Type.FLOAT); // 6 - Pitch
}
});
}
@Override
public void init(UserConnection userConnection) {
}
}