Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/VenityNetwork/WaterdogPE2
Browse files Browse the repository at this point in the history
…into v1.21.30
  • Loading branch information
AkmalFairuz committed Oct 25, 2024
2 parents ad99fd5 + 688824c commit 6b278bc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,12 @@
public abstract class BedrockPacketCodec extends MessageToMessageCodec<BedrockBatchWrapper, BedrockBatchWrapper> {
public static final String NAME = "bedrock-packet-codec";

private static final EncodingSettings clientEncodingSettings = EncodingSettings.builder()
.maxListSize(4096)
.maxByteArraySize(1024 * 1024 * 2) // 2MB
.maxNetworkNBTSize(1024 * 1024 * 3) // 3MB
.maxItemNBTSize(1024 * 700) // 700KB
.maxStringLength(1024 * 600) // 600KB
.build();

private static final EncodingSettings serverEncodingSettings = EncodingSettings.builder()
.maxListSize(1024)
.maxByteArraySize(1024 * 1024) // 1MB
.maxNetworkNBTSize(1024 * 512) // 500KB
.maxItemNBTSize(1024 * 200) // 100KB
.maxStringLength(1024 * 600) // 600KB
.maxListSize(2048)
.maxByteArraySize(1024 * 1024 * 2)
.maxNetworkNBTSize(1024 * 512 * 2)
.maxItemNBTSize(1024 * 300)
.maxStringLength(1024 * 700)
.build();

private BedrockCodec codec = BedrockCompat.CODEC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public class ProtocolCodecs {
HANDLED_PACKETS.add(LevelChunkPacket.class);
HANDLED_PACKETS.add(ClientCheatAbilityPacket.class);
HANDLED_PACKETS.add(ToastRequestPacket.class);
HANDLED_PACKETS.add(MovementEffectPacket.class);
}

private static final List<ProtocolCodecUpdater> UPDATERS = new ObjectArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.cloudburstmc.protocol.bedrock.codec.v685.Bedrock_v685;
import org.cloudburstmc.protocol.bedrock.codec.v712.Bedrock_v712;
import org.cloudburstmc.protocol.bedrock.codec.v729.Bedrock_v729;
import org.cloudburstmc.protocol.bedrock.codec.v748.Bedrock_v748;

@ToString(exclude = {"defaultCodec", "bedrockCodec"})
public enum ProtocolVersion {
Expand Down Expand Up @@ -109,7 +110,8 @@ public enum ProtocolVersion {
MINECRAFT_PE_1_20_80(671, Bedrock_v671.CODEC),
MINECRAFT_PE_1_21_0(685, Bedrock_v685.CODEC),
MINECRAFT_PE_1_21_20(712, Bedrock_v712.CODEC),
MINECRAFT_PE_1_21_30(729, Bedrock_v729.CODEC);
MINECRAFT_PE_1_21_30(729, Bedrock_v729.CODEC),
MINECRAFT_PE_1_21_40(748, Bedrock_v748.CODEC);

private static final ProtocolVersion[] VALUES = values();
private static final Int2ObjectMap<ProtocolVersion> VERSIONS = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ public PacketSignal handle(AnimateEntityPacket packet) {
return signal;
}

@Override
public PacketSignal handle(MovementEffectPacket packet) {
return rewriteId(packet.getEntityRuntimeId(), packet::setEntityRuntimeId);
}

private PacketSignal rewriteMetadata(EntityDataMap metadata) {
PacketSignal signal = PacketSignal.UNHANDLED;
for (EntityDataType<Long> data : ENTITY_DATA_FIELDS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void rebuildPackets() {

for (ResourcePack pack : this.packs.values()) {
ResourcePacksInfoPacket.Entry infoEntry = new ResourcePacksInfoPacket.Entry(pack.getPackId().toString(), pack.getVersion().toString(),
pack.getPackSize(), pack.getContentKey(), "", pack.getContentKey().equals("") ? "" : pack.getPackId().toString(), false, false, false);
pack.getPackSize(), pack.getContentKey(), "", pack.getContentKey().equals("") ? "" : pack.getPackId().toString(), false, false, false, null);
ResourcePackStackPacket.Entry stackEntry = new ResourcePackStackPacket.Entry(pack.getPackId().toString(), pack.getVersion().toString(), "");
if (pack.getType().equals(ResourcePack.TYPE_RESOURCES)) {
this.packsInfoPacket.getResourcePackInfos().add(infoEntry);
Expand Down

0 comments on commit 6b278bc

Please sign in to comment.