Skip to content

Commit

Permalink
Fix link command code argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Jan 17, 2025
1 parent 31e40a9 commit 4cf344a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.logging.Logger;

import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import io.papermc.paper.command.brigadier.Commands;
import io.papermc.paper.command.brigadier.argument.ArgumentTypes;
import io.papermc.paper.event.player.AsyncChatEvent;
Expand Down Expand Up @@ -82,7 +83,7 @@ public void onEnable() {
Commands.literal("link")
.requires(ctx -> ctx.getSender() instanceof Player)
.executes(commandUtils::startLink)
.then(Commands.argument("code", ArgumentTypes.integerRange())
.then(Commands.argument("code", IntegerArgumentType.integer())
.executes(commandUtils::linkWithCode)
)
.build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package org.geysermc.globallinkserver.util;

import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.context.CommandContext;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import net.kyori.adventure.text.Component;
Expand Down Expand Up @@ -47,7 +48,7 @@ public int startLink(CommandContext<CommandSourceStack> ctx) {
}

public int linkWithCode(CommandContext<CommandSourceStack> ctx) {
int linkId = ctx.getArgument("code", Integer.class);
int linkId = IntegerArgumentType.getInteger(ctx, "code");

Player player = getPlayer(ctx);

Expand Down

0 comments on commit 4cf344a

Please sign in to comment.