minecraft_25w45a_unobfuscated/net/minecraft/network/protocol/game/ServerboundSetCarriedItemPacket.java
2025-11-24 22:52:51 +03:00

45 lines
1.3 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.network.protocol.game;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketType;
import net.minecraft.network.protocol.game.GamePacketTypes;
import net.minecraft.network.protocol.game.ServerGamePacketListener;
public class ServerboundSetCarriedItemPacket
implements Packet<ServerGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundSetCarriedItemPacket> STREAM_CODEC = Packet.codec(ServerboundSetCarriedItemPacket::write, ServerboundSetCarriedItemPacket::new);
private final int slot;
public ServerboundSetCarriedItemPacket(int slot) {
this.slot = slot;
}
private ServerboundSetCarriedItemPacket(FriendlyByteBuf input) {
this.slot = input.readShort();
}
private void write(FriendlyByteBuf output) {
output.writeShort(this.slot);
}
@Override
public PacketType<ServerboundSetCarriedItemPacket> type() {
return GamePacketTypes.SERVERBOUND_SET_CARRIED_ITEM;
}
@Override
public void handle(ServerGamePacketListener listener) {
listener.handleSetCarriedItem(this);
}
public int getSlot() {
return this.slot;
}
}