Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
kanisonpoon authored Apr 30, 2022
1 parent 48b4003 commit a48703d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
import com.nukkitx.protocol.bedrock.handler.BatchHandler;
import com.nukkitx.protocol.bedrock.packet.*;
import com.nukkitx.protocol.bedrock.v475.Bedrock_v475;
import com.nukkitx.protocol.bedrock.v503.Bedrock_v503;
import io.netty.buffer.ByteBuf;
import lombok.Getter;
import org.akmalfairuz.bedrockproxy.Player;
Expand Down Expand Up @@ -63,7 +63,7 @@ public boolean handlePacket(BedrockPacket packet) {
}
player.setLoginPacket((LoginPacket) packet);
//TODO:muliprotocol
session.setPacketCodec(Bedrock_v475.V475_CODEC);
session.setPacketCodec(Bedrock_v503.V503_CODEC);
PlayStatusPacket status = new PlayStatusPacket();
status.setStatus(PlayStatusPacket.Status.LOGIN_SUCCESS);
session.sendPacket(status);
Expand Down Expand Up @@ -110,13 +110,13 @@ public boolean handlePacket(BedrockPacket packet) {
return player.handleFormResponse((ModalFormResponsePacket) packet);
}
if(packet instanceof MovePlayerPacket) {
player.setPosition(((MovePlayerPacket) packet).getPosition());
player.position = (((MovePlayerPacket) packet).getPosition());
}
if(player.isConnectedToServer()) {
ClientPacketRewriter.rewrite(player, packet);
if(packet instanceof MovePlayerPacket || packet instanceof PlayerActionPacket || packet instanceof AnimatePacket) {
if (player.getPlayerCheat().isFakeLag() && player.isInitialized()) {
player.getFakeLagQueuedPackets().add(packet);
if (player.playerCheat.fakeLag && player.initialized) {
player.fakeLagQueuedPackets.add(packet);
return true;
}
return false;
Expand Down Expand Up @@ -146,7 +146,7 @@ public void sendEmptyChunk() {
public void sendStartGame() {
int entityId = ThreadLocalRandom.current().nextInt(10000, 15000);
this.entityId = entityId;
player.setPlayerId(entityId);
player.playerId = (entityId);
StartGamePacket startGamePacket = new StartGamePacket();
startGamePacket.setUniqueEntityId(entityId);
startGamePacket.setRuntimeEntityId(entityId);
Expand Down

0 comments on commit a48703d

Please sign in to comment.