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 TextureUtil
Fields inherited from class com.fastasyncworldedit.core.util.TextureUtil
blockColors, blockDistance, distances, validBiomes, validBlockIds, validColors, validLayerBlocks, validLayerColors, validMixBiomeColors, validMixBiomeIds
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCachedTextureUtil
(TextureUtil parent) 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) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionfork()
Create a copy of thisTextureUtil
instance 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, loadModTextures
Methods 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
- parentTextureUtil
colorBlockMap
- 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:TextureUtil
Create a copy of thisTextureUtil
instance if required for thread safety.- Overrides:
fork
in classDelegateTextureUtil
- Returns:
- either this
TextureUtil
instance if thread safe or a new copied instance.
-
getNearestLayer
Description copied from class:TextureUtil
Returns the block combined ids as an array.- Overrides:
getNearestLayer
in classDelegateTextureUtil
-
getNearestBiome
Description copied from class:TextureUtil
Get the biome most closely matching a color based on the block's average color- Overrides:
getNearestBiome
in classDelegateTextureUtil
- Parameters:
color
- color to match- Returns:
- matching block
-
getNearestBlock
Description copied from class:TextureUtil
Get the block most closely matching a color based on the block's average color- Overrides:
getNearestBlock
in classDelegateTextureUtil
- Parameters:
color
- color to match- Returns:
- matching block
-