9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-25 09:59:16 +00:00
This commit is contained in:
XiaoMoMi
2023-09-08 01:45:58 +08:00
parent e0e75e0499
commit ef4d5340a0
7 changed files with 20 additions and 3 deletions

View File

@@ -86,8 +86,17 @@ public class BackgroundManager extends Function {
offset_8, offset_16,
offset_32, offset_64,
offset_128, endChar,
config.getInt("left-margin", 1), config.getInt("right-margin", 1)))
;
config.getInt("left-margin", 1), config.getInt("right-margin", 1)));
plugin.getFontManager().loadCustomWidth(o1, 1);
plugin.getFontManager().loadCustomWidth(o2, 2);
plugin.getFontManager().loadCustomWidth(o4, 4);
plugin.getFontManager().loadCustomWidth(o8, 8);
plugin.getFontManager().loadCustomWidth(o16, 16);
plugin.getFontManager().loadCustomWidth(o32, 32);
plugin.getFontManager().loadCustomWidth(o64, 64);
plugin.getFontManager().loadCustomWidth(o128, 128);
plugin.getFontManager().loadCustomWidth(oStart, config.getInt("left.width", 1));
plugin.getFontManager().loadCustomWidth(oEnd, config.getInt("right.width", 1));
}
AdventureUtils.consoleMessage("[CustomNameplates] Loaded <green>" + backGroundConfigMap.size() + " <gray>backgrounds");
}

View File

@@ -84,6 +84,8 @@ public class FontManager extends Function {
customImageWidth.put(ASCIIWidth.values()[i].getCharacter(), ASCIIWidth.values()[i].getWidth());
for (SimpleChar simpleChar : plugin.getImageManager().getCharacterMap().values())
customImageWidth.put(simpleChar.getChars(), simpleChar.getWidth());
for (OffsetFont offsetFont : OffsetFont.values())
customImageWidth.put(offsetFont.getCharacter(), offsetFont.getSpace() - 1);
YamlConfiguration config = ConfigUtils.getConfig("configs" + File.separator + "image-width.yml");
for (String image : config.getKeys(false)) {
String character = AdventureUtils.stripAllTags(PlaceholderAPI.setPlaceholders(null, image));

View File

@@ -22,6 +22,7 @@ import net.momirealms.customnameplates.object.Function;
import net.momirealms.customnameplates.object.SimpleChar;
import net.momirealms.customnameplates.utils.AdventureUtils;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
import java.io.File;

View File

@@ -45,7 +45,6 @@ public class ActionBarSender {
}
public boolean canSend() {
if (requirements.length == 0) return true;
for (Requirement requirement : requirements) {
if (!requirement.isConditionMet(player)) {
return false;

View File

@@ -5,11 +5,13 @@ left:
image: b0
height: 14
ascent: 7
width: 1
right:
image: b0
height: 14
ascent: 7
width: 1
middle:
height: 14

View File

@@ -5,11 +5,13 @@ left:
image: b0
height: 14
ascent: 9
width: 1
right:
image: b0
height: 14
ascent: 9
width: 1
middle:
height: 14

View File

@@ -5,11 +5,13 @@ left:
image: b0
height: 14
ascent: -7
width: 1
right:
image: b0
height: 14
ascent: -7
width: 1
middle:
height: 14