Class PDLSavedData.Builder<T>

java.lang.Object
com.portingdeadmods.portingdeadlibs.api.data.saved.PDLSavedData.Builder<T>
Enclosing class:
PDLSavedData<T>

public static final class PDLSavedData.Builder<T> extends Object
  • Method Details

    • synced

      public PDLSavedData.Builder<T> synced(net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> streamCodec)
      Parameters:
      streamCodec - Encoder/Decoder
      Returns:
      Should sync on player login
    • preSync

      public PDLSavedData.Builder<T> preSync(Consumer<net.minecraft.world.entity.player.Player> preSyncFunction)
      The supplied method gets ran before saved data is synced. This method gets executed on both sides
    • postSync

      public PDLSavedData.Builder<T> postSync(Consumer<net.minecraft.world.entity.player.Player> postSyncFunction)
      The supplied method gets ran after saved data was synced. This method gets executed on both sides
    • global

      public PDLSavedData.Builder<T> global()
      Makes the saved data global, instead of dimension based
    • build

      public PDLSavedData<T> build()