Package com.fastasyncworldedit.core.util
Class TextureUtil
java.lang.Object
com.fastasyncworldedit.core.util.TextureUtil
- All Implemented Interfaces:
TextureHolder
- Direct Known Subclasses:
CleanTextureUtil
,DelegateTextureUtil
,FilteredTextureUtil
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected int[]
protected long[]
protected long[]
protected TextureUtil.BiomeColor[]
https://github.com/erich666/Mineways/blob/master/Win/biomes.cppprotected int[]
protected int[]
protected int[][]
protected int[]
protected int[]
protected long[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
averageColor
(int... colors) Combine multiple colors by multiplingstatic int
averageColor
(int c1, int c2) Combine two colors by averagingprotected void
protected static long
colorDistance
(int c1, int c2) static int
combineTransparency
(int top, int bottom) Assumes the top layer is a transparent color and the bottom is opaquestatic TextureUtil
fromBlocks
(Set<BlockType> blocks) static TextureUtil
fromClipboard
(Clipboard clipboard) static TextureUtil
getBiome
(int biome) Get theTextureUtil.BiomeColor
entry from a biome's IDprotected int
getBiomeMix
(int[] biomeIdsOutput, int color) int
Get the integer representation of a biomes's RGBA color when applied to grass.int
Get the integer representation of a block's RGBA color.getDarkerBlock
(int color) Get the next darkest blockgetDarkerBlock
(BlockType block) Get the next darkest blockprotected File
protected boolean
getIsBlockCloserThanBiome
(char[] blockAndBiomeIdOutput, int color, int biomePriority) getLighterBlock
(int color) Get the next lightest blockgetLighterBlock
(BlockType block) Get the next lightest blockgetNearestBiome
(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 colorprotected BlockType
getNearestBlock
(int color, boolean darker) protected BlockType
getNearestBlock
(BlockType block, boolean darker) getNearestLayer
(int color) Returns the block combined ids as an array.getNextNearestBlock
(int color) Get the block most closely matching a color, without matching the color, based on the block's average colorint[]
protected boolean
hasAlpha
(int color) protected static int
hueDistance
(int red1, int green1, int blue1, int red2, int green2, int blue2) void
static int
multiplyColor
(int c1, int c2) Combine two colors by multipling
-
Field Details
-
blockColors
protected int[] blockColors -
blockDistance
protected long[] blockDistance -
distances
protected long[] distances -
validColors
protected int[] validColors -
validBlockIds
protected int[] validBlockIds -
validLayerColors
protected int[] validLayerColors -
validLayerBlocks
protected int[][] validLayerBlocks -
validMixBiomeColors
protected int[] validMixBiomeColors -
validMixBiomeIds
protected long[] validMixBiomeIds -
validBiomes
https://github.com/erich666/Mineways/blob/master/Win/biomes.cpp
-
-
Constructor Details
-
TextureUtil
Do not use. UseFawe.getTextureUtil()
- Throws:
FileNotFoundException
-
TextureUtil
Do not use. UseFawe.getTextureUtil()
- Throws:
FileNotFoundException
-
-
Method Details
-
fromClipboard
- Throws:
FileNotFoundException
-
fromBlocks
- Throws:
FileNotFoundException
-
fromMask
- Throws:
FileNotFoundException
-
hueDistance
protected static int hueDistance(int red1, int green1, int blue1, int red2, int green2, int blue2) -
colorDistance
protected static long colorDistance(int c1, int c2) -
multiplyColor
public static int multiplyColor(int c1, int c2) Combine two colors by multipling- Parameters:
c1
- color 1c2
- color 2- Returns:
- new color
-
averageColor
public static int averageColor(int c1, int c2) Combine two colors by averaging- Parameters:
c1
- color 1c2
- color 2- Returns:
- new color
-
averageColor
public static int averageColor(int... colors) Combine multiple colors by multipling- Parameters:
colors
- colors- Returns:
- new color
-
combineTransparency
public static int combineTransparency(int top, int bottom) Assumes the top layer is a transparent color and the bottom is opaque -
getTextureUtil
- Specified by:
getTextureUtil
in interfaceTextureHolder
-
getNearestBlock
Get the block most closely matching a color based on the block's average color- Parameters:
color
- color to match- Returns:
- matching block
-
getNextNearestBlock
Get the block most closely matching a color, without matching the color, based on the block's average color- Parameters:
color
- color to match- Returns:
- matching block
-
getNearestLayer
Returns the block combined ids as an array. -
getLighterBlock
Get the next lightest block- Parameters:
block
- input block- Returns:
- next lightest block
-
getDarkerBlock
Get the next darkest block- Parameters:
block
- input block- Returns:
- next darkest block
-
getLighterBlock
Get the next lightest block- Parameters:
color
- input color- Returns:
- next lightest block
-
getDarkerBlock
Get the next darkest block- Parameters:
color
- input color- Returns:
- next darkest block
-
getColor
Get the integer representation of a block's RGBA color.- Parameters:
block
- input block- Returns:
- integer RGBA color
-
getColor
Get the integer representation of a biomes's RGBA color when applied to grass.- Parameters:
biome
- input biome- Returns:
- integer RGBA color
-
getBiome
Get theTextureUtil.BiomeColor
entry from a biome's ID- Parameters:
biome
- biome id- Returns:
- the
TextureUtil.BiomeColor
entry
-
getIsBlockCloserThanBiome
protected boolean getIsBlockCloserThanBiome(char[] blockAndBiomeIdOutput, int color, int biomePriority) -
getBiomeMix
protected int getBiomeMix(int[] biomeIdsOutput, int color) -
getNearestBiome
Get the biome most closely matching a color based on the block's average color- Parameters:
color
- color to match- Returns:
- matching block
-
getFolder
-
loadModTextures
- Throws:
IOException
-
calculateLayerArrays
protected void calculateLayerArrays() -
getNearestBlock
-
getNearestBlock
-
hasAlpha
protected boolean hasAlpha(int color) -
getValidBlockIds
public int[] getValidBlockIds()
-