Skip to content

Commit 66953d9

Browse files
committed
add ClientAddMarkerPacket#toAddMarkerPacket
1 parent ec4b74c commit 66953d9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

core/src/main/java/net/labymod/serverapi/core/packet/serverbound/game/feature/marker/ClientAddMarkerPacket.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import net.labymod.serverapi.api.payload.io.PayloadReader;
2828
import net.labymod.serverapi.api.payload.io.PayloadWriter;
29+
import net.labymod.serverapi.core.packet.clientbound.game.feature.marker.AddMarkerPacket;
2930
import net.labymod.serverapi.core.packet.common.game.feature.marker.AbstractMarkerPacket;
3031
import org.jetbrains.annotations.NotNull;
3132
import org.jetbrains.annotations.Nullable;
@@ -64,6 +65,22 @@ public int getVersion() {
6465
return this.version;
6566
}
6667

68+
/**
69+
* Maps this packet to a {@link AddMarkerPacket}.
70+
*
71+
* @param sender The sender of the marker
72+
* @return a client-bound add marker packet
73+
*/
74+
public AddMarkerPacket toAddMarkerPacket(UUID sender) {
75+
return new AddMarkerPacket(sender,
76+
this.getX(),
77+
this.getY(),
78+
this.getZ(),
79+
this.isLarge(),
80+
this.getTarget()
81+
);
82+
}
83+
6784
@Override
6885
public String toString() {
6986
return "ClientMarkerPacket{" +

0 commit comments

Comments
 (0)