Package com.fastasyncworldedit.core
Enum Class FaweCache
- All Implemented Interfaces:
Trimable,Serializable,Comparable<FaweCache>,Constable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHolds data for a palette used in a chunk sectionNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FaweExceptionstatic final FaweBlockBagExceptionfinal CleanableThreadLocal<long[]> final CleanableThreadLocal<int[]> final intfinal CleanableThreadLocal<byte[]> final char[]static final FaweCacheDeprecated, for removal: This API element is subject to removal in a future version.final CleanableThreadLocal<int[]> static final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionstatic final FaweExceptionfinal CleanableThreadLocal<int[]> final CleanableThreadLocal<char[]> static final FaweExceptionfinal CleanableThreadLocal<char[]> final CleanableThreadLocal<int[]> -
Method Summary
Modifier and TypeMethodDescriptionasTag(byte value) asTag(byte[] value) asTag(double value) asTag(float value) asTag(int value) asTag(int[] value) asTag(long value) asTag(long[] value) asTag(short value) asTag(Collection values) <T,V> com.google.common.cache.LoadingCache <T, V> createCache(Function<T, V> withInitial) <T,V> com.google.common.cache.LoadingCache <T, V> createCache(Supplier<V> withInitial) <V> LongFunction<V> createMainThreadSafeCache(Supplier<V> withInitial) Create a new cache aimed to act as a thread-cache that is safe to the main server thread.Create a new blocking executor with default name and FaweCache loggernewBlockingExecutor(String name) Create a new blocking executor with specified name and FaweCache loggernewBlockingExecutor(String name, Logger logger) Create a new blocking executor with specified name and loggerregisterPool(Class<T> clazz, Supplier<T> cache, boolean buffer) toPalette(int layerOffset, char[] blocks) Convert raw char array to palettetoPalette(int layerOffset, int[] blocks) Convert raw int array to palettetoPaletteUnstretched(int layerOffset, char[] blocks) Convert raw int array to unstretched palette (1.16)booleantrim(boolean aggressive) Trims the object, reducing its memory footprint.static FaweCacheReturns the enum constant of this class with the specified name.static FaweCache[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
- Since:
- 2.0.0
-
-
Field Details
-
IMP
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCEto get an instance. -
BLOCKS_PER_LAYER
public final int BLOCKS_PER_LAYER- See Also:
-
EMPTY_CHAR_4096
public final char[] EMPTY_CHAR_4096 -
BLOCK_BAG
-
MANUAL
-
NO_REGION
-
OUTSIDE_REGION
-
OUTSIDE_SAFE_REGION
-
MAX_CHECKS
-
MAX_FAILS
-
MAX_CHANGES
-
LOW_MEMORY
-
MAX_ENTITIES
-
MAX_TILES
-
MAX_ITERATIONS
-
PLAYER_ONLY
-
ACTOR_REQUIRED
-
CHUNK_FLAG
-
BYTE_BUFFER_8192
-
BLOCK_TO_PALETTE
-
SECTION_BITS_TO_CHAR
-
PALETTE_TO_BLOCK
-
PALETTE_TO_BLOCK_CHAR
-
BLOCK_STATES
-
SECTION_BLOCKS
-
INDEX_STORE
-
MUTABLE_BLOCKVECTOR3
-
MUTABLE_VECTOR3
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
trim
public boolean trim(boolean aggressive) Description copied from interface:TrimableTrims the object, reducing its memory footprint. -
registerPool
-
createCache
-
createCache
-
createMainThreadSafeCache
Create a new cache aimed to act as a thread-cache that is safe to the main server thread. If the method is called away from the main thread, it will return aFunctionreferencing theLoadingCachereturned bycreateCache(Supplier). If it is called from the main thread, it will return aFunctionthat will always return the result of the givenSupplier. It is designed to prevent issues caused by internally-mutable and resettable classes such asCharFilterBlockfrom causing issues when used in edits on the main thread. This method is designed for specific internal use. -
toPalette
Convert raw char array to palette- Returns:
- palette
-
toPalette
Convert raw int array to palette- Returns:
- palette
-
toPaletteUnstretched
Convert raw int array to unstretched palette (1.16)- Returns:
- palette
-
asMap
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
asTag
-
newBlockingExecutor
Create a new blocking executor with default name and FaweCache logger- Returns:
- new blocking executor
-
newBlockingExecutor
Create a new blocking executor with specified name and FaweCache logger- Returns:
- new blocking executor
- Since:
- 2.9.0
-
newBlockingExecutor
Create a new blocking executor with specified name and logger- Returns:
- new blocking executor
- Since:
- 2.9.0
-
INSTANCEto get an instance.