List of usage examples for net.minecraftforge.fml.network NetworkDirection PLAY_TO_SERVER
NetworkDirection PLAY_TO_SERVER
To view the source code for net.minecraftforge.fml.network NetworkDirection PLAY_TO_SERVER.
Click Source Link
From source file:com.teambrmodding.assistedprogression.network.packet.NotifyServerOfTrashBagChanges.java
License:Creative Commons License
/******************************************************************************************************************* * IMessageHandler * *******************************************************************************************************************/ public static void process(NotifyServerOfTrashBagChanges message, Supplier<NetworkEvent.Context> ctx) { if (ctx.get().getDirection() == NetworkDirection.PLAY_TO_SERVER) { ServerPlayerEntity player = ctx.get().getSender(); if (player.openContainer instanceof TrashBagContainer) { TrashBagContainer container = (TrashBagContainer) player.openContainer; container.trashBag.setTag(message.tag); container.detectAndSendChanges(); }//from www . j ava 2s.c o m ctx.get().setPacketHandled(true); } }