Applied Energistics 2

Applied Energistics 2

137M Downloads

Color Applicator sets the wrong color for some colors

Mari023 opened this issue ยท 3 comments

commented

A color applicator set to black will color the cable green, green makes light blue, light blue makes black.
A similar loop exists with blue, a different one with red.
The only two correct colors I found were fluix and white

Which minecraft version are you using?

1.21

commented

Reminds me of my review of the retexturing commit: 3735739

src/main/java/appeng/api/util/AEColor.java had a comment that could explain your observation:

-    public static final List<AEColor> VALID_COLORS = Arrays.asList(WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME,
            PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE, BLUE, BROWN, GREEN, RED, BLACK);
    // TODO (RID): Sorted the colours according to the colour wheel
+    public static final List<AEColor> VALID_COLORS = Arrays.asList(WHITE, LIGHT_GRAY, GRAY, BLACK, LIME, YELLOW,
            ORANGE, BROWN, RED, PINK, MAGENTA, PURPLE, BLUE, LIGHT_BLUE, CYAN, GREEN);
commented

this seems suspicious...

public boolean recolorBlock(BlockGetter level, BlockPos pos, Direction side,
DyeColor color, Player who) {
try {
return this.cb(level, pos).recolourBlock(side, AEColor.values()[color.ordinal()], who);
} catch (Throwable ignored) {
}
return false;
}

it uses the ordinal of the DyeColor as the index for AEColor, the later is now different

(this method is called by the color Applicator)

commented

maybe...
the change in index matches with up with the way the colors are wrong