Package net.nullved.pmweatherapi.network
Class S2CStoragePacket<C extends IClientStorage<?>>
java.lang.Object
net.nullved.pmweatherapi.network.S2CStoragePacket<C>
- Type Parameters:
C- TheIClientStoragethat will be synced to
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
- Direct Known Subclasses:
S2CMetarPacket,S2CRadarPacket,S2CWSRPacket
public abstract class S2CStoragePacket<C extends IClientStorage<?>>
extends Object
implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
A base packet for the Storages system that syncs data from the Server -> Client (S2C)
- Since:
- 0.15.3.3
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B extends net.minecraft.network.FriendlyByteBuf>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B extends net.minecraft.network.FriendlyByteBuf,T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionS2CStoragePacket(net.minecraft.nbt.CompoundTag tag) S2CStoragePacket(net.minecraft.network.RegistryFriendlyByteBuf buf) Creates a newS2CStoragePacketfrom aRegistryFriendlyByteBuf -
Method Summary
Modifier and TypeMethodDescriptionabstract CGets theIClientStoragethat will be synced to.voidhandle(net.minecraft.world.entity.player.Player player) Handles the packet on the CLIENT SIDEnet.minecraft.nbt.CompoundTagtag()Gets theCompoundTagsend with the packetvoidwrite(net.minecraft.network.FriendlyByteBuf buf) Writes the data into the givenFriendlyByteBufMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound, type
-
Field Details
-
tag
public net.minecraft.nbt.CompoundTag tag
-
-
Constructor Details
-
S2CStoragePacket
public S2CStoragePacket(net.minecraft.nbt.CompoundTag tag) -
S2CStoragePacket
public S2CStoragePacket(net.minecraft.network.RegistryFriendlyByteBuf buf) Creates a newS2CStoragePacketfrom aRegistryFriendlyByteBuf- Parameters:
buf- TheRegistryFriendlyByteBufto read aCompoundTagfrom- Since:
- 0.15.3.3
-
-
Method Details
-
getStorage
Gets theIClientStoragethat will be synced to.- Returns:
- The storage to be synced.
- Since:
- 0.15.3.3
-
tag
public net.minecraft.nbt.CompoundTag tag()Gets theCompoundTagsend with the packet- Returns:
- The packet data
- Since:
- 0.15.3.3
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) Writes the data into the givenFriendlyByteBuf- Parameters:
buf- TheFriendlyByteBufto write into- Since:
- 0.15.3.3
-
handle
public void handle(net.minecraft.world.entity.player.Player player) Handles the packet on the CLIENT SIDE- Parameters:
player- The player the packet was sent to- Since:
- 0.15.3.3
-