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 SummaryNested classes/interfaces inherited from class com.fastasyncworldedit.core.util.TextureUtilTextureUtil.BiomeColor
- 
Field SummaryFieldsModifier 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.TextureUtilblockColors, blockDistance, distances, validBiomes, validBlockIds, validColors, validLayerBlocks, validLayerColors, validMixBiomeColors, validMixBiomeIds
- 
Constructor SummaryConstructorsModifierConstructorDescriptionCachedTextureUtil(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 SummaryModifier 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.DelegateTextureUtilcalculateLayerArrays, getBiome, getBiomeMix, getColor, getColor, getDarkerBlock, getDarkerBlock, getFolder, getIsBlockCloserThanBiome, getLighterBlock, getLighterBlock, getNearestBlock, getNearestBlock, getNextNearestBlock, hasAlpha, loadModTexturesMethods inherited from class com.fastasyncworldedit.core.util.TextureUtilaverageColor, averageColor, colorDistance, combineTransparency, fromBlocks, fromClipboard, fromMask, getTextureUtil, getValidBlockIds, hueDistance, multiplyColor
- 
Field Details- 
parent
- 
colorBlockMap
- 
colorBiomeMap
- 
colorLayerMapprotected final transient it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<BlockType[]> colorLayerMap
 
- 
- 
Constructor Details- 
CachedTextureUtil- Throws:
- FileNotFoundException
 
- 
CachedTextureUtilprotected 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- parent- TextureUtil
- colorBlockMap- color block map to (copy and) use
- colorBiomeMap- color biome map to (copy and) use
- colorLayerMap- color layer map to (copy and) use
- Throws:
- FileNotFoundException
- Since:
- 2.13.0
 
 
- 
- 
Method Details- 
forkDescription copied from class:TextureUtilCreate a copy of thisTextureUtilinstance if required for thread safety.- Overrides:
- forkin class- DelegateTextureUtil
- Returns:
- either this TextureUtilinstance if thread safe or a new copied instance.
 
- 
getNearestLayerDescription copied from class:TextureUtilReturns the block combined ids as an array.- Overrides:
- getNearestLayerin class- DelegateTextureUtil
 
- 
getNearestBiomeDescription copied from class:TextureUtilGet the biome most closely matching a color based on the block's average color- Overrides:
- getNearestBiomein class- DelegateTextureUtil
- Parameters:
- color- color to match
- Returns:
- matching block
 
- 
getNearestBlockDescription copied from class:TextureUtilGet the block most closely matching a color based on the block's average color- Overrides:
- getNearestBlockin class- DelegateTextureUtil
- Parameters:
- color- color to match
- Returns:
- matching block
 
 
-