Skip to content

Commit eac8a62

Browse files
committed
Fix BukkitMCColor on versions prior to 1.19.4
Affected custom particle colors, potion colors, firework colors, map item colors, and leather armor colors.
1 parent 18fa049 commit eac8a62

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/main/java/com/laytonsmith/abstraction/bukkit/BukkitMCColor.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
package com.laytonsmith.abstraction.bukkit;
22

33
import com.laytonsmith.abstraction.MCColor;
4+
import com.laytonsmith.abstraction.enums.MCVersion;
5+
import com.laytonsmith.core.Static;
46
import org.bukkit.Color;
57

68
public final class BukkitMCColor implements MCColor {
79

810
private static final BukkitMCColor BUILDER = new BukkitMCColor();
911

1012
public static MCColor GetMCColor(Color c) {
11-
return BUILDER.build(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha());
13+
if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_19_4)) {
14+
return BUILDER.build(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha());
15+
} else {
16+
return BUILDER.build(c.getRed(), c.getGreen(), c.getBlue());
17+
}
1218
}
1319

1420
public static Color GetColor(MCColor c) {
15-
return Color.fromARGB(c.getAlpha(), c.getRed(), c.getGreen(), c.getBlue());
21+
if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_19_4)) {
22+
return Color.fromARGB(c.getAlpha(), c.getRed(), c.getGreen(), c.getBlue());
23+
} else {
24+
return Color.fromRGB(c.getRed(), c.getGreen(), c.getBlue());
25+
}
1626
}
1727

1828
private BukkitMCColor() {

0 commit comments

Comments
 (0)