Class WorldStoragesImpl

java.lang.Object
com.hammy275.immersivemc.server.storage.world.WorldStoragesImpl
All Implemented Interfaces:
WorldStorages

public class WorldStoragesImpl extends Object implements WorldStorages
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final WorldStorages
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Gets the WorldStorage already present at the given location.
    getOrCreate(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Gets the WorldStorage at the given location, or creates a new one if not found or the one found isn't of the expected type for the block.
    getOrCreateS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Gets the WorldStorage at the given location, or creates a new one if needed.
    getS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Gets the WorldStorage already present at the given location.
    getWithoutVerification(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Gets the WorldStorage already present at the given location even if it doesn't match the present block.
    getWithoutVerificationS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Gets the WorldStorage already present at the given location even if it doesn't match the present block.
    void
    markDirty(net.minecraft.server.level.ServerLevel level)
    Marks the WorldStorage for the given level as dirty, meaning on next world save, the WorldStorage instances will be saved.
    static void
    markDirtyS(net.minecraft.server.level.ServerLevel level)
    Marks the WorldStorage for the given level as dirty, meaning on next world save, the WorldStorage instances will be saved.
    remove(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Remove the WorldStorage at the given location.
    removeS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
    Remove the WorldStorage at the given location.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • WorldStoragesImpl

      public WorldStoragesImpl()
  • Method Details

    • getOrCreateS

      public static WorldStorage getOrCreateS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Gets the WorldStorage at the given location, or creates a new one if needed.
      Parameters:
      pos - Position of block with a WorldStorage and/or associated with a handler.
      level - Level the block is in.
      Returns:
      A WorldStorage instance for the given block position, or null if the block isn't associated with any WorldStorageHandler instances.
    • getS

      public static WorldStorage getS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Gets the WorldStorage already present at the given location.
      Parameters:
      pos - Position of block with a WorldStorage and/or associated with a handler.
      level - Level the block is in.
      Returns:
      A WorldStorage instance for the given block position, or null if the block isn't associated with any WorldStorageHandler instances or if there isn't a WorldStorage already there.
    • getWithoutVerificationS

      public static WorldStorage getWithoutVerificationS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Gets the WorldStorage already present at the given location even if it doesn't match the present block.
      Parameters:
      pos - Position of block with a WorldStorage and/or associated with a handler.
      level - Level the block is in.
      Returns:
      A WorldStorage instance for the given block position, or null if the block isn't associated with any WorldStorageHandler instances or if there isn't a WorldStorage already there.
    • removeS

      public static WorldStorage removeS(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Remove the WorldStorage at the given location.
      Parameters:
      pos - Position of block potentially with a WorldStorage.
      level - Level the block is in.
      Returns:
      The WorldStorage instance that was removed, or null if nothing was removed.
    • markDirtyS

      public static void markDirtyS(net.minecraft.server.level.ServerLevel level)
      Marks the WorldStorage for the given level as dirty, meaning on next world save, the WorldStorage instances will be saved.
      Parameters:
      level - Level that had a WorldStorage change.
    • getOrCreate

      public WorldStorage getOrCreate(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Description copied from interface: WorldStorages
      Gets the WorldStorage at the given location, or creates a new one if not found or the one found isn't of the expected type for the block.
      Specified by:
      getOrCreate in interface WorldStorages
      Parameters:
      pos - Position of block with a WorldStorage and/or associated with a handler.
      level - Level the block is in.
      Returns:
      A WorldStorage instance for the given block position, or null if the block isn't associated with any WorldStorageHandler instances.
    • get

      public WorldStorage get(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Description copied from interface: WorldStorages
      Gets the WorldStorage already present at the given location.
      Specified by:
      get in interface WorldStorages
      Parameters:
      pos - Position of block with a WorldStorage and/or associated with a handler.
      level - Level the block is in.
      Returns:
      A WorldStorage instance for the given block position, or null if the block isn't associated with any WorldStorageHandler instances or if there isn't a WorldStorage already there.
    • getWithoutVerification

      public WorldStorage getWithoutVerification(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Description copied from interface: WorldStorages
      Gets the WorldStorage already present at the given location even if it doesn't match the present block.
      Specified by:
      getWithoutVerification in interface WorldStorages
      Parameters:
      pos - Position of block with a WorldStorage and/or associated with a handler.
      level - Level the block is in.
      Returns:
      A WorldStorage instance for the given block position, or null if the block isn't associated with any WorldStorageHandler instances or if there isn't a WorldStorage already there.
    • remove

      public WorldStorage remove(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level)
      Description copied from interface: WorldStorages
      Remove the WorldStorage at the given location.
      Specified by:
      remove in interface WorldStorages
      Parameters:
      pos - Position of block potentially with a WorldStorage.
      level - Level the block is in.
      Returns:
      The WorldStorage instance that was removed, or null if nothing was removed.
    • markDirty

      public void markDirty(net.minecraft.server.level.ServerLevel level)
      Description copied from interface: WorldStorages
      Marks the WorldStorage for the given level as dirty, meaning on next world save, the WorldStorage instances will be saved.
      Specified by:
      markDirty in interface WorldStorages
      Parameters:
      level - Level that had a WorldStorage change.