minecraft_25w45a_unobfuscated/net/minecraft/server/network/config/ServerCodeOfConductConfigurationTask.java
2025-11-24 22:52:51 +03:00

32 lines
967 B
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.server.network.config;
import java.util.function.Consumer;
import java.util.function.Supplier;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.configuration.ClientboundCodeOfConductPacket;
import net.minecraft.server.network.ConfigurationTask;
public class ServerCodeOfConductConfigurationTask
implements ConfigurationTask {
public static final ConfigurationTask.Type TYPE = new ConfigurationTask.Type("server_code_of_conduct");
private final Supplier<String> codeOfConduct;
public ServerCodeOfConductConfigurationTask(Supplier<String> codeOfConduct) {
this.codeOfConduct = codeOfConduct;
}
@Override
public void start(Consumer<Packet<?>> connection) {
connection.accept(new ClientboundCodeOfConductPacket(this.codeOfConduct.get()));
}
@Override
public ConfigurationTask.Type type() {
return TYPE;
}
}