Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 00:22:51 +01:00
Support for 16w39c
Dieser Commit ist enthalten in:
Ursprung
ffbd399993
Commit
4d3302a926
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<artifactId>viaversion</artifactId>
|
<artifactId>viaversion</artifactId>
|
||||||
<version>1.0.0-ALPHA-16w39b</version>
|
<version>1.0.0-ALPHA-16w39c</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ViaVersion</name>
|
<name>ViaVersion</name>
|
||||||
|
@ -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(308, "1.11-SNAPSHOT"));
|
register(vSNAPSHOT = new ProtocolVersion(309, "1.11-SNAPSHOT"));
|
||||||
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
|
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import us.myles.ViaVersion.api.protocol.Protocol;
|
|||||||
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.remapper.ValueCreator;
|
||||||
|
import us.myles.ViaVersion.api.remapper.ValueTransformer;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
||||||
import us.myles.ViaVersion.packets.State;
|
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;
|
import us.myles.ViaVersion.protocols.protocolsnapshotto1_10.storage.EntityTracker;
|
||||||
|
|
||||||
public class ProtocolSnapshotTo1_10 extends Protocol {
|
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
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
||||||
InventoryPackets.register(this);
|
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
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren