Skip to content

Commit

Permalink
add constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrygames committed May 30, 2024
1 parent 7f64f9f commit 60d3877
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public class CustomReportDetailsPacket implements MinecraftPacket {

private Map<String, String> details;

public CustomReportDetailsPacket() {
}

public CustomReportDetailsPacket(Map<String, String> details) {
this.details = details;
}

@Override
public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion protocolVersion) {
int detailsCount = ProtocolUtils.readVarInt(buf);
Expand All @@ -53,4 +60,8 @@ public void encode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersi
public boolean handle(MinecraftSessionHandler handler) {
return handler.handle(this);
}

public Map<String, String> getDetails() {
return details;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public class ServerLinksPacket implements MinecraftPacket {

private List<ServerLink> serverLinks;

public ServerLinksPacket() {
}

public ServerLinksPacket(List<ServerLink> serverLinks) {
this.serverLinks = serverLinks;
}

@Override
public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) {
int linksCount = ProtocolUtils.readVarInt(buf);
Expand All @@ -54,6 +61,10 @@ public boolean handle(MinecraftSessionHandler handler) {
return handler.handle(this);
}

public List<ServerLink> getServerLinks() {
return serverLinks;
}

public record ServerLink(int id, ComponentHolder displayName, String url) {
private static ServerLink read(ByteBuf buf, ProtocolVersion version) {
if (buf.readBoolean()) {
Expand Down

0 comments on commit 60d3877

Please sign in to comment.