feat: 完善稳定性并重构潜影盒安全机制

This commit is contained in:
2026-08-02 03:36:19 +08:00
parent d9b1312e0c
commit 92ef7f6030
35 changed files with 1167 additions and 229 deletions
@@ -56,6 +56,11 @@ public class NightVisionCommand extends BaseCommand {
private boolean isPluginNightVisionEnabled(Player player) {
Byte value = player.getPersistentDataContainer().get(enabledKey, PersistentDataType.BYTE);
return value != null && value == (byte) 1;
boolean enabled = value != null && value == (byte) 1;
if (enabled && !player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
player.getPersistentDataContainer().remove(enabledKey);
return false;
}
return enabled;
}
}