Skip to content

Commit

Permalink
2.3.3.7
Browse files Browse the repository at this point in the history
修复旧版颜色相关问题
  • Loading branch information
Xiao-MoMi committed Apr 6, 2024
1 parent e68a333 commit 8fb4b83
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public interface StaticTextEntity {

String getPlugin();
String getID();

boolean isShownTo(Player viewer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ 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() {
verticalOffset = 0;
comeRule = (player, entity) -> true;
leaveRule = (player, entity) -> true;
defaultText = "";
plugin = "";
id = "";
}

public static Builder builder() {
Expand Down Expand Up @@ -78,8 +78,8 @@ public Builder defaultText(String defaultText) {
return this;
}

public Builder plugin(String type) {
this.setting.plugin = type;
public Builder id(String id) {
this.setting.id = id;
return this;
}

Expand All @@ -100,8 +100,8 @@ public String getDefaultText() {
return defaultText;
}

public String getPlugin() {
return plugin;
public String getID() {
return id;
}

public NearbyRule getLeaveRule() {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {

allprojects {

version = "2.3.3.6"
version = "2.3.3.7"

apply<JavaPlugin>()
apply(plugin = "java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public String legacyToMiniMessage(String legacy) {
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>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@ private void sendBubble(Player player, String text, Bubble bubbleConfig, String
})
.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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -58,7 +58,7 @@ public StaticTextEntityImpl (
NearbyRule comeRule,
NearbyRule leaveRule,
String defaultText,
String plugin
String id
) {
this.entityId = FakeEntityUtils.getAndIncrease();
this.owner = owner;
Expand All @@ -68,15 +68,15 @@ public StaticTextEntityImpl (
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public StaticTextEntity createNamedEntity(EntityTagEntity entity, StaticTextTagS
setting.getComeRule(),
setting.getLeaveRule(),
setting.getDefaultText(),
setting.getPlugin()
setting.getID()
);
}

Expand Down

0 comments on commit 8fb4b83

Please sign in to comment.