3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 22:02:50 +02:00

Fix parsing of custom recipes

Fixes #1995
Dieser Commit ist enthalten in:
KennyTV 2020-08-16 10:18:08 +02:00
Ursprung c6c5b9430e
Commit 37170a2180
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
3 geänderte Dateien mit 24 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -158,7 +158,7 @@ public class Protocol1_13_1To1_13 extends Protocol<ClientboundPackets1_13, Clien
newId++;
}
return newId;
});
}).register(ClientboundPackets1_13.STATISTICS);
}
@Override

Datei anzeigen

@ -1,6 +1,7 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2;
import com.google.common.collect.Sets;
import com.google.common.primitives.Ints;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import net.md_5.bungee.api.ChatColor;
@ -840,7 +841,14 @@ public class Protocol1_13To1_12_2 extends Protocol<ClientboundPackets1_12_1, Cli
int type = wrapper.get(Type.VAR_INT, 0);
if (type == 0) {
wrapper.write(Type.INT, Integer.parseInt(wrapper.read(Type.STRING).substring(18)));
Integer id = Ints.tryParse(wrapper.read(Type.STRING).substring(18));
// Custom recipes
if (id == null) {
wrapper.cancel();
return;
}
wrapper.write(Type.INT, id);
}
if (type == 1) {
wrapper.passthrough(Type.BOOLEAN); // Crafting Recipe Book Open

15
pom.xml
Datei anzeigen

@ -143,7 +143,6 @@
</dependency>
</dependencies>
<build>
<plugins>
<!-- Run any tests -->
@ -152,6 +151,20 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>deploy</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>