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-04-07 01:27:11 +08:00
parent e68a333527
commit 8fb4b8317d
7 changed files with 19 additions and 19 deletions

View File

@@ -24,7 +24,7 @@ import java.util.UUID;
public interface StaticTextEntity {
String getPlugin();
String getID();
boolean isShownTo(Player viewer);

View File

@@ -24,14 +24,14 @@ public class StaticTextTagSetting {
private NearbyRule comeRule;
private NearbyRule leaveRule;
private String defaultText;
private String plugin;
private String id;
public StaticTextTagSetting(double verticalOffset, NearbyRule comeRule, NearbyRule leaveRule, String defaultText, String plugin) {
public StaticTextTagSetting(double verticalOffset, NearbyRule comeRule, NearbyRule leaveRule, String defaultText, String id) {
this.verticalOffset = verticalOffset;
this.comeRule = comeRule;
this.leaveRule = leaveRule;
this.defaultText = defaultText;
this.plugin = plugin;
this.id = id;
}
private StaticTextTagSetting() {
@@ -39,7 +39,7 @@ public class StaticTextTagSetting {
comeRule = (player, entity) -> true;
leaveRule = (player, entity) -> true;
defaultText = "";
plugin = "";
id = "";
}
public static Builder builder() {
@@ -78,8 +78,8 @@ public class StaticTextTagSetting {
return this;
}
public Builder plugin(String type) {
this.setting.plugin = type;
public Builder id(String id) {
this.setting.id = id;
return this;
}
@@ -100,8 +100,8 @@ public class StaticTextTagSetting {
return defaultText;
}
public String getPlugin() {
return plugin;
public String getID() {
return id;
}
public NearbyRule getLeaveRule() {

View File

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

View File

@@ -195,7 +195,7 @@ public class AdventureManagerImpl implements AdventureManager {
case 'd' -> stringBuilder.append("<light_purple>");
case 'e' -> stringBuilder.append("<yellow>");
case 'f' -> stringBuilder.append("<white>");
case 'r' -> stringBuilder.append("<r><!i>");
case 'r' -> stringBuilder.append("<reset>");
case 'l' -> stringBuilder.append("<b>");
case 'm' -> stringBuilder.append("<st>");
case 'o' -> stringBuilder.append("<i>");

View File

@@ -365,11 +365,11 @@ public class BubbleManagerImpl implements BubbleManager, Listener {
})
.verticalOffset(yOffset)
.defaultText(text)
.plugin("bubble")
.id("bubble")
.build());
for (StaticTextEntity bubble : tagEntity.getStaticTags()) {
if (bubble.getPlugin().equals("bubble")) {
if (bubble.getID().equals("bubble")) {
bubble.setOffset(bubble.getOffset() + lineSpace);
}
}

View File

@@ -49,7 +49,7 @@ public class StaticTextEntityImpl implements StaticTextEntity {
private final NearbyRule comeRule;
private final NearbyRule leaveRule;
private String defaultText;
private final String plugin;
private final String id;
private final PacketContainer destroyPacket;
public StaticTextEntityImpl (
@@ -58,7 +58,7 @@ public class StaticTextEntityImpl implements StaticTextEntity {
NearbyRule comeRule,
NearbyRule leaveRule,
String defaultText,
String plugin
String id
) {
this.entityId = FakeEntityUtils.getAndIncrease();
this.owner = owner;
@@ -68,15 +68,15 @@ public class StaticTextEntityImpl implements StaticTextEntity {
this.comeRule = comeRule;
this.leaveRule = leaveRule;
this.defaultText = defaultText;
this.plugin = plugin;
this.id = id;
this.destroyPacket = new PacketContainer(PacketType.Play.Server.ENTITY_DESTROY);
this.destroyPacket.getIntLists().write(0, List.of(entityId));
this.viewersToArray();
}
@Override
public String getPlugin() {
return plugin;
public String getID() {
return id;
}
@Override

View File

@@ -118,7 +118,7 @@ public class UnlimitedTagManagerImpl implements UnlimitedTagManager {
setting.getComeRule(),
setting.getLeaveRule(),
setting.getDefaultText(),
setting.getPlugin()
setting.getID()
);
}