Skip to content

Commit

Permalink
Add RefreshEntitlementsPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Sep 8, 2023
1 parent 81ef6bb commit 9cecfbc
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.cloudburstmc.protocol.bedrock.codec.v594.Bedrock_v594;
import org.cloudburstmc.protocol.bedrock.codec.v618.serializer.CameraInstructionSerializer_618;
import org.cloudburstmc.protocol.bedrock.codec.v618.serializer.CameraPresetsSerializer_v618;
import org.cloudburstmc.protocol.bedrock.codec.v618.serializer.RefreshEntitlementsSerializer_v618;
import org.cloudburstmc.protocol.bedrock.codec.v618.serializer.ResourcePacksInfoSerializer_v618;
import org.cloudburstmc.protocol.bedrock.data.LevelEventType;
import org.cloudburstmc.protocol.bedrock.data.ParticleType;
Expand Down Expand Up @@ -60,6 +61,6 @@ public class Bedrock_v618 extends Bedrock_v594 {
.updateSerializer(ResourcePacksInfoPacket.class, ResourcePacksInfoSerializer_v618.INSTANCE)
.updateSerializer(CameraPresetsPacket.class, new CameraPresetsSerializer_v618())
.updateSerializer(CameraInstructionPacket.class, new CameraInstructionSerializer_618())
// TODO: RefreshEntitlementsPacket 305
.registerPacket(RefreshEntitlementsPacket::new, new RefreshEntitlementsSerializer_v618(), 305)
.build();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.cloudburstmc.protocol.bedrock.codec.v618.serializer;

import io.netty.buffer.ByteBuf;
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodecHelper;
import org.cloudburstmc.protocol.bedrock.codec.BedrockPacketSerializer;
import org.cloudburstmc.protocol.bedrock.packet.RefreshEntitlementsPacket;

public class RefreshEntitlementsSerializer_v618 implements BedrockPacketSerializer<RefreshEntitlementsPacket> {

@Override
public void serialize(ByteBuf buffer, BedrockCodecHelper helper, RefreshEntitlementsPacket packet) {
}

@Override
public void deserialize(ByteBuf buffer, BedrockCodecHelper helper, RefreshEntitlementsPacket packet) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -819,4 +819,8 @@ default PacketSignal handle(OpenSignPacket packet) {
default PacketSignal handle(AgentAnimationPacket packet) {
return PacketSignal.UNHANDLED;
}

default PacketSignal handle(RefreshEntitlementsPacket packet) {
return PacketSignal.UNHANDLED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,6 @@ public enum BedrockPacketType {
COMPRESSED_BIOME_DEFINITIONS_LIST,
TRIM_DATA,
OPEN_SIGN,
AGENT_ANIMATION
AGENT_ANIMATION,
REFRESH_ENTITLEMENTS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.cloudburstmc.protocol.bedrock.packet;
import lombok.Data;
import org.cloudburstmc.protocol.common.PacketSignal;

@Data
public class RefreshEntitlementsPacket implements BedrockPacket {

@Override
public PacketSignal handle(BedrockPacketHandler handler) {
return handler.handle(this);
}

@Override
public BedrockPacketType getPacketType() {
return BedrockPacketType.REFRESH_ENTITLEMENTS;
}
}

0 comments on commit 9cecfbc

Please sign in to comment.