9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-19 15:09:23 +00:00
This commit is contained in:
XiaoMoMi
2024-11-28 18:49:59 +08:00
parent 20d3919c6b
commit cd1a0bffb6
11 changed files with 143 additions and 10 deletions

View File

@@ -18,7 +18,6 @@
package net.momirealms.customnameplates.api;
import io.netty.channel.Channel;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import net.momirealms.customnameplates.api.feature.Feature;
@@ -56,13 +55,11 @@ public abstract class AbstractCNPlayer implements CNPlayer {
private final TeamView teamView = new TeamView();
// these two maps can be visited by other threads
// these maps might be visited by other threads through PlaceholderAPI
private final Map<Integer, TimeStampData<String>> cachedValues = new ConcurrentHashMap<>(128);
private final Map<Integer, WeakHashMap<CNPlayer, TimeStampData<String>>> cachedRelationalValues = new ConcurrentHashMap<>(128);
// these two maps can only be modified in the same thread
private final Map<Integer, TimeStampData<Boolean>> cachedRequirements = new Int2ObjectOpenHashMap<>(32);
private final Map<Integer, WeakHashMap<CNPlayer, TimeStampData<Boolean>>> cachedRelationalRequirements = new Int2ObjectOpenHashMap<>(32);
private final Map<Integer, TimeStampData<Boolean>> cachedRequirements = new ConcurrentHashMap<>(32);
private final Map<Integer, WeakHashMap<CNPlayer, TimeStampData<Boolean>>> cachedRelationalRequirements = new ConcurrentHashMap<>(32);
private final Set<Feature> activeFeatures = new CopyOnWriteArraySet<>();
private final Map<Placeholder, Set<Feature>> placeholder2Features = new ConcurrentHashMap<>();

View File

@@ -112,6 +112,7 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
protected boolean chatAdvanced;
protected boolean chatEss;
protected boolean chatChatControlRed;
protected boolean chatChatty;
protected String configVersion;
@@ -191,6 +192,7 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
chatTR = config.getBoolean("integrations.chat.TrChat", false);
chatVenture = config.getBoolean("integrations.chat.VentureChat", false);
chatChatControlRed = config.getBoolean("integrations.chat.ChatControlRed", false);
chatChatty = config.getBoolean("integrations.chat.Chatty", false);
// Packs
generateOnStart = !config.getBoolean("resource-pack.disable-generation-on-start", false);
@@ -417,6 +419,10 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
return instance.chatChatControlRed;
}
public static boolean chatChatty() {
return instance.chatChatty;
}
@Override
public YamlDocument loadConfig(String filePath) {
return loadConfig(filePath, '.');