Skip to content

Commit

Permalink
Brand Support
Browse files Browse the repository at this point in the history
  • Loading branch information
R00tB33rMan committed Jan 23, 2024
1 parent 5f5b20b commit 5e4a375
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions plugin/src/main/java/net/elytrium/limboapi/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ public static class MAIN {
@Comment("How many chunks we should send per tick")
public int CHUNKS_PER_TICK = 16;

@Comment({
"Change server brand in limbo.",
"Available placeholders: {default}, {version} and {limbo_name}"
})
public String LIMBO_SERVER_BRAND = "{default}";

@Create
public MESSAGES MESSAGES;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,10 @@ private PreparedPacket getBrandMessage(Class<? extends LimboSessionHandler> hand
}

private PluginMessagePacket createBrandMessage(ProtocolVersion version) {
String brand = "LimboAPI (" + Settings.IMP.VERSION + ") -> " + this.limboName;
String brand = Settings.IMP.MAIN.LIMBO_SERVER_BRAND
.replace("{default}", "LimboAPI ({version}) -> {limbo_name}")
.replace("{version}", Settings.IMP.VERSION)
.replace("{limbo_name}", ((this.limboName == null) ? "" : this.limboName));
ByteBuf bufWithBrandString = Unpooled.buffer();
if (version.compareTo(ProtocolVersion.MINECRAFT_1_8) < 0) {
bufWithBrandString.writeCharSequence(brand, StandardCharsets.UTF_8);
Expand Down

0 comments on commit 5e4a375

Please sign in to comment.