Skip to content

Commit da7897c

Browse files
committed
Fix incorrect packet handling
Release 0.3.1
1 parent 6acb9ff commit da7897c

File tree

8 files changed

+10
-19
lines changed

8 files changed

+10
-19
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ You can then include the dependency in your project.
3232
<dependency>
3333
<groupId>net.hypixel</groupId>
3434
<artifactId>mod-api</artifactId>
35-
<version>0.3.0</version>
35+
<version>0.3.1</version>
3636
</dependency>
3737
```
3838

3939
```gradle
4040
dependencies {
41-
implementation 'net.hypixel:mod-api:0.3.0'
41+
implementation 'net.hypixel:mod-api:0.3.1'
4242
}
4343
```

src/main/java/net/hypixel/modapi/HypixelModAPI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import net.hypixel.modapi.error.ErrorReason;
44
import net.hypixel.modapi.error.ModAPIException;
55
import net.hypixel.modapi.handler.ClientboundPacketHandler;
6-
import net.hypixel.modapi.packet.HypixelPacket;
6+
import net.hypixel.modapi.packet.ClientboundHypixelPacket;
77
import net.hypixel.modapi.packet.PacketRegistry;
88
import net.hypixel.modapi.packet.impl.clientbound.ClientboundLocationPacket;
99
import net.hypixel.modapi.packet.impl.clientbound.ClientboundPartyInfoPacket;
@@ -66,9 +66,9 @@ public void handle(String identifier, PacketSerializer serializer) {
6666
throw new ModAPIException(identifier, reason);
6767
}
6868

69-
HypixelPacket packet = registry.createClientboundPacket(identifier, serializer);
69+
ClientboundHypixelPacket packet = registry.createClientboundPacket(identifier, serializer);
7070
for (ClientboundPacketHandler handler : handlers) {
71-
handler.handle(packet);
71+
packet.handle(handler);
7272
}
7373
}
7474

src/main/java/net/hypixel/modapi/handler/ClientboundPacketHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import net.hypixel.modapi.packet.impl.clientbound.ClientboundPingPacket;
66
import net.hypixel.modapi.packet.impl.clientbound.ClientboundPlayerInfoPacket;
77

8-
public interface ClientboundPacketHandler extends PacketHandler {
8+
public interface ClientboundPacketHandler {
99

1010
default void onPingPacket(ClientboundPingPacket packet) {
1111
}

src/main/java/net/hypixel/modapi/handler/PacketHandler.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/main/java/net/hypixel/modapi/packet/impl/clientbound/ClientboundLocationPacket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void write(PacketSerializer serializer) {
7777

7878
@Override
7979
public void handle(ClientboundPacketHandler handler) {
80-
handler.handle(this);
80+
handler.onLocationPacket(this);
8181
}
8282

8383
public Environment getEnvironment() {

src/main/java/net/hypixel/modapi/packet/impl/clientbound/ClientboundPartyInfoPacket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void write(PacketSerializer serializer) {
5858

5959
@Override
6060
public void handle(ClientboundPacketHandler handler) {
61-
handler.handle(this);
61+
handler.onPartyInfoPacket(this);
6262
}
6363

6464
public boolean isInParty() {

src/main/java/net/hypixel/modapi/packet/impl/clientbound/ClientboundPingPacket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void write(PacketSerializer serializer) {
2828

2929
@Override
3030
public void handle(ClientboundPacketHandler handler) {
31-
handler.handle(this);
31+
handler.onPingPacket(this);
3232
}
3333

3434
public String getResponse() {

src/main/java/net/hypixel/modapi/packet/impl/clientbound/ClientboundPlayerInfoPacket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void write(PacketSerializer serializer) {
5050

5151
@Override
5252
public void handle(ClientboundPacketHandler handler) {
53-
handler.handle(this);
53+
handler.onPlayerInfoPacket(this);
5454
}
5555

5656
public PlayerRank getPlayerRank() {

0 commit comments

Comments
 (0)