All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.magistuarmory.network.PacketBetterCombatOrEpicFightInstalled Maven / Gradle / Ivy

There is a newer version: 8.10
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy