Package net.nullved.pmweatherapi.network
Class PMWNetworking
java.lang.Object
net.nullved.pmweatherapi.network.PMWNetworking
The base networking class for PMWeatherAPI
- Since:
- 0.14.15.3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidRegisters all of PMWeatherAPI's packets.static <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload,B extends net.minecraft.network.FriendlyByteBuf>
voidregisterClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) Registers a clientbound packet payloadstatic <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
voidregisterServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) Registers a serverbound packet payloadstatic voidserverSendRadarsToAll(net.minecraft.nbt.CompoundTag tag) Sends all radars to all clientsstatic voidserverSendRadarsToPlayer(net.minecraft.nbt.CompoundTag tag, net.minecraft.world.entity.player.Player player) Sends all radars to a specific player
-
Field Details
-
RADARS_ID
public static final net.minecraft.resources.ResourceLocation RADARS_ID
-
-
Constructor Details
-
PMWNetworking
public PMWNetworking()
-
-
Method Details
-
register
Registers all of PMWeatherAPI's packets. Should not be called- Parameters:
args- The arguments to pass- Since:
- 0.14.15.3
-
registerServerboundPacket
public static <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> void registerServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) Registers a serverbound packet payload- Type Parameters:
T- A packet extendingCustomPacketPayload- Parameters:
type- TheCustomPacketPayload.Typeof the packetcodec- TheStreamCodecfor the packethandler- The handle method for the packetargs- Additional arguments. args[0] should be thePayloadRegistrar- Since:
- 0.14.15.3
-
registerClientboundPacket
public static <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload,B extends net.minecraft.network.FriendlyByteBuf> void registerClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec, BiConsumer<T, net.minecraft.world.entity.player.Player> handler, Object... args) Registers a clientbound packet payload- Type Parameters:
T- A packet extendingCustomPacketPayload- Parameters:
type- TheCustomPacketPayload.Typeof the packetcodec- TheStreamCodecfor the packethandler- The handle method for the packetargs- Additional arguments. args[0] should be thePayloadRegistrar- Since:
- 0.14.15.3
-
serverSendRadarsToAll
public static void serverSendRadarsToAll(net.minecraft.nbt.CompoundTag tag) Sends all radars to all clients- Parameters:
tag- The tag to send, generated by theRadarServerStorage- Since:
- 0.14.15.3
-
serverSendRadarsToPlayer
public static void serverSendRadarsToPlayer(net.minecraft.nbt.CompoundTag tag, net.minecraft.world.entity.player.Player player) Sends all radars to a specific player- Parameters:
tag- The tag to send, generated by theRadarServerStorage- Since:
- 0.14.15.3
-