This commit is contained in:
creeper123123321 2018-05-26 08:52:31 -03:00
parent 6a4f2f6830
commit 9d39bb2d62
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
9 changed files with 16 additions and 34 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w21a</version>
<version>1.4.0-18w21b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w21a</version>
<version>1.4.0-18w21b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w21a</version>
<version>1.4.0-18w21b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -62,7 +62,7 @@ public class ProtocolVersion {
register(v1_12 = new ProtocolVersion(335, "1.12"));
register(v1_12_1 = new ProtocolVersion(338, "1.12.1"));
register(v1_12_2 = new ProtocolVersion(340, "1.12.2"));
register(v1_13 = new ProtocolVersion(378, "18w21a"));
register(v1_13 = new ProtocolVersion(379, "18w21b"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
}

View File

@ -166,18 +166,6 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
wrapper.write(Type.VAR_INT, 0); // Root node index
}
}).send(ProtocolSnapshotTo1_12_2.class);
// Send tags packet twice to not crash client
PacketWrapper tagsPacket = wrapper.create(0x54, new ValueCreator() {
@Override
public void write(PacketWrapper wrapper) throws Exception {
wrapper.write(Type.VAR_INT, 0);
wrapper.write(Type.VAR_INT, 0);
wrapper.write(Type.VAR_INT, 0);
}
});
tagsPacket.send(ProtocolSnapshotTo1_12_2.class);
tagsPacket.send(ProtocolSnapshotTo1_12_2.class);
}
});
}
@ -187,9 +175,9 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
registerOutgoing(State.PLAY, 0x24, 0x25, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Map id
map(Type.BYTE); // Scale
map(Type.BOOLEAN); // Tracking Position
map(Type.VAR_INT); // 0 - Map id
map(Type.BYTE); // 1 - Scale
map(Type.BOOLEAN); // 2 - Tracking Position
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
@ -204,13 +192,6 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
wrapper.write(Type.BYTE, direction);
wrapper.write(Type.OPTIONAL_CHAT, null); // Display Name
}
int columns = wrapper.passthrough(Type.BYTE);
if (columns > 0) {
wrapper.passthrough(Type.BYTE); // rows
wrapper.passthrough(Type.BYTE); // x
wrapper.passthrough(Type.BYTE); // z
wrapper.passthrough(Type.BYTE_ARRAY); // data
}
}
});
}
@ -288,14 +269,15 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
registerOutgoing(State.PLAY, 0x42, 0x44, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING);
map(Type.BYTE);
map(Type.STRING); // 0 - Objective name
map(Type.BYTE); // 1 - Mode
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
byte mode = wrapper.get(Type.BYTE, 0);
// On create or update
if (wrapper.get(Type.BYTE, 0) == 0 || wrapper.get(Type.BYTE, 0) == 2) {
wrapper.passthrough(Type.STRING);
if (mode == 0 || mode == 2) {
wrapper.passthrough(Type.STRING); // Value
String type = wrapper.read(Type.STRING);
// integer or hearts
wrapper.write(Type.VAR_INT, type.equals("integer") ? 0 : 1);

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w21a</version>
<version>1.4.0-18w21b</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>viaversion-jar</name>

View File

@ -6,7 +6,7 @@
<groupId>us.myles</groupId>
<artifactId>viaversion-parent</artifactId>
<version>1.4.0-18w21a</version>
<version>1.4.0-18w21b</version>
<packaging>pom</packaging>
<name>viaversion-parent</name>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w21a</version>
<version>1.4.0-18w21b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w21a</version>
<version>1.4.0-18w21b</version>
</parent>
<modelVersion>4.0.0</modelVersion>