Class WorldStoragesImpl
java.lang.Object
com.hammy275.immersivemc.server.storage.world.WorldStoragesImpl
- All Implemented Interfaces:
WorldStorages
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget
(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.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.static WorldStorage
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.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.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.static WorldStorage
removeS
(net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerLevel level) Remove the WorldStorage at the given location.
-
Field Details
-
INSTANCE
-
-
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 interfaceWorldStorages
- 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 interfaceWorldStorages
- 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 interfaceWorldStorages
- 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 interfaceWorldStorages
- 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 interfaceWorldStorages
- Parameters:
level
- Level that had a WorldStorage change.
-