Skip to content

Commit

Permalink
Add ParticleStatus to ServerboundClientInformationPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-Ferguson committed Oct 21, 2024
1 parent 293f62e commit a4bfe67
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.geysermc.mcprotocollib.protocol.data.game.setting;

public enum ParticleStatus {
ALL,
DECREASED,
MINIMAL;

public static final ParticleStatus[] VALUES = values();

public static ParticleStatus from(int id) {
return VALUES[id];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.geysermc.mcprotocollib.protocol.codec.MinecraftPacket;
import org.geysermc.mcprotocollib.protocol.data.game.entity.player.HandPreference;
import org.geysermc.mcprotocollib.protocol.data.game.setting.ChatVisibility;
import org.geysermc.mcprotocollib.protocol.data.game.setting.ParticleStatus;
import org.geysermc.mcprotocollib.protocol.data.game.setting.SkinPart;

import java.util.ArrayList;
Expand All @@ -29,6 +30,7 @@ public class ServerboundClientInformationPacket implements MinecraftPacket {
* Whether the client permits being shown in server ping responses.
*/
private final boolean allowsListing;
private final @NonNull ParticleStatus particleStatus;

public ServerboundClientInformationPacket(ByteBuf in, MinecraftCodecHelper helper) {
this.locale = helper.readString(in);
Expand All @@ -48,6 +50,7 @@ public ServerboundClientInformationPacket(ByteBuf in, MinecraftCodecHelper helpe
this.mainHand = HandPreference.from(helper.readVarInt(in));
this.textFilteringEnabled = in.readBoolean();
this.allowsListing = in.readBoolean();
this.particleStatus = ParticleStatus.from(helper.readVarInt(in));
}

@Override
Expand All @@ -67,5 +70,6 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
helper.writeVarInt(out, this.mainHand.ordinal());
out.writeBoolean(this.textFilteringEnabled);
out.writeBoolean(allowsListing);
helper.writeVarInt(out, this.particleStatus.ordinal());
}
}

0 comments on commit a4bfe67

Please sign in to comment.