com.magistuarmory.network.PacketBetterCombatOrEpicFightInstalled Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of 1.20.2-epic-knights-common Show documentation
Show all versions of 1.20.2-epic-knights-common Show documentation
mod that adds medieval stuff to the game
package com.magistuarmory.network;
import com.magistuarmory.EpicKnights;
import dev.architectury.networking.NetworkManager;
import io.netty.buffer.Unpooled;
import net.minecraft.class_2540;
import net.minecraft.class_2960;
import net.minecraft.class_3222;
public class PacketBetterCombatOrEpicFightInstalled
{
public static final class_2960 ID = new class_2960(EpicKnights.ID, "packet_bc_or_ef_installed");
public static void sendToPlayer(class_3222 player)
{
NetworkManager.sendToPlayer(player, ID, PacketBetterCombatOrEpicFightInstalled.encode(EpicKnights.BC_or_EF_installed));
}
static class_2540 encode(boolean bcorefinstalled)
{
class_2540 buf = new class_2540(Unpooled.buffer());
buf.method_52964(bcorefinstalled);
return buf;
}
public static void apply(class_2540 buf, NetworkManager.PacketContext context)
{
boolean bcorefinstalled = buf.readBoolean();
context.queue(() -> execute(bcorefinstalled));
}
static void execute(boolean bcorefinstalled)
{
EpicKnights.BC_or_EF_installed = bcorefinstalled;
}
}