Add ParticleStatus to ServerboundClientInformationPacket

This commit is contained in:
AJ Ferguson 2024-10-20 22:39:05 -04:00
parent 293f62ecf1
commit a4bfe67233
2 changed files with 17 additions and 0 deletions

View file

@ -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];
}
}

View file

@ -9,6 +9,7 @@ import org.geysermc.mcprotocollib.protocol.codec.MinecraftCodecHelper;
import org.geysermc.mcprotocollib.protocol.codec.MinecraftPacket; import org.geysermc.mcprotocollib.protocol.codec.MinecraftPacket;
import org.geysermc.mcprotocollib.protocol.data.game.entity.player.HandPreference; 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.ChatVisibility;
import org.geysermc.mcprotocollib.protocol.data.game.setting.ParticleStatus;
import org.geysermc.mcprotocollib.protocol.data.game.setting.SkinPart; import org.geysermc.mcprotocollib.protocol.data.game.setting.SkinPart;
import java.util.ArrayList; import java.util.ArrayList;
@ -29,6 +30,7 @@ public class ServerboundClientInformationPacket implements MinecraftPacket {
* Whether the client permits being shown in server ping responses. * Whether the client permits being shown in server ping responses.
*/ */
private final boolean allowsListing; private final boolean allowsListing;
private final @NonNull ParticleStatus particleStatus;
public ServerboundClientInformationPacket(ByteBuf in, MinecraftCodecHelper helper) { public ServerboundClientInformationPacket(ByteBuf in, MinecraftCodecHelper helper) {
this.locale = helper.readString(in); this.locale = helper.readString(in);
@ -48,6 +50,7 @@ public class ServerboundClientInformationPacket implements MinecraftPacket {
this.mainHand = HandPreference.from(helper.readVarInt(in)); this.mainHand = HandPreference.from(helper.readVarInt(in));
this.textFilteringEnabled = in.readBoolean(); this.textFilteringEnabled = in.readBoolean();
this.allowsListing = in.readBoolean(); this.allowsListing = in.readBoolean();
this.particleStatus = ParticleStatus.from(helper.readVarInt(in));
} }
@Override @Override
@ -67,5 +70,6 @@ public class ServerboundClientInformationPacket implements MinecraftPacket {
helper.writeVarInt(out, this.mainHand.ordinal()); helper.writeVarInt(out, this.mainHand.ordinal());
out.writeBoolean(this.textFilteringEnabled); out.writeBoolean(this.textFilteringEnabled);
out.writeBoolean(allowsListing); out.writeBoolean(allowsListing);
helper.writeVarInt(out, this.particleStatus.ordinal());
} }
} }