Package org.bukkit.map
Class MapPalette
java.lang.Object
org.bukkit.map.MapPalette
Represents the palette that map items use.
These fields are hee base color ranges. Each entry corresponds to four colors of varying shades with values entry to entry + 3.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Holds cached information for matching map colors of a given RBG color. -
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic valuestatic final byte
Deprecated.Magic value -
Method Summary
Modifier and TypeMethodDescriptiongetColor
(byte index) Deprecated.Magic valuestatic @org.jetbrains.annotations.NotNull byte[]
imageToBytes
(@NotNull Image image) Deprecated.Magic valuestatic byte
matchColor
(int r, int g, int b) Deprecated.Magic valuestatic byte
matchColor
(@NotNull Color color) Deprecated.Magic valuestatic @NotNull BufferedImage
resizeImage
(@Nullable Image image) Resize an image to 128x128.static void
setMapColorCache
(@NotNull MapPalette.MapColorCache mapColorCache) Sets the given MapColorCache.
-
Field Details
-
TRANSPARENT
Deprecated.Magic value- See Also:
-
LIGHT_GREEN
Deprecated.Magic value- See Also:
-
LIGHT_BROWN
Deprecated.Magic value- See Also:
-
GRAY_1
Deprecated.Magic value- See Also:
-
RED
Deprecated.Magic value- See Also:
-
PALE_BLUE
Deprecated.Magic value- See Also:
-
GRAY_2
Deprecated.Magic value- See Also:
-
DARK_GREEN
Deprecated.Magic value- See Also:
-
WHITE
Deprecated.Magic value- See Also:
-
LIGHT_GRAY
Deprecated.Magic value- See Also:
-
BROWN
Deprecated.Magic value- See Also:
-
DARK_GRAY
Deprecated.Magic value- See Also:
-
BLUE
Deprecated.Magic value- See Also:
-
DARK_BROWN
Deprecated.Magic value- See Also:
-
-
Method Details
-
resizeImage
Resize an image to 128x128.- Parameters:
image
- The image to resize.- Returns:
- The resized image.
-
imageToBytes
@Deprecated @NotNull public static @org.jetbrains.annotations.NotNull byte[] imageToBytes(@NotNull @NotNull Image image) Deprecated.Magic valueConvert an Image to a byte[] using the palette.- Parameters:
image
- The image to convert.- Returns:
- A byte[] containing the pixels of the image.
-
matchColor
Deprecated.Magic valueGet the index of the closest matching color in the palette to the given color.- Parameters:
r
- The red component of the color.b
- The blue component of the color.g
- The green component of the color.- Returns:
- The index in the palette.
-
matchColor
Deprecated.Magic valueGet 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.Magic valueGet the value of the given color in the palette.- Parameters:
index
- The index in the palette.- Returns:
- The Color of the palette entry.
-
setMapColorCache
Sets the given MapColorCache.- Parameters:
mapColorCache
- The map color cache to set
-