fix: GarbageManager TypeToken NPE + Vault依赖移除 + sync_login secret修复 + AreaProtection空值检查
This commit is contained in:
@@ -34,12 +34,6 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.MilkBowl</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.7.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
|
||||
@@ -2469,6 +2469,9 @@ public class AreaProtection implements Listener {
|
||||
* @return true=限制生效,false=允许
|
||||
*/
|
||||
public boolean getEffectiveDeny(Player player, AreaConfig ac, String permName) {
|
||||
// 如果ac为null(不在任何领地内),直接允许
|
||||
if (ac == null) return false;
|
||||
|
||||
// ADMIN/OWNER不检查per-player deny
|
||||
PermissionLevel level = getPermissionLevel(player, ac);
|
||||
if (level == PermissionLevel.ADMIN || level == PermissionLevel.OWNER) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package Sdf1_login;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Item;
|
||||
@@ -12,7 +11,6 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.*;
|
||||
import java.sql.Date;
|
||||
@@ -287,11 +285,8 @@ public class GarbageManager {
|
||||
.decode(base64);
|
||||
String json = new String(bytes,
|
||||
StandardCharsets.UTF_8);
|
||||
Type type = new TypeToken<
|
||||
Map<String, Object>>() {}
|
||||
.getType();
|
||||
Map<String, Object> map =
|
||||
new Gson().fromJson(json, type);
|
||||
new Gson().fromJson(json, Map.class);
|
||||
map = fixNumberTypes(map);
|
||||
return ItemStack.deserialize(map);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -2502,6 +2502,7 @@ public class WebManager {
|
||||
bodyWithSecret.put("secret", secretKey);
|
||||
|
||||
String json = mapToJson(bodyWithSecret);
|
||||
plugin.getLogger().info("[Web通信] POST+Token请求: " + endpoint + ", secret长度=" + (secretKey != null ? secretKey.length() : 0) + ", body长度=" + json.length());
|
||||
return doPostWithRetry(urlStr.toString(), json, maxRetries);
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().warning("[Web通信] POST+Token请求最终失败: " + endpoint + " - " + e.getClass().getSimpleName() + ": " + e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user