Skip to content

Commit

Permalink
handshake receive
Browse files Browse the repository at this point in the history
  • Loading branch information
topi-banana committed Dec 3, 2024
1 parent 191efdf commit fdb001f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/vulpeus/kyoyu/net/IKyoyuPacket.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.vulpeus.kyoyu.net;

import net.minecraft.world.entity.player.Player;
import net.minecraft.server.level.ServerPlayer;

public abstract class IKyoyuPacket {

public IKyoyuPacket(byte[] bytes) {}

public abstract byte[] encode();

public abstract void onServer(Player player);
public abstract void onServer(ServerPlayer player);

public abstract void onClient();

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/vulpeus/kyoyu/net/packets/HandshakePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import com.vulpeus.kyoyu.Kyoyu;
import com.vulpeus.kyoyu.net.IKyoyuPacket;
import net.minecraft.world.entity.player.Player;
import com.vulpeus.kyoyu.net.KyoyuPacketManager;
import net.minecraft.server.level.ServerPlayer;

import java.nio.charset.StandardCharsets;

Expand All @@ -26,12 +27,11 @@ public byte[] encode() {
}

@Override
public void onServer(Player player) {
public void onServer(ServerPlayer player) {
Kyoyu.LOGGER.info("Login `{}` with compatible client version `{}`", version, player.getName().getString());

// TODO
// packet = new HandshakePacket(Kyoyu.MOD_VERSION);
// packet.send(player);
HandshakePacket handshakePacket = new HandshakePacket(Kyoyu.MOD_VERSION);
KyoyuPacketManager.sendS2C(handshakePacket, player);
}

@Override
Expand Down

0 comments on commit fdb001f

Please sign in to comment.