mirror of
https://github.com/YouHaveTrouble/BlockEdit.git
synced 2026-06-29 21:46:19 +00:00
some commands
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user