Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/net/hypixel/modapi/error/UnknownErrorReason.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ public int getId() {
return id;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UnknownErrorReason that = (UnknownErrorReason) o;
return id == that.id;
}

@Override
public int hashCode() {
return id;
}

@Override
public String toString() {
return "UnknownErrorReason{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.Set;

/**
* Notifys the remote server what versions of event packets we want to receive.
* Notifies the remote server what versions of event packets we want to receive.
* <p>
* You should not use this packet manually, instead, use {@link net.hypixel.modapi.HypixelModAPI#subscribeToEventPacket(Class)} to subscribe to event packets.
*/
Expand All @@ -27,7 +27,7 @@ public ServerboundRegisterPacket(PacketRegistry registry, Set<String> subscribed
this.subscribedEvents = registry.getEventVersions(subscribedEventIdentifiers);

if (subscribedEvents.size() > MAX_IDENTIFIERS) {
throw new IllegalArgumentException("wantedPackets cannot contain more than " + MAX_IDENTIFIERS + " identifiers");
throw new IllegalArgumentException("subscribedEvents cannot contain more than " + MAX_IDENTIFIERS + " identifiers");
}
}

Expand All @@ -41,7 +41,7 @@ protected boolean read(PacketSerializer serializer) {

int size = serializer.readVarInt();
if (size > MAX_IDENTIFIERS) {
throw new IllegalArgumentException("wantedPackets cannot contain more than " + MAX_IDENTIFIERS + " identifiers");
throw new IllegalArgumentException("subscribedEvents cannot contain more than " + MAX_IDENTIFIERS + " identifiers");
}

this.subscribedEvents = new HashMap<>(size);
Expand Down Expand Up @@ -70,7 +70,7 @@ public Map<String, Integer> getSubscribedEvents() {
@Override
public String toString() {
return "ServerboundRegisterPacket{" +
"wantedPackets=" + subscribedEvents +
"subscribedEvents=" + subscribedEvents +
"} " + super.toString();
}
}