mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2025-12-20 15:39:23 +00:00
goodbye thin font
This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'net.momirealms'
|
group = 'net.momirealms'
|
||||||
version = '2.2.3.17.1'
|
version = '2.2.3.18'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {name = "aliyun-repo"; url = "https://maven.aliyun.com/repository/public/"}
|
maven {name = "aliyun-repo"; url = "https://maven.aliyun.com/repository/public/"}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public class ConfigManager extends Function {
|
|||||||
public static String bubbles_folder_path;
|
public static String bubbles_folder_path;
|
||||||
public static String images_folder_path;
|
public static String images_folder_path;
|
||||||
public static boolean itemsAdderHook;
|
public static boolean itemsAdderHook;
|
||||||
public static boolean thin_font;
|
|
||||||
public static boolean tab_hook;
|
public static boolean tab_hook;
|
||||||
public static boolean tab_BC_hook;
|
public static boolean tab_BC_hook;
|
||||||
public static boolean velocitab_hook;
|
public static boolean velocitab_hook;
|
||||||
@@ -129,13 +128,6 @@ public class ConfigManager extends Function {
|
|||||||
disableForBedrock = section.getBoolean("disable-for-bedrock-players", false);
|
disableForBedrock = section.getBoolean("disable-for-bedrock-players", false);
|
||||||
sendDelay = section.getInt("send-delay", 0);
|
sendDelay = section.getInt("send-delay", 0);
|
||||||
}
|
}
|
||||||
if (enableNameplates) {
|
|
||||||
YamlConfiguration np_config = ConfigUtils.getConfig("configs" + File.separator + "nameplate.yml");
|
|
||||||
thin_font = np_config.getBoolean("thin-font", false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
thin_font = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getMiniMessageFontTag() {
|
public static String getMiniMessageFontTag() {
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import net.momirealms.customnameplates.object.Function;
|
|||||||
import net.momirealms.customnameplates.object.SimpleChar;
|
import net.momirealms.customnameplates.object.SimpleChar;
|
||||||
import net.momirealms.customnameplates.object.font.ASCIIWidth;
|
import net.momirealms.customnameplates.object.font.ASCIIWidth;
|
||||||
import net.momirealms.customnameplates.object.font.OffsetFont;
|
import net.momirealms.customnameplates.object.font.OffsetFont;
|
||||||
import net.momirealms.customnameplates.object.font.ThinASCIIWidth;
|
|
||||||
import net.momirealms.customnameplates.utils.AdventureUtils;
|
import net.momirealms.customnameplates.utils.AdventureUtils;
|
||||||
import net.momirealms.customnameplates.utils.ConfigUtils;
|
import net.momirealms.customnameplates.utils.ConfigUtils;
|
||||||
import org.apache.commons.lang3.StringEscapeUtils;
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
@@ -67,12 +66,8 @@ public class FontManager extends Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadASCIIWidth() {
|
private void loadASCIIWidth() {
|
||||||
if (ConfigManager.thin_font)
|
for (int i = 0; i < ASCIIWidth.values().length; i++)
|
||||||
for (int i = 0; i < ThinASCIIWidth.values().length; i++)
|
asciiWidth.put(ASCIIWidth.values()[i].getCharacter(), ASCIIWidth.values()[i].getWidth());
|
||||||
asciiWidth.put(ThinASCIIWidth.values()[i].getCharacter(), ThinASCIIWidth.values()[i].getWidth());
|
|
||||||
else
|
|
||||||
for (int i = 0; i < ASCIIWidth.values().length; i++)
|
|
||||||
asciiWidth.put(ASCIIWidth.values()[i].getCharacter(), ASCIIWidth.values()[i].getWidth());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadCustomWidth(char c, int width) {
|
public void loadCustomWidth(char c, int width) {
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) <2022> <XiaoMoMi>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package net.momirealms.customnameplates.object.font;
|
|
||||||
|
|
||||||
public enum ThinASCIIWidth {
|
|
||||||
|
|
||||||
A('A', 3), a('a', 3), B('B', 3), b('b', 3),
|
|
||||||
C('C', 3), c('c', 3), D('D', 3), d('d', 3),
|
|
||||||
E('E', 3), e('e', 3), F('F', 3), f('f', 2),
|
|
||||||
G('G', 3), g('g', 3), H('H', 3), h('h', 3),
|
|
||||||
I('I', 2), i('i', 2), J('J', 3), j('j', 2),
|
|
||||||
K('K', 3), k('k', 3), L('L', 3), l('l', 2),
|
|
||||||
M('M', 3), m('m', 3), N('N', 3), n('n', 3),
|
|
||||||
O('O', 3), o('o', 3), P('P', 3), p('p', 3),
|
|
||||||
Q('Q', 3), q('q', 3), R('R', 3), r('r', 3),
|
|
||||||
S('S', 3), s('s', 3), T('T', 3), t('t', 2),
|
|
||||||
U('U', 3), u('u', 3), V('V', 3), v('v', 3),
|
|
||||||
W('W', 3), w('w', 3), X('X', 3), x('x', 3),
|
|
||||||
Y('Y', 3), y('y', 3), Z('Z', 3), z('z', 3),
|
|
||||||
NUM_1('1', 2), NUM_2('2', 3), NUM_3('3', 3), NUM_4('4', 3),
|
|
||||||
NUM_5('5', 3), NUM_6('6', 3), NUM_7('7', 3), NUM_8('8', 3),
|
|
||||||
NUM_9('9', 3), NUM_0('0', 3), EXCLAMATION_POINT('!', 1), AT_SYMBOL('@', 3),
|
|
||||||
NUM_SIGN('#', 3), DOLLAR_SIGN('$', 3), PERCENT('%', 3), UP_ARROW('^', 3),
|
|
||||||
AMPERSAND('&', 3), ASTERISK('*', 3), LEFT_PARENTHESIS('(', 2),
|
|
||||||
RIGHT_PARENTHESIS(')', 2), MINUS('-', 3), UNDERSCORE('_', 3), PLUS_SIGN('+', 3),
|
|
||||||
EQUALS_SIGN('=', 3), LEFT_CURL_BRACE('{', 1), RIGHT_CURL_BRACE('}', 1),
|
|
||||||
LEFT_BRACKET('[', 2), RIGHT_BRACKET(']', 2), COLON(':', 1), SEMI_COLON(';', 1),
|
|
||||||
DOUBLE_QUOTE('\"', 2), SINGLE_QUOTE('\'', 1), LEFT_ARROW('<', 2),
|
|
||||||
RIGHT_ARROW('>', 2), QUESTION_MARK('?', 3), SLASH('/', 3),
|
|
||||||
BACK_SLASH('\\', 3), LINE('|', 1), TILDE('~', 3), TICK('`', 1),
|
|
||||||
PERIOD('.', 1), COMMA(',', 1), SPACE(' ', 3),
|
|
||||||
IN_BETWEEN(' ', 3), DEFAULT('默', 8);
|
|
||||||
|
|
||||||
private final char character;
|
|
||||||
private final int width;
|
|
||||||
|
|
||||||
ThinASCIIWidth(char character, int width) {
|
|
||||||
this.character = character;
|
|
||||||
this.width = width;
|
|
||||||
}
|
|
||||||
|
|
||||||
public char getCharacter() {
|
|
||||||
return this.character;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWidth() {
|
|
||||||
return this.width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -136,6 +136,9 @@ static-text:
|
|||||||
# Note: If you want to make an image lower, edit the y position/ascent in that plugin instead of
|
# Note: If you want to make an image lower, edit the y position/ascent in that plugin instead of
|
||||||
# using descent text or descent unicode because they are designed for characters
|
# using descent text or descent unicode because they are designed for characters
|
||||||
descent-text:
|
descent-text:
|
||||||
|
name:
|
||||||
|
text: "%player_name%"
|
||||||
|
descent: 0
|
||||||
player:
|
player:
|
||||||
text: "%player_name%"
|
text: "%player_name%"
|
||||||
descent: 5
|
descent: 5
|
||||||
|
|||||||
@@ -20,10 +20,6 @@ preview-duration: 5
|
|||||||
# "none" represents no default nameplate.
|
# "none" represents no default nameplate.
|
||||||
default-nameplate: 'none'
|
default-nameplate: 'none'
|
||||||
|
|
||||||
# uniform font name compatibility
|
|
||||||
# uniform字体(细字体)宽度兼容
|
|
||||||
thin-font: false
|
|
||||||
|
|
||||||
# Prefix & Suffix
|
# Prefix & Suffix
|
||||||
# Rejoin the server to apply the changes
|
# Rejoin the server to apply the changes
|
||||||
# 前缀和后缀,重新进入服务器以应用更改
|
# 前缀和后缀,重新进入服务器以应用更改
|
||||||
@@ -37,7 +33,7 @@ hide-suffix-when-equipping-nameplate: false
|
|||||||
|
|
||||||
armor_stand:
|
armor_stand:
|
||||||
text_1:
|
text_1:
|
||||||
text: '%nameplates_prefix%%player_name%%nameplates_suffix%'
|
text: '%nameplates_prefix%%nameplates_descent_name%%nameplates_suffix%'
|
||||||
vertical-offset: -1
|
vertical-offset: -1
|
||||||
text_2:
|
text_2:
|
||||||
text: '%vault_prefix%'
|
text: '%vault_prefix%'
|
||||||
@@ -53,7 +49,7 @@ armor_stand:
|
|||||||
# This limitation is due to the way the client handles the packet, and it cannot be resolved from the server side.
|
# This limitation is due to the way the client handles the packet, and it cannot be resolved from the server side.
|
||||||
text_display:
|
text_display:
|
||||||
text_1:
|
text_1:
|
||||||
text: '%nameplates_prefix%%player_name%%nameplates_suffix%'
|
text: '%nameplates_prefix%%nameplates_descent_name%%nameplates_suffix%'
|
||||||
vertical-offset: -1
|
vertical-offset: -1
|
||||||
options:
|
options:
|
||||||
is-see-through: false
|
is-see-through: false
|
||||||
|
|||||||
Reference in New Issue
Block a user