Package baritone.api.cache
Interface ICachedWorld
public interface ICachedWorld
- Since:
- 9/24/2018
- Author:
- Brady
-
Method Summary
Modifier and TypeMethodDescriptionArrayList<net.minecraft.core.BlockPos> getLocationsOf(String block, int maximum, int centerX, int centerZ, int maxRegionDistanceSq) Scans the cached chunks for location of the specified special block.getRegion(int regionX, int regionZ) Returns the region at the specified region coordinatesbooleanisCached(int blockX, int blockZ) Returns whether or not the block at the specified X and Z coordinates is cached in this world.voidqueueForPacking(net.minecraft.world.level.chunk.LevelChunk chunk) Queues the specified chunk for packing.voidReloads all of the cached regions in this world from disk.voidsave()Saves all of the cached regions in this world to disk.
-
Method Details
-
getRegion
Returns the region at the specified region coordinates- Parameters:
regionX- The region X coordinateregionZ- The region Z coordinate- Returns:
- The region located at the specified coordinates
-
queueForPacking
Queues the specified chunk for packing. This entails reading the contents of the chunk, then packing the data into the 2-bit format, and storing that in this cached world.- Parameters:
chunk- The chunk to pack and store
-
isCached
Returns whether or not the block at the specified X and Z coordinates is cached in this world.- Parameters:
blockX- The block X coordinateblockZ- The block Z coordinate- Returns:
- Whether or not the specified XZ location is cached
-
getLocationsOf
ArrayList<net.minecraft.core.BlockPos> getLocationsOf(String block, int maximum, int centerX, int centerZ, int maxRegionDistanceSq) Scans the cached chunks for location of the specified special block. The information that is returned by this method may not be up to date, because older cached chunks can contain data that is much more likely to have changed.- Parameters:
block- The special block to search formaximum- The maximum number of position results to receivecenterX- The x block coordinate center of the searchcenterZ- The z block coordinate center of the searchmaxRegionDistanceSq- The maximum region distance, squared- Returns:
- The locations found that match the special block
-
reloadAllFromDisk
void reloadAllFromDisk()Reloads all of the cached regions in this world from disk. Anything that is not saved will be lost. This operation does not execute in a new thread by default. -
save
void save()Saves all of the cached regions in this world to disk. This operation does not execute in a new thread by default.
-