We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b04fca8 commit 944b3f8Copy full SHA for 944b3f8
src/main/java/com/comphenix/protocol/PacketType.java
@@ -654,6 +654,7 @@ public String getPacketName() {
654
private boolean forceAsync;
655
656
private boolean dynamic;
657
+ private int hashCode;
658
659
/**
660
* Retrieve the current packet/legacy lookup.
@@ -1191,7 +1192,14 @@ public boolean isDynamic() {
1191
1192
1193
@Override
1194
public int hashCode() {
- return Objects.hashCode(protocol, sender, currentId);
1195
+ int hash = hashCode;
1196
+ if (hash == 0) {
1197
+ hash = protocol.hashCode();
1198
+ hash = 31 * hash + sender.hashCode();
1199
+ hash = 31 * hash + Integer.hashCode(currentId);
1200
+ hashCode = hash;
1201
+ }
1202
+ return hash;
1203
}
1204
1205
0 commit comments