Handle new argument types

This commit is contained in:
Nassim Jahnke 2024-03-22 20:39:31 +01:00
parent 0c7aa1d037
commit 9beaf71196
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -139,7 +139,18 @@ public final class Protocol1_20_3To1_20_5 extends BackwardsProtocol<ClientboundP
response.sendToServer(Protocol1_20_3To1_20_5.class);
});
new CommandRewriter1_19_4<>(this).registerDeclareCommands1_19(ClientboundPackets1_20_5.DECLARE_COMMANDS);
new CommandRewriter1_19_4<ClientboundPacket1_20_5>(this) {
@Override
public void handleArgument(final PacketWrapper wrapper, final String argumentType) throws Exception {
if (argumentType.equals("minecraft:loot_table")
|| argumentType.equals("minecraft:loot_predicate")
|| argumentType.equals("minecraft:loot_modifier")) {
wrapper.write(Type.VAR_INT, 0);
} else {
super.handleArgument(wrapper, argumentType);
}
}
}.registerDeclareCommands1_19(ClientboundPackets1_20_5.DECLARE_COMMANDS);
cancelClientbound(ClientboundPackets1_20_5.DEBUG_SAMPLE);
}