Class PDLSavedData<T>
java.lang.Object
com.portingdeadmods.portingdeadlibs.api.data.saved.PDLSavedData<T>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> PDLSavedData.Builder<T> com.mojang.serialization.Codec<T> codec()getData(net.minecraft.world.level.Level level) booleanisGlobal()booleanisSynced()Consumer<net.minecraft.world.entity.player.Player> Consumer<net.minecraft.world.entity.player.Player> voidnet.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> voidsync(net.minecraft.world.level.Level level) voidsyncToPlayer(net.minecraft.server.level.ServerPlayer player)
-
Method Details
-
codec
-
streamCodec
public net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> streamCodec() -
defaultValueSupplier
-
preSyncFunction
-
postSyncFunction
-
isGlobal
public boolean isGlobal() -
isSynced
public boolean isSynced()- Returns:
- If it is synced to the player on load
-
syncToPlayer
public void syncToPlayer(net.minecraft.server.level.ServerPlayer player) -
sync
public void sync(net.minecraft.world.level.Level level) -
setData
-
getData
-
builder
public static <T> PDLSavedData.Builder<T> builder(com.mojang.serialization.Codec<T> codec, Supplier<T> defaultValueSupplier)
-