Interface IServerStorage<D extends IStorageData>

All Superinterfaces:
IStorage<D>
All Known Subinterfaces:
ISyncServerStorage<D>
All Known Implementing Classes:
MetarServerStorage, RadarServerStorage, WSRServerStorage

public interface IServerStorage<D extends IStorageData> extends IStorage<D>
The Server Storage interface. There is a IServerStorage for each dimension of a save
You should only create a IServerStorage for a level once, instead, use PMWStorages if built-in or a custom storage handler.
Since:
0.15.3.3
  • Method Details

    • getLevel

      net.minecraft.server.level.ServerLevel getLevel()
      Gets the level associated with this IServerStorage
      Specified by:
      getLevel in interface IStorage<D extends IStorageData>
      Returns:
      A ServerLevel
      Since:
      0.15.3.3
    • packet

      S2CStoragePacket<? extends IClientStorage<D>> packet(net.minecraft.nbt.CompoundTag tag)
      Generates a S2CStoragePacket to be sent to the client
      Parameters:
      tag - The CompoundTag to be sent
      Returns:
      A S2CStoragePacket instance
      Since:
      0.15.3.3
    • syncAllToAll

      default void syncAllToAll()
      Syncs all IStorageData to all players
      Since:
      0.15.3.3
    • syncAllToPlayer

      default void syncAllToPlayer(net.minecraft.world.entity.player.Player player)
      Syncs all IStorageData from the storage to the given player
      Parameters:
      player - The Player to sync all data to
      Since:
      0.15.3.3
    • syncAdd

      default void syncAdd(D data)
      Syncs new IStorageData to all clients
      Parameters:
      data - The new IStorageData
      Since:
      0.15.3.3
    • syncAdd

      default void syncAdd(Collection<D> datum)
      Syncs multiple new IStorageData to all clients
      Parameters:
      datum - A Collection of IStorageData to sync
      Since:
      0.15.3.3
    • syncRemove

      default void syncRemove(net.minecraft.core.BlockPos pos)
      Syncs a BlockPos removal to all clients
      Parameters:
      pos - The BlockPos of the radar to remove
      Since:
      0.15.3.3
    • syncRemoveByPos

      default void syncRemoveByPos(Collection<net.minecraft.core.BlockPos> posList)
      Syncs multiple BlockPos removals to all clients
      Parameters:
      posList - A Collection of BlockPos to sync
      Since:
      0.15.3.3
    • syncRemove

      default void syncRemove(D data)
      Syncs a IStorageData removal to all clients
      Parameters:
      data - The IStorageData of the radar to remove
      Since:
      0.15.3.3
    • syncRemoveByData

      default void syncRemoveByData(Collection<D> datum)
      Syncs multiple IStorageData removals to all clients
      Parameters:
      datum - A Collection of IStorageData to sync
      Since:
      0.15.3.3