mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2025-12-19 15:09:23 +00:00
2.3.0.7
This commit is contained in:
@@ -41,6 +41,13 @@ public interface DataStorageInterface {
|
||||
*/
|
||||
StorageType getStorageType();
|
||||
|
||||
/**
|
||||
* Get a player's data by uuid
|
||||
* This player can be an offline one
|
||||
*
|
||||
* @param uuid uuid
|
||||
* @return player data
|
||||
*/
|
||||
CompletableFuture<Optional<PlayerData>> getPlayerData(UUID uuid);
|
||||
|
||||
CompletableFuture<Boolean> updatePlayerData(UUID uuid, PlayerData playerData);
|
||||
|
||||
@@ -43,6 +43,7 @@ import net.momirealms.customnameplates.paper.setting.CNLocale;
|
||||
import net.momirealms.customnameplates.paper.storage.StorageManagerImpl;
|
||||
import net.momirealms.customnameplates.paper.util.Migration;
|
||||
import net.momirealms.customnameplates.paper.util.ReflectionUtils;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@@ -95,6 +96,8 @@ public class CustomNameplatesPluginImpl extends CustomNameplatesPlugin implement
|
||||
this.getServer().getPluginManager().registerEvents((VersionManagerImpl) versionManager, this);
|
||||
if (CNConfig.generatePackOnStart)
|
||||
this.resourcePackManager.generateResourcePack();
|
||||
if (CNConfig.metrics)
|
||||
new Metrics(this, 16649);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.momirealms.customnameplates.api.mechanic.placeholder.*;
|
||||
import net.momirealms.customnameplates.api.requirement.Requirement;
|
||||
import net.momirealms.customnameplates.api.util.LogUtils;
|
||||
import net.momirealms.customnameplates.common.Pair;
|
||||
import net.momirealms.customnameplates.paper.setting.CNConfig;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -242,21 +243,31 @@ public class PlaceholderManagerImpl implements PlaceholderManager {
|
||||
}
|
||||
|
||||
private void loadBackGroundTexts(ConfigurationSection section) {
|
||||
if (!CNConfig.backgroundModule) return;
|
||||
for (Map.Entry<String, Object> entry : section.getValues(false).entrySet()) {
|
||||
if (!(entry.getValue() instanceof ConfigurationSection innerSection))
|
||||
continue;
|
||||
|
||||
backGroundTextMap.put(entry.getKey(),
|
||||
BackGroundText.builder()
|
||||
.background(Objects.requireNonNull(plugin.getBackGroundManager().getBackGround(innerSection.getString("background"))))
|
||||
.text(innerSection.getString("text", ""))
|
||||
.removeShadow(innerSection.getBoolean("remove-shadow"))
|
||||
.build()
|
||||
);
|
||||
if (innerSection.contains("background")) {
|
||||
String bg = innerSection.getString("background");
|
||||
var background = plugin.getBackGroundManager().getBackGround(bg);
|
||||
if (background == null) {
|
||||
LogUtils.warn("Background: " + bg + " doesn't exist");
|
||||
continue;
|
||||
}
|
||||
backGroundTextMap.put(entry.getKey(),
|
||||
BackGroundText.builder()
|
||||
.background(background)
|
||||
.text(innerSection.getString("text", ""))
|
||||
.removeShadow(innerSection.getBoolean("remove-shadow"))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void loadNameplateTexts(ConfigurationSection section) {
|
||||
if (!CNConfig.nameplateModule) return;
|
||||
for (Map.Entry<String, Object> entry : section.getValues(false).entrySet()) {
|
||||
if (!(entry.getValue() instanceof ConfigurationSection innerSection))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user