Class SimpleChannel.MessageBuilder<MSG>
- java.lang.Object
-
- net.minecraftforge.fml.network.simple.SimpleChannel.MessageBuilder<MSG>
-
- Enclosing class:
- SimpleChannel
public static class SimpleChannel.MessageBuilder<MSG> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SimpleChannel.MessageBuilder.ToBooleanBiFunction<T,U>
-
Field Summary
Fields Modifier and Type Field Description private SimpleChannel
channel
private java.util.function.BiConsumer<MSG,java.util.function.Supplier<NetworkEvent.Context>>
consumer
private java.util.function.Function<PacketBuffer,MSG>
decoder
private java.util.function.BiConsumer<MSG,PacketBuffer>
encoder
private int
id
private java.util.function.Function<MSG,java.lang.Integer>
loginIndexGetter
private java.util.function.BiConsumer<MSG,java.lang.Integer>
loginIndexSetter
private java.util.function.Function<java.lang.Boolean,java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,MSG>>>
loginPacketGenerators
private java.util.Optional<NetworkDirection>
networkDirection
private java.lang.Class<MSG>
type
-
Constructor Summary
Constructors Constructor Description MessageBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add()
SimpleChannel.MessageBuilder<MSG>
buildLoginPacketList(java.util.function.Function<java.lang.Boolean,java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,MSG>>> loginPacketGenerators)
SimpleChannel.MessageBuilder<MSG>
consumer(java.util.function.BiConsumer<MSG,java.util.function.Supplier<NetworkEvent.Context>> consumer)
SimpleChannel.MessageBuilder<MSG>
consumer(SimpleChannel.MessageBuilder.ToBooleanBiFunction<MSG,java.util.function.Supplier<NetworkEvent.Context>> handler)
Function returning a boolean "packet handled" indication, for simpler channel building.SimpleChannel.MessageBuilder<MSG>
decoder(java.util.function.Function<PacketBuffer,MSG> decoder)
SimpleChannel.MessageBuilder<MSG>
encoder(java.util.function.BiConsumer<MSG,PacketBuffer> encoder)
private static <MSG> SimpleChannel.MessageBuilder<MSG>
forType(SimpleChannel channel, java.lang.Class<MSG> type, int id, NetworkDirection networkDirection)
SimpleChannel.MessageBuilder<MSG>
loginIndex(java.util.function.Function<MSG,java.lang.Integer> loginIndexGetter, java.util.function.BiConsumer<MSG,java.lang.Integer> loginIndexSetter)
SimpleChannel.MessageBuilder<MSG>
markAsLoginPacket()
-
-
-
Field Detail
-
channel
private SimpleChannel channel
-
type
private java.lang.Class<MSG> type
-
id
private int id
-
encoder
private java.util.function.BiConsumer<MSG,PacketBuffer> encoder
-
decoder
private java.util.function.Function<PacketBuffer,MSG> decoder
-
consumer
private java.util.function.BiConsumer<MSG,java.util.function.Supplier<NetworkEvent.Context>> consumer
-
loginIndexGetter
private java.util.function.Function<MSG,java.lang.Integer> loginIndexGetter
-
loginIndexSetter
private java.util.function.BiConsumer<MSG,java.lang.Integer> loginIndexSetter
-
loginPacketGenerators
private java.util.function.Function<java.lang.Boolean,java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,MSG>>> loginPacketGenerators
-
networkDirection
private java.util.Optional<NetworkDirection> networkDirection
-
-
Method Detail
-
forType
private static <MSG> SimpleChannel.MessageBuilder<MSG> forType(SimpleChannel channel, java.lang.Class<MSG> type, int id, NetworkDirection networkDirection)
-
encoder
public SimpleChannel.MessageBuilder<MSG> encoder(java.util.function.BiConsumer<MSG,PacketBuffer> encoder)
-
decoder
public SimpleChannel.MessageBuilder<MSG> decoder(java.util.function.Function<PacketBuffer,MSG> decoder)
-
loginIndex
public SimpleChannel.MessageBuilder<MSG> loginIndex(java.util.function.Function<MSG,java.lang.Integer> loginIndexGetter, java.util.function.BiConsumer<MSG,java.lang.Integer> loginIndexSetter)
-
buildLoginPacketList
public SimpleChannel.MessageBuilder<MSG> buildLoginPacketList(java.util.function.Function<java.lang.Boolean,java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,MSG>>> loginPacketGenerators)
-
markAsLoginPacket
public SimpleChannel.MessageBuilder<MSG> markAsLoginPacket()
-
consumer
public SimpleChannel.MessageBuilder<MSG> consumer(java.util.function.BiConsumer<MSG,java.util.function.Supplier<NetworkEvent.Context>> consumer)
-
consumer
public SimpleChannel.MessageBuilder<MSG> consumer(SimpleChannel.MessageBuilder.ToBooleanBiFunction<MSG,java.util.function.Supplier<NetworkEvent.Context>> handler)
Function returning a boolean "packet handled" indication, for simpler channel building.- Parameters:
handler
- a handler- Returns:
- this
-
add
public void add()
-
-