Class WorldStoragesImpl
java.lang.Object
com.hammy275.immersivemc.server.storage.world.WorldStoragesImpl
- All Implemented Interfaces:
WorldStorages
-
Field Summary
Fields -
Constructor Summary
Constructors -
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 WorldStoragegetOrCreateS(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 WorldStoragegetS(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 WorldStoragegetWithoutVerificationS(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.voidmarkDirty(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 voidmarkDirtyS(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 WorldStorageremoveS(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:WorldStoragesGets 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:
getOrCreatein 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:WorldStoragesGets the WorldStorage already present at the given location.- Specified by:
getin 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:WorldStoragesGets the WorldStorage already present at the given location even if it doesn't match the present block.- Specified by:
getWithoutVerificationin 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:WorldStoragesRemove the WorldStorage at the given location.- Specified by:
removein 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:WorldStoragesMarks the WorldStorage for the given level as dirty, meaning on next world save, the WorldStorage instances will be saved.- Specified by:
markDirtyin interfaceWorldStorages- Parameters:
level- Level that had a WorldStorage change.
-