Example usage for net.minecraftforge.fml.network NetworkDirection PLAY_TO_CLIENT

List of usage examples for net.minecraftforge.fml.network NetworkDirection PLAY_TO_CLIENT

Introduction

In this page you can find the example usage for net.minecraftforge.fml.network NetworkDirection PLAY_TO_CLIENT.

Prototype

NetworkDirection PLAY_TO_CLIENT

To view the source code for net.minecraftforge.fml.network NetworkDirection PLAY_TO_CLIENT.

Click Source Link

Usage

From source file:com.teambrmodding.assistedprogression.network.packet.ReadGrinderRecipePacket.java

License:Creative Commons License

/*******************************************************************************************************************
 * IMessageHandler                                                                                                 *
 *******************************************************************************************************************/

public static void process(ReadGrinderRecipePacket message, Supplier<NetworkEvent.Context> ctx) {
    if (ctx.get().getDirection() == NetworkDirection.PLAY_TO_CLIENT) {
        ctx.get().enqueueWork(() -> {
            RecipeHelper.grinderRecipes.clear();
            RecipeHelper.grinderRecipes.addAll(message.recipes);
        });//from  www. j  a  v a2  s  .com
        ctx.get().setPacketHandled(true);
    }
}