File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/main/java/org/geysermc/globallinkserver Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 11
11
import java .util .logging .Logger ;
12
12
13
13
import com .destroystokyo .paper .event .server .PaperServerListPingEvent ;
14
+ import com .mojang .brigadier .arguments .IntegerArgumentType ;
14
15
import io .papermc .paper .command .brigadier .Commands ;
15
16
import io .papermc .paper .command .brigadier .argument .ArgumentTypes ;
16
17
import io .papermc .paper .event .player .AsyncChatEvent ;
@@ -82,7 +83,7 @@ public void onEnable() {
82
83
Commands .literal ("link" )
83
84
.requires (ctx -> ctx .getSender () instanceof Player )
84
85
.executes (commandUtils ::startLink )
85
- .then (Commands .argument ("code" , ArgumentTypes . integerRange ())
86
+ .then (Commands .argument ("code" , IntegerArgumentType . integer ())
86
87
.executes (commandUtils ::linkWithCode )
87
88
)
88
89
.build (),
Original file line number Diff line number Diff line change 5
5
*/
6
6
package org .geysermc .globallinkserver .util ;
7
7
8
+ import com .mojang .brigadier .arguments .IntegerArgumentType ;
8
9
import com .mojang .brigadier .context .CommandContext ;
9
10
import io .papermc .paper .command .brigadier .CommandSourceStack ;
10
11
import net .kyori .adventure .text .Component ;
@@ -47,7 +48,7 @@ public int startLink(CommandContext<CommandSourceStack> ctx) {
47
48
}
48
49
49
50
public int linkWithCode (CommandContext <CommandSourceStack > ctx ) {
50
- int linkId = ctx . getArgument ( "code" , Integer . class );
51
+ int linkId = IntegerArgumentType . getInteger ( ctx , "code" );
51
52
52
53
Player player = getPlayer (ctx );
53
54
You can’t perform that action at this time.
0 commit comments