21 lines
1.5 KiB
Diff
21 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <mrhua269@gmail.com>
|
|
Date: Sat, 18 Apr 2026 09:16:40 +0800
|
|
Subject: [PATCH] Add config to verify signature only in online-mode
|
|
|
|
Co-authored-by: Stabrinai <wujiaxin752@outlook.com>
|
|
|
|
diff --git a/net/minecraft/world/entity/player/ProfilePublicKey.java b/net/minecraft/world/entity/player/ProfilePublicKey.java
|
|
index 5e29a9de070e9922513e972254fc7ec43e8774f2..2de1886f9d9f06f8b92755e8421c176679e8b5ce 100644
|
|
--- a/net/minecraft/world/entity/player/ProfilePublicKey.java
|
|
+++ b/net/minecraft/world/entity/player/ProfilePublicKey.java
|
|
@@ -23,7 +23,7 @@ public record ProfilePublicKey(ProfilePublicKey.Data data) {
|
|
public static final Codec<ProfilePublicKey> TRUSTED_CODEC = ProfilePublicKey.Data.CODEC.xmap(ProfilePublicKey::new, ProfilePublicKey::data);
|
|
|
|
public static ProfilePublicKey createValidated(final SignatureValidator validator, final UUID profileId, final ProfilePublicKey.Data data) throws ProfilePublicKey.ValidationException {
|
|
- if (!data.validateSignature(validator, profileId)) {
|
|
+ if (!data.validateSignature(validator, profileId) && (org.bukkit.Bukkit.getServer().getOnlineMode() && me.earthme.luminol.config.modules.misc.PublickeyVerifyConfig.enabled)) { // Luminol - Verify signature only in online-mode
|
|
throw new ProfilePublicKey.ValidationException(INVALID_SIGNATURE, org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PUBLIC_KEY_SIGNATURE); // Paper - kick event causes
|
|
} else {
|
|
return new ProfilePublicKey(data);
|