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-03-10 08:13:34 +08:00
parent 6fafb85cec
commit be8cf27f37
4 changed files with 19 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ plugins {
allprojects {
version = "2.3.3.3"
version = "2.3.3.4"
apply<JavaPlugin>()
apply(plugin = "java")

View File

@@ -29,6 +29,7 @@ import net.kyori.adventure.text.minimessage.internal.parser.node.ElementNode;
import net.kyori.adventure.text.minimessage.internal.parser.node.TagNode;
import net.kyori.adventure.text.minimessage.internal.parser.node.ValueNode;
import net.kyori.adventure.text.minimessage.tag.Inserting;
import net.kyori.adventure.text.minimessage.tag.Tag;
import net.momirealms.customnameplates.api.CustomNameplatesPlugin;
import net.momirealms.customnameplates.api.manager.WidthManager;
import net.momirealms.customnameplates.api.mechanic.background.BackGround;
@@ -907,7 +908,6 @@ public class WidthManagerImpl implements WidthManager {
ElementNode node = (ElementNode) MiniMessage.miniMessage().deserializeToTree(text);
ArrayList<Tuple<String, Key, Boolean>> list = new ArrayList<>();
nodeToStringInfo(node, list, Key.of("minecraft", "default"), false);
int totalLength = 0;
for (Tuple<String, Key, Boolean> element : list) {
FontData data = getFontData(element.getMid());
@@ -936,7 +936,11 @@ public class WidthManagerImpl implements WidthManager {
} else if (node instanceof TagNode tagNode) {
if (tagNode.tag() instanceof Inserting inserting) {
Component component = inserting.value();
isBold = component.hasDecoration(TextDecoration.BOLD);
if (component.decoration(TextDecoration.BOLD) == TextDecoration.State.TRUE) {
isBold = true;
} else if (component.decoration(TextDecoration.BOLD) == TextDecoration.State.FALSE) {
isBold = false;
}
var key = component.font();
if (key != null) {
font = net.momirealms.customnameplates.common.Key.of(key.namespace(), key.value());

View File

@@ -378,7 +378,8 @@ public class RequirementManagerImpl implements RequirementManager {
return condition -> {
String currentWeather;
World world = Objects.requireNonNull(condition.getOfflinePlayer().getPlayer()).getWorld();
if (world.isThundering()) currentWeather = "thunder";
if (world.hasStorm()) currentWeather = "rainstorm";
else if (world.isThundering()) currentWeather = "thunder";
else if (world.isClearWeather()) currentWeather = "clear";
else currentWeather = "rain";
for (String weather : weathers)

View File

@@ -36,3 +36,13 @@ customcrops:default:
: 6
: 6
: 4
minecraft:customcrops:
default: 8
template-loading-sequence: []
values:
: -2
: 4
: 6
: 6
: 4