From 62fb4cc2b87dc1baa75f1d248ecef9c0c9500d3b Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Thu, 6 Feb 2025 13:40:14 -0500 Subject: [PATCH] Change misleading comments (#6632) * Change misleading comments The previous javadoc were more confusing than anything. I think this is better? Still dislike the naming of the targets() method considering those are the senders and not the receivers but oh well * Remove wrong docs --- .../java/mindustry/annotations/Annotations.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/annotations/src/main/java/mindustry/annotations/Annotations.java b/annotations/src/main/java/mindustry/annotations/Annotations.java index 88811afca5..6aa8d5b9d9 100644 --- a/annotations/src/main/java/mindustry/annotations/Annotations.java +++ b/annotations/src/main/java/mindustry/annotations/Annotations.java @@ -182,18 +182,16 @@ public class Annotations{ /** A set of two booleans, one specifying server and one specifying client. */ public enum Loc{ - /** Method can only be invoked on the client from the server. */ + /** Server only. */ server(true, false), - /** Method can only be invoked on the server from the client. */ + /** Client only. */ client(false, true), - /** Method can be invoked from anywhere */ + /** Both server and client. */ both(true, true), /** Neither server nor client. */ none(false, false); - /** If true, this method can be invoked ON clients FROM servers. */ public final boolean isServer; - /** If true, this method can be invoked ON servers FROM clients. */ public final boolean isClient; Loc(boolean server, boolean client){ @@ -222,16 +220,16 @@ public class Annotations{ @Target(ElementType.METHOD) @Retention(RetentionPolicy.SOURCE) public @interface Remote{ - /** Specifies the locations from which this method can be invoked. */ + /** Specifies the locations from which this method can cause remote invocations (This -> Remote) [Default: Server -> Client]. */ Loc targets() default Loc.server; - /** Specifies which methods are generated. Only affects server-to-client methods. */ + /** Specifies which methods are generated. Only affects server-to-client methods (Server -> Client(s)) [Default: Server -> Client & Server -> All Clients]. */ Variant variants() default Variant.all; - /** The local locations where this method is called locally, when invoked. */ + /** The locations where this method is called locally, when invoked locally (This -> This) [Default: No local invocations]. */ Loc called() default Loc.none; - /** Whether to forward this packet to all other clients upon receival. Client only. */ + /** Whether the server should forward this packet to all other clients upon receival from a client (Client -> Server -> Other Clients). [Default: Don't Forward Client Invocations] */ boolean forward() default false; /**