Add FixChunk command

This commit is contained in:
dfsek
2020-10-10 18:58:29 -07:00
parent 8e1dd75ae9
commit c91d2a46ed
4 changed files with 53 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
package com.dfsek.terra.command;
import com.dfsek.terra.generation.TerraChunkGenerator;
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 org.polydev.gaea.command.WorldCommand;
import java.util.Collections;
import java.util.List;
public class FixChunkCommand extends WorldCommand {
public FixChunkCommand(org.polydev.gaea.command.Command parent) {
super(parent);
}
@Override
public boolean execute(@NotNull Player player, @NotNull Command command, @NotNull String s, @NotNull String[] strings, World world) {
TerraChunkGenerator.fixChunk(player.getLocation().getChunk());
return true;
}
@Override
public String getName() {
return "fixchunk";
}
@Override
public List<org.polydev.gaea.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

@@ -23,7 +23,8 @@ public class TerraCommand extends Command {
new SaveDataCommand(this),
new StructureCommand(this),
new ImageCommand(this),
new GeometryCommand(this));
new GeometryCommand(this),
new FixChunkCommand(this));
public TerraCommand(GaeaPlugin main) {
super(main);