Package com.fastasyncworldedit.core.util
Class CachedTextureUtil
java.lang.Object
com.fastasyncworldedit.core.util.TextureUtil
com.fastasyncworldedit.core.util.DelegateTextureUtil
com.fastasyncworldedit.core.util.CachedTextureUtil
- All Implemented Interfaces:
TextureHolder
- Direct Known Subclasses:
RandomTextureUtil
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fastasyncworldedit.core.util.TextureUtil
TextureUtil.BiomeColor -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<Integer> protected final it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType> protected final it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType[]> protected final TextureUtilFields inherited from class com.fastasyncworldedit.core.util.TextureUtil
blockColors, blockDistance, distances, validBiomes, validBlockIds, validColors, validLayerBlocks, validLayerColors, validMixBiomeColors, validMixBiomeIds -
Constructor Summary
ConstructorsModifierConstructorDescriptionCachedTextureUtil(TextureUtil parent) protectedCachedTextureUtil(TextureUtil parent, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType> colorBlockMap, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<Integer> colorBiomeMap, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType[]> colorLayerMap) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionfork()Create a copy of thisTextureUtilinstance if required for thread safety.getNearestBiome(int color) Get the biome most closely matching a color based on the block's average colorgetNearestBlock(int color) Get the block most closely matching a color based on the block's average colorgetNearestLayer(int color) Returns the block combined ids as an array.Methods inherited from class com.fastasyncworldedit.core.util.DelegateTextureUtil
calculateLayerArrays, getBiome, getBiomeMix, getColor, getColor, getDarkerBlock, getDarkerBlock, getFolder, getIsBlockCloserThanBiome, getLighterBlock, getLighterBlock, getNearestBlock, getNearestBlock, getNextNearestBlock, hasAlpha, loadModTexturesMethods inherited from class com.fastasyncworldedit.core.util.TextureUtil
averageColor, averageColor, colorDistance, combineTransparency, fromBlocks, fromClipboard, fromMask, getTextureUtil, getValidBlockIds, hueDistance, multiplyColor
-
Field Details
-
parent
-
colorBlockMap
-
colorBiomeMap
-
colorLayerMap
protected final transient it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType[]> colorLayerMap
-
-
Constructor Details
-
CachedTextureUtil
- Throws:
FileNotFoundException
-
CachedTextureUtil
protected CachedTextureUtil(TextureUtil parent, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType> colorBlockMap, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<Integer> colorBiomeMap, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType[]> colorLayerMap) throws FileNotFoundException Create a new instance- Parameters:
parent- parentTextureUtilcolorBlockMap- color block map to (copy and) usecolorBiomeMap- color biome map to (copy and) usecolorLayerMap- color layer map to (copy and) use- Throws:
FileNotFoundException- Since:
- 2.13.0
-
-
Method Details
-
fork
Description copied from class:TextureUtilCreate a copy of thisTextureUtilinstance if required for thread safety.- Overrides:
forkin classDelegateTextureUtil- Returns:
- either this
TextureUtilinstance if thread safe or a new copied instance.
-
getNearestLayer
Description copied from class:TextureUtilReturns the block combined ids as an array.- Overrides:
getNearestLayerin classDelegateTextureUtil
-
getNearestBiome
Description copied from class:TextureUtilGet the biome most closely matching a color based on the block's average color- Overrides:
getNearestBiomein classDelegateTextureUtil- Parameters:
color- color to match- Returns:
- matching block
-
getNearestBlock
Description copied from class:TextureUtilGet the block most closely matching a color based on the block's average color- Overrides:
getNearestBlockin classDelegateTextureUtil- Parameters:
color- color to match- Returns:
- matching block
-