程序包 org.bukkit.map

类 MapPalette

java.lang.Object
org.bukkit.map.MapPalette

public final class MapPalette extends Object
表示地图物品使用的调色板。

这些字段是基础颜色范围。每个条目对应四种不同深浅的颜色,其值从条目到条目+3。

  • 字段详细资料

  • 方法详细资料

    • resizeImage

      @NotNull public static @NotNull BufferedImage resizeImage(@Nullable @Nullable Image image)
      将图像调整为128x128大小。

      原文: Resize an image to 128x128.

      参数:
      image - 要调整大小的图像。
      返回:
      调整大小后的图像。
    • imageToBytes

      @Deprecated(since="1.6.2") @NotNull public static @org.jetbrains.annotations.NotNull byte[] imageToBytes(@NotNull @NotNull Image image)
      已过时。
      魔法值
      使用调色板将图像转换为byte[]。

      原文: Convert an Image to a byte[] using the palette.

      参数:
      image - 要转换的图像。
      返回:
      包含图像像素的byte[]。
    • matchColor

      @Deprecated(since="1.6.2") public static byte matchColor(int r, int g, int b)
      已过时。
      魔法值
      获取调色板中与给定颜色最匹配的颜色索引。

      原文: Get the index of the closest matching color in the palette to the given color.

      参数:
      r - 颜色的红色分量。
      b - 颜色的蓝色分量。
      g - 颜色的绿色分量。
      返回:
      调色板中的索引。
    • matchColor

      @Deprecated(since="1.6.2") public static byte matchColor(@NotNull @NotNull Color color)
      已过时。
      魔法值
      获取调色板中与给定颜色最匹配的颜色索引。

      原文: Get the index of the closest matching color in the palette to the given color.

      参数:
      color - 要匹配的Color对象。
      返回:
      调色板中的索引。
    • getColor

      @Deprecated(since="1.6.2") @NotNull public static @NotNull Color getColor(byte index)
      已过时。
      魔法值
      获取调色板中给定颜色的值。

      原文: Get the value of the given color in the palette.

      参数:
      index - 调色板中的索引。
      返回:
      调色板条目的Color对象。
    • setMapColorCache

      public static void setMapColorCache(@NotNull @NotNull MapPalette.MapColorCache mapColorCache)
      设置给定的MapColorCache。

      原文: Sets the given MapColorCache.

      参数:
      mapColorCache - 要设置的地图颜色缓存。