1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
@ -18,16 +18,6 @@ public final class MapPalette {
|
||||
// Internal mechanisms
|
||||
private MapPalette() {}
|
||||
|
||||
@NotNull
|
||||
private static Color c(int r, int g, int b) {
|
||||
return new Color(r, g, b);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Color c(int r, int g, int b, int a) {
|
||||
return new Color(r, g, b, a);
|
||||
}
|
||||
|
||||
private static double getDistance(@NotNull Color c1, @NotNull Color c2) {
|
||||
// Paper start - Optimize color distance calculation by removing floating point math
|
||||
int rsum = c1.getRed() + c2.getRed(); // Use sum instead of mean for no division
|
||||
@ -46,68 +36,257 @@ public final class MapPalette {
|
||||
|
||||
@NotNull
|
||||
static final Color[] colors = {
|
||||
c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0),
|
||||
c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29),
|
||||
c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86),
|
||||
c(140, 140, 140), c(171, 171, 171), c(199, 199, 199), c(105, 105, 105),
|
||||
c(180, 0, 0), c(220, 0, 0), c(255, 0, 0), c(135, 0, 0),
|
||||
c(112, 112, 180), c(138, 138, 220), c(160, 160, 255), c(84, 84, 135),
|
||||
c(117, 117, 117), c(144, 144, 144), c(167, 167, 167), c(88, 88, 88),
|
||||
c(0, 87, 0), c(0, 106, 0), c(0, 124, 0), c(0, 65, 0),
|
||||
c(180, 180, 180), c(220, 220, 220), c(255, 255, 255), c(135, 135, 135),
|
||||
c(115, 118, 129), c(141, 144, 158), c(164, 168, 184), c(86, 88, 97),
|
||||
c(106, 76, 54), c(130, 94, 66), c(151, 109, 77), c(79, 57, 40),
|
||||
c(79, 79, 79), c(96, 96, 96), c(112, 112, 112), c(59, 59, 59),
|
||||
c(45, 45, 180), c(55, 55, 220), c(64, 64, 255), c(33, 33, 135),
|
||||
c(100, 84, 50), c(123, 102, 62), c(143, 119, 72), c(75, 63, 38),
|
||||
c(180, 177, 172), c(220, 217, 211), c(255, 252, 245), c(135, 133, 129),
|
||||
c(152, 89, 36), c(186, 109, 44), c(216, 127, 51), c(114, 67, 27),
|
||||
c(125, 53, 152), c(153, 65, 186), c(178, 76, 216), c(94, 40, 114),
|
||||
c(72, 108, 152), c(88, 132, 186), c(102, 153, 216), c(54, 81, 114),
|
||||
c(161, 161, 36), c(197, 197, 44), c(229, 229, 51), c(121, 121, 27),
|
||||
c(89, 144, 17), c(109, 176, 21), c(127, 204, 25), c(67, 108, 13),
|
||||
c(170, 89, 116), c(208, 109, 142), c(242, 127, 165), c(128, 67, 87),
|
||||
c(53, 53, 53), c(65, 65, 65), c(76, 76, 76), c(40, 40, 40),
|
||||
c(108, 108, 108), c(132, 132, 132), c(153, 153, 153), c(81, 81, 81),
|
||||
c(53, 89, 108), c(65, 109, 132), c(76, 127, 153), c(40, 67, 81),
|
||||
c(89, 44, 125), c(109, 54, 153), c(127, 63, 178), c(67, 33, 94),
|
||||
c(36, 53, 125), c(44, 65, 153), c(51, 76, 178), c(27, 40, 94),
|
||||
c(72, 53, 36), c(88, 65, 44), c(102, 76, 51), c(54, 40, 27),
|
||||
c(72, 89, 36), c(88, 109, 44), c(102, 127, 51), c(54, 67, 27),
|
||||
c(108, 36, 36), c(132, 44, 44), c(153, 51, 51), c(81, 27, 27),
|
||||
c(17, 17, 17), c(21, 21, 21), c(25, 25, 25), c(13, 13, 13),
|
||||
c(176, 168, 54), c(215, 205, 66), c(250, 238, 77), c(132, 126, 40),
|
||||
c(64, 154, 150), c(79, 188, 183), c(92, 219, 213), c(48, 115, 112),
|
||||
c(52, 90, 180), c(63, 110, 220), c(74, 128, 255), c(39, 67, 135),
|
||||
c(0, 153, 40), c(0, 187, 50), c(0, 217, 58), c(0, 114, 30),
|
||||
c(91, 60, 34), c(111, 74, 42), c(129, 86, 49), c(68, 45, 25),
|
||||
c(79, 1, 0), c(96, 1, 0), c(112, 2, 0), c(59, 1, 0),
|
||||
c(147, 124, 113), c(180, 152, 138), c(209, 177, 161), c(110, 93, 85),
|
||||
c(112, 57, 25), c(137, 70, 31), c(159, 82, 36), c(84, 43, 19),
|
||||
c(105, 61, 76), c(128, 75, 93), c(149, 87, 108), c(78, 46, 57),
|
||||
c(79, 76, 97), c(96, 93, 119), c(112, 108, 138), c(59, 57, 73),
|
||||
c(131, 93, 25), c(160, 114, 31), c(186, 133, 36), c(98, 70, 19),
|
||||
c(72, 82, 37), c(88, 100, 45), c(103, 117, 53), c(54, 61, 28),
|
||||
c(112, 54, 55), c(138, 66, 67), c(160, 77, 78), c(84, 40, 41),
|
||||
c(40, 28, 24), c(49, 35, 30), c(57, 41, 35), c(30, 21, 18),
|
||||
c(95, 75, 69), c(116, 92, 84), c(135, 107, 98), c(71, 56, 51),
|
||||
c(61, 64, 64), c(75, 79, 79), c(87, 92, 92), c(46, 48, 48),
|
||||
c(86, 51, 62), c(105, 62, 75), c(122, 73, 88), c(64, 38, 46),
|
||||
c(53, 43, 64), c(65, 53, 79), c(76, 62, 92), c(40, 32, 48),
|
||||
c(53, 35, 24), c(65, 43, 30), c(76, 50, 35), c(40, 26, 18),
|
||||
c(53, 57, 29), c(65, 70, 36), c(76, 82, 42), c(40, 43, 22),
|
||||
c(100, 42, 32), c(122, 51, 39), c(142, 60, 46), c(75, 31, 24),
|
||||
c(26, 15, 11), c(31, 18, 13), c(37, 22, 16), c(19, 11, 8),
|
||||
c(133, 33, 34), c(163, 41, 42), c(189, 48, 49), c(100, 25, 25),
|
||||
c(104, 44, 68), c(127, 54, 83), c(148, 63, 97), c(78, 33, 51),
|
||||
c(64, 17, 20), c(79, 21, 25), c(92, 25, 29), c(48, 13, 15),
|
||||
c(15, 88, 94), c(18, 108, 115), c(22, 126, 134), c(11, 66, 70),
|
||||
c(40, 100, 98), c(50, 122, 120), c(58, 142, 140), c(30, 75, 74),
|
||||
c(60, 31, 43), c(74, 37, 53), c(86, 44, 62), c(45, 23, 32),
|
||||
c(14, 127, 93), c(17, 155, 114), c(20, 180, 133), c(10, 95, 70),
|
||||
c(70, 70, 70), c(86, 86, 86), c(100, 100, 100), c(52, 52, 52),
|
||||
c(152, 123, 103), c(186, 150, 126), c(216, 175, 147), c(114, 92, 77),
|
||||
c(89, 117, 105), c(109, 144, 129), c(127, 167, 150), c(67, 88, 79)
|
||||
// Start generate - MapPalette#colors
|
||||
// @GeneratedFrom 1.21.5
|
||||
new Color(0x00000000, true),
|
||||
new Color(0x00000000, true),
|
||||
new Color(0x00000000, true),
|
||||
new Color(0x00000000, true),
|
||||
new Color(0x597D27),
|
||||
new Color(0x6D9930),
|
||||
new Color(0x7FB238),
|
||||
new Color(0x435E1D),
|
||||
new Color(0xAEA473),
|
||||
new Color(0xD5C98C),
|
||||
new Color(0xF7E9A3),
|
||||
new Color(0x827B56),
|
||||
new Color(0x8C8C8C),
|
||||
new Color(0xABABAB),
|
||||
new Color(0xC7C7C7),
|
||||
new Color(0x696969),
|
||||
new Color(0xB40000),
|
||||
new Color(0xDC0000),
|
||||
new Color(0xFF0000),
|
||||
new Color(0x870000),
|
||||
new Color(0x7070B4),
|
||||
new Color(0x8A8ADC),
|
||||
new Color(0xA0A0FF),
|
||||
new Color(0x545487),
|
||||
new Color(0x757575),
|
||||
new Color(0x909090),
|
||||
new Color(0xA7A7A7),
|
||||
new Color(0x585858),
|
||||
new Color(0x005700),
|
||||
new Color(0x006A00),
|
||||
new Color(0x007C00),
|
||||
new Color(0x004100),
|
||||
new Color(0xB4B4B4),
|
||||
new Color(0xDCDCDC),
|
||||
new Color(0xFFFFFF),
|
||||
new Color(0x878787),
|
||||
new Color(0x737681),
|
||||
new Color(0x8D909E),
|
||||
new Color(0xA4A8B8),
|
||||
new Color(0x565861),
|
||||
new Color(0x6A4C36),
|
||||
new Color(0x825E42),
|
||||
new Color(0x976D4D),
|
||||
new Color(0x4F3928),
|
||||
new Color(0x4F4F4F),
|
||||
new Color(0x606060),
|
||||
new Color(0x707070),
|
||||
new Color(0x3B3B3B),
|
||||
new Color(0x2D2DB4),
|
||||
new Color(0x3737DC),
|
||||
new Color(0x4040FF),
|
||||
new Color(0x212187),
|
||||
new Color(0x645432),
|
||||
new Color(0x7B663E),
|
||||
new Color(0x8F7748),
|
||||
new Color(0x4B3F26),
|
||||
new Color(0xB4B1AC),
|
||||
new Color(0xDCD9D3),
|
||||
new Color(0xFFFCF5),
|
||||
new Color(0x878581),
|
||||
new Color(0x985924),
|
||||
new Color(0xBA6D2C),
|
||||
new Color(0xD87F33),
|
||||
new Color(0x72431B),
|
||||
new Color(0x7D3598),
|
||||
new Color(0x9941BA),
|
||||
new Color(0xB24CD8),
|
||||
new Color(0x5E2872),
|
||||
new Color(0x486C98),
|
||||
new Color(0x5884BA),
|
||||
new Color(0x6699D8),
|
||||
new Color(0x365172),
|
||||
new Color(0xA1A124),
|
||||
new Color(0xC5C52C),
|
||||
new Color(0xE5E533),
|
||||
new Color(0x79791B),
|
||||
new Color(0x599011),
|
||||
new Color(0x6DB015),
|
||||
new Color(0x7FCC19),
|
||||
new Color(0x436C0D),
|
||||
new Color(0xAA5974),
|
||||
new Color(0xD06D8E),
|
||||
new Color(0xF27FA5),
|
||||
new Color(0x804357),
|
||||
new Color(0x353535),
|
||||
new Color(0x414141),
|
||||
new Color(0x4C4C4C),
|
||||
new Color(0x282828),
|
||||
new Color(0x6C6C6C),
|
||||
new Color(0x848484),
|
||||
new Color(0x999999),
|
||||
new Color(0x515151),
|
||||
new Color(0x35596C),
|
||||
new Color(0x416D84),
|
||||
new Color(0x4C7F99),
|
||||
new Color(0x284351),
|
||||
new Color(0x592C7D),
|
||||
new Color(0x6D3699),
|
||||
new Color(0x7F3FB2),
|
||||
new Color(0x43215E),
|
||||
new Color(0x24357D),
|
||||
new Color(0x2C4199),
|
||||
new Color(0x334CB2),
|
||||
new Color(0x1B285E),
|
||||
new Color(0x483524),
|
||||
new Color(0x58412C),
|
||||
new Color(0x664C33),
|
||||
new Color(0x36281B),
|
||||
new Color(0x485924),
|
||||
new Color(0x586D2C),
|
||||
new Color(0x667F33),
|
||||
new Color(0x36431B),
|
||||
new Color(0x6C2424),
|
||||
new Color(0x842C2C),
|
||||
new Color(0x993333),
|
||||
new Color(0x511B1B),
|
||||
new Color(0x111111),
|
||||
new Color(0x151515),
|
||||
new Color(0x191919),
|
||||
new Color(0x0D0D0D),
|
||||
new Color(0xB0A836),
|
||||
new Color(0xD7CD42),
|
||||
new Color(0xFAEE4D),
|
||||
new Color(0x847E28),
|
||||
new Color(0x409A96),
|
||||
new Color(0x4FBCB7),
|
||||
new Color(0x5CDBD5),
|
||||
new Color(0x307370),
|
||||
new Color(0x345AB4),
|
||||
new Color(0x3F6EDC),
|
||||
new Color(0x4A80FF),
|
||||
new Color(0x274387),
|
||||
new Color(0x009928),
|
||||
new Color(0x00BB32),
|
||||
new Color(0x00D93A),
|
||||
new Color(0x00721E),
|
||||
new Color(0x5B3C22),
|
||||
new Color(0x6F4A2A),
|
||||
new Color(0x815631),
|
||||
new Color(0x442D19),
|
||||
new Color(0x4F0100),
|
||||
new Color(0x600100),
|
||||
new Color(0x700200),
|
||||
new Color(0x3B0100),
|
||||
new Color(0x937C71),
|
||||
new Color(0xB4988A),
|
||||
new Color(0xD1B1A1),
|
||||
new Color(0x6E5D55),
|
||||
new Color(0x703919),
|
||||
new Color(0x89461F),
|
||||
new Color(0x9F5224),
|
||||
new Color(0x542B13),
|
||||
new Color(0x693D4C),
|
||||
new Color(0x804B5D),
|
||||
new Color(0x95576C),
|
||||
new Color(0x4E2E39),
|
||||
new Color(0x4F4C61),
|
||||
new Color(0x605D77),
|
||||
new Color(0x706C8A),
|
||||
new Color(0x3B3949),
|
||||
new Color(0x835D19),
|
||||
new Color(0xA0721F),
|
||||
new Color(0xBA8524),
|
||||
new Color(0x624613),
|
||||
new Color(0x485225),
|
||||
new Color(0x58642D),
|
||||
new Color(0x677535),
|
||||
new Color(0x363D1C),
|
||||
new Color(0x703637),
|
||||
new Color(0x8A4243),
|
||||
new Color(0xA04D4E),
|
||||
new Color(0x542829),
|
||||
new Color(0x281C18),
|
||||
new Color(0x31231E),
|
||||
new Color(0x392923),
|
||||
new Color(0x1E1512),
|
||||
new Color(0x5F4B45),
|
||||
new Color(0x745C54),
|
||||
new Color(0x876B62),
|
||||
new Color(0x473833),
|
||||
new Color(0x3D4040),
|
||||
new Color(0x4B4F4F),
|
||||
new Color(0x575C5C),
|
||||
new Color(0x2E3030),
|
||||
new Color(0x56333E),
|
||||
new Color(0x693E4B),
|
||||
new Color(0x7A4958),
|
||||
new Color(0x40262E),
|
||||
new Color(0x352B40),
|
||||
new Color(0x41354F),
|
||||
new Color(0x4C3E5C),
|
||||
new Color(0x282030),
|
||||
new Color(0x352318),
|
||||
new Color(0x412B1E),
|
||||
new Color(0x4C3223),
|
||||
new Color(0x281A12),
|
||||
new Color(0x35391D),
|
||||
new Color(0x414624),
|
||||
new Color(0x4C522A),
|
||||
new Color(0x282B16),
|
||||
new Color(0x642A20),
|
||||
new Color(0x7A3327),
|
||||
new Color(0x8E3C2E),
|
||||
new Color(0x4B1F18),
|
||||
new Color(0x1A0F0B),
|
||||
new Color(0x1F120D),
|
||||
new Color(0x251610),
|
||||
new Color(0x130B08),
|
||||
new Color(0x852122),
|
||||
new Color(0xA3292A),
|
||||
new Color(0xBD3031),
|
||||
new Color(0x641919),
|
||||
new Color(0x682C44),
|
||||
new Color(0x7F3653),
|
||||
new Color(0x943F61),
|
||||
new Color(0x4E2133),
|
||||
new Color(0x401114),
|
||||
new Color(0x4F1519),
|
||||
new Color(0x5C191D),
|
||||
new Color(0x300D0F),
|
||||
new Color(0x0F585E),
|
||||
new Color(0x126C73),
|
||||
new Color(0x167E86),
|
||||
new Color(0x0B4246),
|
||||
new Color(0x286462),
|
||||
new Color(0x327A78),
|
||||
new Color(0x3A8E8C),
|
||||
new Color(0x1E4B4A),
|
||||
new Color(0x3C1F2B),
|
||||
new Color(0x4A2535),
|
||||
new Color(0x562C3E),
|
||||
new Color(0x2D1720),
|
||||
new Color(0x0E7F5D),
|
||||
new Color(0x119B72),
|
||||
new Color(0x14B485),
|
||||
new Color(0x0A5F46),
|
||||
new Color(0x464646),
|
||||
new Color(0x565656),
|
||||
new Color(0x646464),
|
||||
new Color(0x343434),
|
||||
new Color(0x987B67),
|
||||
new Color(0xBA967E),
|
||||
new Color(0xD8AF93),
|
||||
new Color(0x725C4D),
|
||||
new Color(0x597569),
|
||||
new Color(0x6D9081),
|
||||
new Color(0x7FA796),
|
||||
new Color(0x43584F),
|
||||
// End generate - MapPalette#colors
|
||||
};
|
||||
|
||||
// Interface
|
||||
@ -264,7 +443,7 @@ public final class MapPalette {
|
||||
}
|
||||
}
|
||||
|
||||
// Minecraft has 143 colors, some of which have negative byte representations
|
||||
// Minecraft has 248 colors, some of which have negative byte representations
|
||||
return (byte) (index < 128 ? index : -129 + (index - 127));
|
||||
}
|
||||
|
||||
@ -278,7 +457,7 @@ public final class MapPalette {
|
||||
@Deprecated(since = "1.6.2", forRemoval = true) // Paper
|
||||
@NotNull
|
||||
public static Color getColor(byte index) {
|
||||
// Minecraft has 143 colors, some of which have negative byte representations
|
||||
// Minecraft has 248 colors, some of which have negative byte representations
|
||||
return colors[index >= 0 ? index : index + 256];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user