Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong documentation for ChannelMode #8022

Closed
Aresiel opened this issue Jul 11, 2024 · 2 comments
Closed

Wrong documentation for ChannelMode #8022

Aresiel opened this issue Jul 11, 2024 · 2 comments

Comments

@Aresiel
Copy link

Aresiel commented Jul 11, 2024

The ChannelMode class' latter two comments (1, 2) are wrong.

An enum value with 0 adHocNetworkChannels and 0 cableCapacityFactor does not disable requirements, but rather limit the amount of used channels to 0.

See:
image
with this setup
image
and the following enum extension:

@Mixin(appeng.api.networking.pathing.ChannelMode.class)
public class ChannelModeNoneEnumExtension {
    @Mutable
    @Shadow
    @Final
    private static appeng.api.networking.pathing.ChannelMode[] $VALUES;

    @Invoker(value = "<init>")
    private static appeng.api.networking.pathing.ChannelMode create(String name, int ordinal, int adHocNetworkChannels, int cableCapacityFactor){
        throw new IllegalStateException();
    }

    static {
        appeng.api.networking.pathing.ChannelMode NONE = create("NONE", $VALUES.length, 0, 0);

        $VALUES = ArrayUtils.add($VALUES, NONE);
    }
}

I would correct this by simply removing the remark, since it's (clearly) not utilized.

@Technici4n
Copy link
Member

I sure hope you aren't doing this kind of enum extension in production. 😄

@Aresiel
Copy link
Author

Aresiel commented Aug 1, 2024

I sure hope you aren't doing this kind of enum extension in production. 😄

They say ignorance is bliss, I hope you remain blissful on this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants