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

45 lines
1.4 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 ServerboundContainerClosePacket
implements Packet<ServerGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundContainerClosePacket> STREAM_CODEC = Packet.codec(ServerboundContainerClosePacket::write, ServerboundContainerClosePacket::new);
private final int containerId;
public ServerboundContainerClosePacket(int containerId) {
this.containerId = containerId;
}
private ServerboundContainerClosePacket(FriendlyByteBuf input) {
this.containerId = input.readContainerId();
}
private void write(FriendlyByteBuf output) {
output.writeContainerId(this.containerId);
}
@Override
public PacketType<ServerboundContainerClosePacket> type() {
return GamePacketTypes.SERVERBOUND_CONTAINER_CLOSE;
}
@Override
public void handle(ServerGamePacketListener listener) {
listener.handleContainerClose(this);
}
public int getContainerId() {
return this.containerId;
}
}