Package org.bukkit.map
Class MapPalette
java.lang.Object
org.bukkit.map.MapPalette
Represents the palette that map items use.
 
These fields are the base color ranges. Each entry corresponds to four colors of varying shades with values entry to entry + 3.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceHolds cached information for matching map colors of a given RBG color.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic valuestatic final byteDeprecated.Magic value
- 
Method SummaryModifier and TypeMethodDescriptiongetColor(byte index) Deprecated, for removal: This API element is subject to removal in a future version.use color directlygetNearestColor(@NotNull Color color) Gets the closestColorin the map palette.static @org.jetbrains.annotations.NotNull byte[]imageToBytes(@NotNull Image image) Deprecated, for removal: This API element is subject to removal in a future version.use color-related methodsstatic bytematchColor(int r, int g, int b) Deprecated, for removal: This API element is subject to removal in a future version.use color-related methodsstatic bytematchColor(@NotNull Color color) Deprecated, for removal: This API element is subject to removal in a future version.use color-related methodsstatic @NotNull BufferedImageresizeImage(@Nullable Image image) Resize an image to 128x128.static voidsetMapColorCache(@NotNull MapPalette.MapColorCache mapColorCache) Sets the given MapColorCache.
- 
Field Details- 
TRANSPARENTDeprecated.Magic value- See Also:
 
- 
LIGHT_GREENDeprecated.Magic value- See Also:
 
- 
LIGHT_BROWNDeprecated.Magic value- See Also:
 
- 
GRAY_1Deprecated.Magic value- See Also:
 
- 
REDDeprecated.Magic value- See Also:
 
- 
PALE_BLUEDeprecated.Magic value- See Also:
 
- 
GRAY_2Deprecated.Magic value- See Also:
 
- 
DARK_GREENDeprecated.Magic value- See Also:
 
- 
WHITEDeprecated.Magic value- See Also:
 
- 
LIGHT_GRAYDeprecated.Magic value- See Also:
 
- 
BROWNDeprecated.Magic value- See Also:
 
- 
DARK_GRAYDeprecated.Magic value- See Also:
 
- 
BLUEDeprecated.Magic value- See Also:
 
- 
DARK_BROWNDeprecated.Magic value- See Also:
 
 
- 
- 
Method Details- 
resizeImageResize an image to 128x128.- Parameters:
- image- The image to resize.
- Returns:
- The resized image.
 
- 
imageToBytes@Deprecated(since="1.6.2", forRemoval=true) @NotNull public static @org.jetbrains.annotations.NotNull byte[] imageToBytes(@NotNull @NotNull Image image) Deprecated, for removal: This API element is subject to removal in a future version.use color-related methodsConvert an Image to a byte[] using the palette.- Parameters:
- image- The image to convert.
- Returns:
- A byte[] containing the pixels of the image.
 
- 
matchColorDeprecated, for removal: This API element is subject to removal in a future version.use color-related methodsGet the index of the closest matching color in the palette to the given color.- Parameters:
- r- The red component of the color.
- g- The green component of the color.
- b- The blue component of the color.
- Returns:
- The index in the palette.
 
- 
matchColor@Deprecated(since="1.6.2", forRemoval=true) public static byte matchColor(@NotNull @NotNull Color color) Deprecated, for removal: This API element is subject to removal in a future version.use color-related methodsGet the index of the closest matching color in the palette to the given color.- Parameters:
- color- The Color to match.
- Returns:
- The index in the palette.
 
- 
getColor@Deprecated(since="1.6.2", forRemoval=true) @NotNull public static @NotNull Color getColor(byte index) Deprecated, for removal: This API element is subject to removal in a future version.use color directlyGet the value of the given color in the palette.- Parameters:
- index- The index in the palette.
- Returns:
- The Color of the palette entry.
 
- 
getNearestColorGets the closestColorin the map palette.- Parameters:
- color- to match against the map palette
- Returns:
- the nearest Colorfrom the map palette
 
- 
setMapColorCacheSets the given MapColorCache.- Parameters:
- mapColorCache- The map color cache to set
 
 
-