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

Support for 16w39c

Dieser Commit ist enthalten in:
Matsv 2016-09-30 17:14:14 +02:00
Ursprung ffbd399993
Commit 4d3302a926
3 geänderte Dateien mit 28 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -6,7 +6,7 @@
<groupId>us.myles</groupId>
<artifactId>viaversion</artifactId>
<version>1.0.0-ALPHA-16w39b</version>
<version>1.0.0-ALPHA-16w39c</version>
<packaging>jar</packaging>
<name>ViaVersion</name>

Datei anzeigen

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

Datei anzeigen

@ -6,6 +6,7 @@ import us.myles.ViaVersion.api.protocol.Protocol;
import us.myles.ViaVersion.api.remapper.PacketHandler;
import us.myles.ViaVersion.api.remapper.PacketRemapper;
import us.myles.ViaVersion.api.remapper.ValueCreator;
import us.myles.ViaVersion.api.remapper.ValueTransformer;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.api.type.types.version.Types1_9;
import us.myles.ViaVersion.packets.State;
@ -13,6 +14,13 @@ import us.myles.ViaVersion.protocols.protocolsnapshotto1_10.packets.InventoryPac
import us.myles.ViaVersion.protocols.protocolsnapshotto1_10.storage.EntityTracker;
public class ProtocolSnapshotTo1_10 extends Protocol {
private static final ValueTransformer<Float, Short> toOldByte = new ValueTransformer<Float, Short>(Type.UNSIGNED_BYTE) {
@Override
public Short transform(PacketWrapper wrapper, Float inputValue) throws Exception {
return (short) (inputValue * 16);
}
};
@Override
protected void registerPackets() {
InventoryPackets.register(this);
@ -101,6 +109,24 @@ public class ProtocolSnapshotTo1_10 extends Protocol {
});
}
});
/*
INCOMING PACKETS
*/
// Block placement
registerIncoming(State.PLAY, 0x1C, 0x1C, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Location
map(Type.VAR_INT); // 1 - Face
map(Type.VAR_INT); // 2 - Hand
map(Type.FLOAT, toOldByte);
map(Type.FLOAT, toOldByte);
map(Type.FLOAT, toOldByte);
}
});
}
@Override