implement getUngeneratedBlock

This commit is contained in:
dfsek
2021-01-13 17:48:30 -07:00
parent e04d363123
commit 4bd943ae7b
3 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
package com.dfsek.terra.bukkit.command.command;
import com.dfsek.terra.bukkit.command.WorldCommand;
import com.dfsek.terra.bukkit.world.BukkitAdapter;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.Collections;
import java.util.List;
public class GetBlockCommand extends WorldCommand {
public GetBlockCommand(com.dfsek.terra.bukkit.command.Command parent) {
super(parent);
}
@Override
public boolean execute(@NotNull Player player, @NotNull Command command, @NotNull String s, @NotNull String[] strings, World world) {
player.sendMessage("Block: " + getMain().getWorld(BukkitAdapter.adapt(world)).getUngeneratedBlock(BukkitAdapter.adapt(player.getLocation())).getAsString());
return true;
}
@Override
public String getName() {
return "block";
}
@Override
public List<com.dfsek.terra.bukkit.command.Command> getSubCommands() {
return Collections.emptyList();
}
@Override
public int arguments() {
return 0;
}
@Override
public List<String> getTabCompletions(@NotNull CommandSender commandSender, @NotNull String s, @NotNull String[] strings) {
return Collections.emptyList();
}
}

View File

@@ -24,6 +24,7 @@ public class TerraCommand extends Command {
new GeometryCommand(this),
new FixChunkCommand(this),
new VersionCommand(this),
new GetBlockCommand(this),
new PacksCommand(this));
public TerraCommand(TerraPlugin main) {