Add new default command parser

This commit is contained in:
Nassim Jahnke 2022-02-23 18:15:39 +01:00
parent 28bd50a105
commit 82ada0bcd8
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 7 additions and 1 deletions

View File

@ -79,7 +79,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_17 = register(755, "1.17");
public static final ProtocolVersion v1_17_1 = register(756, "1.17.1");
public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1));
public static final ProtocolVersion v1_18_2 = register(758, 70, "1.18.2");
public static final ProtocolVersion v1_18_2 = register(758, 72, "1.18.2");
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
public static ProtocolVersion register(int version, String name) {

View File

@ -67,6 +67,12 @@ public abstract class CommandRewriter {
this.parserHandlers.put("minecraft:score_holder", wrapper -> {
wrapper.passthrough(Type.BYTE); // Flags
});
this.parserHandlers.put("minecraft:resource", wrapper -> {
wrapper.passthrough(Type.STRING); // Resource location
});
this.parserHandlers.put("minecraft:resource_or_tag", wrapper -> {
wrapper.passthrough(Type.STRING); // Resource location/tag
});
}
public void handleArgument(PacketWrapper wrapper, String argumentType) throws Exception {