Skip to content

Commit 8ed57ee

Browse files
committed
feat: added some packets
1 parent b025cd8 commit 8ed57ee

4 files changed

Lines changed: 245 additions & 51 deletions

File tree

src/client/java/com/hamusuke/packetcap/PacketDetails.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ public synchronized void createMap() {
9797
}
9898

9999
this.mapForHighlighting.put(fields.getFirst().getName(), new Highlight<>(new HighlightRange(this.getPacketIdEndIndex() + 1, this.getSize() - 1), visitor == null ? null : visitor.getInstance(), "", subHighlights));
100-
}
101-
102-
if (fields.size() >= this.highlights.size()) {
100+
} else if (fields.size() >= this.highlights.size()) {
103101
for (int i = 0; i < this.highlights.size(); i++) {
104102
this.mapForHighlighting.put(fields.get(i).getName(), this.highlights.get(i));
105103
}

src/client/java/com/hamusuke/packetcap/gui/components/ClassFieldList.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import net.minecraft.screen.ScreenTexts;
1717
import net.minecraft.text.OrderedText;
1818
import net.minecraft.text.Text;
19+
import net.minecraft.util.Formatting;
1920
import net.minecraft.util.math.MathHelper;
2021

2122
import java.util.Objects;
@@ -34,7 +35,7 @@ public ClassFieldList(MinecraftClient minecraft, int width, int height, int top,
3435
for (int i = 0; i < fields.size(); i++) {
3536
var field = fields.get(i);
3637
var last = i >= fields.size() - 1;
37-
this.addEntry(field, field.getVisitor(), field.getDescription() + (array && !last ? "," : ""), packetDetailsScreen, parent);
38+
this.addEntry(field, field.getVisitor(), Formatting.strip(field.getDescription()) + (array && !last ? "," : ""), packetDetailsScreen, parent);
3839
this.addEntry(new TextEntry(Text.literal(" ").styled(style -> style.withFont(PacketCapture.MONO_FONT)).asOrderedText()));
3940
}
4041

0 commit comments

Comments
 (0)