9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-27 10:59:07 +00:00

fix(network): 添加校验

This commit is contained in:
jhqwqmc
2025-07-19 23:34:23 +08:00
parent ad6bd3ae3c
commit 64466257ba

View File

@@ -304,6 +304,9 @@ public class BukkitServerPlayer extends Player {
@Override
public void sendCustomPayload(Key channel, byte[] data) {
if (!VersionHelper.isOrAbove1_20_2()) {
throw new UnsupportedOperationException("Cannot send custom payload to " + name() + " because the server is running a version below 1.20.2");
}
try {
Object channelKey = KeyUtils.toResourceLocation(channel);
Object dataPayload;