@@ -85,31 +85,26 @@ private Request(Request.@NotNull Builder builder) throws IllegalArgumentExceptio
8585
8686 // validate type & related arguments
8787 this .type = ExceptionUtil .validateNotNull (builder .type , "type" );
88- if (this .type .isEffectType ()) {
89- if (builder .effect == null )
90- throw new IllegalArgumentException ("effect cannot be null for effect packets" );
91- if (builder .viewer == null )
92- throw new IllegalArgumentException ("viewer cannot be null for effect packets" );
93- } else {
94- if (builder .effect != null )
95- throw new IllegalArgumentException ("effect cannot be non-null for non-effect packets" );
96- if (builder .viewer != null )
97- throw new IllegalArgumentException ("viewer cannot be non-null for non-effect packets" );
98- if (builder .cost != null )
99- throw new IllegalArgumentException ("cost cannot be non-null for non-effect packets" );
100- if (builder .targets != null )
101- throw new IllegalArgumentException ("targets cannot be non-null for non-effect packets" );
102- if (builder .quantity != null )
103- throw new IllegalArgumentException ("quantity cannot be non-null for non-effect packets" );
104-
105- if (builder .password == null && this .type == Type .LOGIN )
106- throw new IllegalArgumentException ("password cannot be null for login packets" );
107-
108- if (builder .player == null && this .type == Type .PLAYER_INFO )
109- throw new IllegalArgumentException ("player cannot be null for player info packets" );
110- }
111-
112- // other arguments
88+ if (!this .type .isEffectType ()) {
89+ if (builder .effect != null )
90+ throw new IllegalArgumentException ("effect cannot be non-null for non-effect packets" );
91+ if (builder .viewer != null )
92+ throw new IllegalArgumentException ("viewer cannot be non-null for non-effect packets" );
93+ if (builder .cost != null )
94+ throw new IllegalArgumentException ("cost cannot be non-null for non-effect packets" );
95+ if (builder .targets != null )
96+ throw new IllegalArgumentException ("targets cannot be non-null for non-effect packets" );
97+ if (builder .quantity != null )
98+ throw new IllegalArgumentException ("quantity cannot be non-null for non-effect packets" );
99+
100+ if (builder .password == null && this .type == Type .LOGIN )
101+ throw new IllegalArgumentException ("password cannot be null for login packets" );
102+
103+ if (builder .player == null && this .type == Type .PLAYER_INFO )
104+ throw new IllegalArgumentException ("player cannot be null for player info packets" );
105+ }
106+
107+ // other arguments
113108 this .effect = builder .effect == null ? null : builder .effect .toLowerCase (Locale .ENGLISH );
114109 this .viewer = builder .viewer ;
115110 this .message = builder .message ;
0 commit comments