some commands

This commit is contained in:
YouHaveTrouble
2021-07-27 03:25:25 +02:00
parent 8fb1a36a07
commit c6b2ce2349
9 changed files with 112 additions and 72 deletions
@@ -0,0 +1,28 @@
package me.youhavetrouble.blockedit.commands;
import me.youhavetrouble.blockedit.BEPlayer;
import net.kyori.adventure.text.Component;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public class Pos2Command implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!(sender instanceof Player player)) return true;
BEPlayer bePlayer = BEPlayer.getByPlayer(player);
bePlayer.setSelectionPoint2(player.getLocation().toBlockLocation());
player.sendMessage(Component.text("Second point set at your location"));
return true;
}
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
return null;
}
}