Skip to content

Commit

Permalink
Fix missing required arg in teleport command:
Browse files Browse the repository at this point in the history
  • Loading branch information
md5sha256 committed Mar 17, 2024
1 parent a09d6f9 commit 44d8999
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import jakarta.inject.Singleton;
import me.wiefferink.areashop.MessageBridge;
import me.wiefferink.areashop.commands.util.AreashopCommandBean;
import me.wiefferink.areashop.commands.util.GeneralRegionParser;
import me.wiefferink.areashop.managers.IFileManager;
import me.wiefferink.areashop.regions.GeneralRegion;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
Expand All @@ -24,9 +26,12 @@ public class TeleportCommand extends AreashopCommandBean {
private static final CommandFlag<Void> KEY_TO_SIGN = CommandFlag.builder("to-sign").build();
private final MessageBridge messageBridge;

private final IFileManager fileManager;

@Inject
public TeleportCommand(@Nonnull MessageBridge messageBridge) {
public TeleportCommand(@Nonnull MessageBridge messageBridge, @Nonnull IFileManager fileManager) {
this.messageBridge = messageBridge;
this.fileManager = fileManager;
}

/**
Expand Down Expand Up @@ -65,6 +70,7 @@ public String stringDescription() {
protected Command.Builder<? extends CommandSender> configureCommand(@NotNull Command.Builder<CommandSender> builder) {
return builder.literal("teleport", "tp")
.senderType(Player.class)
.required(KEY_REGION, GeneralRegionParser.generalRegionParser(this.fileManager))
.handler(this::handleCommand);
}

Expand Down

0 comments on commit 44d8999

Please sign in to comment.