Class PacketContextImpl
java.lang.Object
net.fabricmc.fabric.impl.networking.context.PacketContextImpl
- All Implemented Interfaces:
PacketContext
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface PacketContext
PacketContext.Key<T>, PacketContext.ReadKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PacketContext.Key<@NonNull net.minecraft.network.Connection> static final PacketContext.Key<com.mojang.authlib.GameProfile> static final PacketContext.Key<net.minecraft.core.RegistryAccess> static final PacketContext.Key<net.minecraft.server.MinecraftServer> static final ScopedValue<PacketContext> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> @Nullable Tget(PacketContext.ReadKey<T> key) Returns currently stored value.<T> voidset(PacketContext.Key<T> key, T value) Stores the value.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PacketContext
orElse, orElseThrow
-
Field Details
-
VALUE
-
SERVER_INSTANCE
-
REGISTRY_ACCESS
-
GAME_PROFILE
-
CONNECTION
-
-
Constructor Details
-
PacketContextImpl
public PacketContextImpl(net.minecraft.network.Connection connection)
-
-
Method Details
-
get
Description copied from interface:PacketContextReturns currently stored value.- Specified by:
getin interfacePacketContext- Parameters:
key- unique key under which value is stored- Returns:
- stored value or null if not set.
-
set
Description copied from interface:PacketContextStores the value.- Specified by:
setin interfacePacketContext- Parameters:
key- unique key under which value is storedvalue- value to store, if null it will remove it instead
-