Example usage for net.minecraftforge.fml.network PacketDistributor PLAYER

List of usage examples for net.minecraftforge.fml.network PacketDistributor PLAYER

Introduction

In this page you can find the example usage for net.minecraftforge.fml.network PacketDistributor PLAYER.

Prototype

PacketDistributor PLAYER

To view the source code for net.minecraftforge.fml.network PacketDistributor PLAYER.

Click Source Link

Document

Send to the player specified in the Supplier
#with(Supplier) Player

Usage

From source file:com.teambrmodding.assistedprogression.managers.EventManager.java

License:Creative Commons License

@SuppressWarnings("unchecked")
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
    PlayerEntity player = event.getPlayer();
    if (player instanceof ServerPlayerEntity)
        PacketManager.INSTANCE.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) event.getPlayer()),
                new ReadGrinderRecipePacket());
}