9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-19 15:09:23 +00:00

added npex static

This commit is contained in:
XiaoMoMi
2025-03-22 23:05:15 +08:00
parent f5bc4fda2d
commit ebca2deef5
3 changed files with 15 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ modules:
backgrounds: true # Enable background images for nameplates backgrounds: true # Enable background images for nameplates
bubbles: true # Enable bubble text display bubbles: true # Enable bubble text display
bossbars: true # Enable bossbars bossbars: true # Enable bossbars
actionbars: true # Enable actionbars actionbars: false # Enable actionbars
images: true # Enable image displays images: true # Enable image displays
# Plugin Integrations: Integrate resource packs and chat plugins with other plugins. # Plugin Integrations: Integrate resource packs and chat plugins with other plugins.

View File

@@ -1,6 +1,6 @@
# Project settings # Project settings
# Rule: [major update].[feature update].[bug fix] # Rule: [major update].[feature update].[bug fix]
project_version=3.0.24 project_version=3.0.25
config_version=37 config_version=37
project_group=net.momirealms project_group=net.momirealms

View File

@@ -26,6 +26,7 @@ import net.momirealms.customnameplates.api.feature.background.Background;
import net.momirealms.customnameplates.api.feature.bubble.Bubble; import net.momirealms.customnameplates.api.feature.bubble.Bubble;
import net.momirealms.customnameplates.api.feature.nameplate.Nameplate; import net.momirealms.customnameplates.api.feature.nameplate.Nameplate;
import net.momirealms.customnameplates.api.helper.AdventureHelper; import net.momirealms.customnameplates.api.helper.AdventureHelper;
import net.momirealms.customnameplates.api.placeholder.internal.StaticPosition;
import net.momirealms.customnameplates.common.util.MoonPhase; import net.momirealms.customnameplates.common.util.MoonPhase;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@@ -34,7 +35,6 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import javax.imageio.ImageIO;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@@ -146,6 +146,18 @@ public class NameplatesExtraExpansion extends PlaceholderExpansion {
} }
return OffsetFont.createOffsets(Float.parseFloat(split[1])); return OffsetFont.createOffsets(Float.parseFloat(split[1]));
} }
// left:0:xxx
case "static" -> {
if (split.length != 2) {
return null;
}
String subParams = split[1];
String[] subSplit = subParams.split(":", 3);
if (subSplit.length != 3) {
return null;
}
return CustomNameplatesAPI.getInstance().createStaticText(subSplit[2], Integer.parseInt(subSplit[1]), StaticPosition.valueOf(subSplit[0].toUpperCase(Locale.ENGLISH)));
}
case "background" -> { case "background" -> {
if (split.length != 2) { if (split.length != 2) {
return null; return null;