mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
finalize commands
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.dfsek.terra.bukkit.command.command;
|
||||
|
||||
import com.dfsek.terra.bukkit.command.WorldCommand;
|
||||
import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper;
|
||||
import com.dfsek.terra.bukkit.world.BukkitAdapter;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -17,7 +19,7 @@ public class FixChunkCommand extends WorldCommand {
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Player player, @NotNull Command command, @NotNull String s, @NotNull String[] strings, World world) {
|
||||
//MasterChunkGenerator.fixChunk(player.getLocation().getChunk());
|
||||
BukkitChunkGeneratorWrapper.fixChunk(BukkitAdapter.adapt(player.getLocation().getChunk()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.dfsek.terra.bukkit.command.command;
|
||||
|
||||
import com.dfsek.terra.bukkit.command.WorldCommand;
|
||||
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 OreCommand extends WorldCommand {
|
||||
public OreCommand(com.dfsek.terra.bukkit.command.Command parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args, World w) {
|
||||
/*
|
||||
Block bl = sender.getTargetBlockExact(25);
|
||||
if(args.length > 0) {
|
||||
OreConfig ore = TerraWorld.getWorld(w).getConfig().getOre(args[0]);
|
||||
if(ore == null) {
|
||||
LangUtil.send("command.ore.invalid-ore", sender, args[0]);
|
||||
return true;
|
||||
}
|
||||
if(bl == null) {
|
||||
LangUtil.send("command.ore.out-of-range", sender);
|
||||
return true;
|
||||
}
|
||||
Vector source = new Vector(FastMath.floorMod(bl.getX(), 16), bl.getY(), FastMath.floorMod(bl.getZ(), 16));
|
||||
ore.doVein(source, bl.getChunk(), new FastRandom());
|
||||
} else {
|
||||
LangUtil.send("command.ore.main-menu", sender);
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
|
||||
|
||||
// TODO: implementation
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "ore";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<com.dfsek.terra.bukkit.command.Command> getSubCommands() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int arguments() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.dfsek.terra.bukkit.command.command;
|
||||
import com.dfsek.terra.bukkit.BukkitCommandSender;
|
||||
import com.dfsek.terra.bukkit.command.Command;
|
||||
import com.dfsek.terra.bukkit.command.WorldCommand;
|
||||
import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper;
|
||||
import com.dfsek.terra.config.lang.LangUtil;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -39,7 +40,7 @@ public class SaveDataCommand extends WorldCommand {
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Player sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args, World w) {
|
||||
//TerraChunkGenerator.saveAll();
|
||||
BukkitChunkGeneratorWrapper.saveAll();
|
||||
LangUtil.send("debug.data-save", new BukkitCommandSender(sender), w.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.List;
|
||||
public class TerraCommand extends Command {
|
||||
private final List<Command> commands = Arrays.asList(new ReloadCommand(this),
|
||||
new BiomeCommand(this),
|
||||
new OreCommand(this),
|
||||
new ProfileCommand(this),
|
||||
new SaveDataCommand(this),
|
||||
new StructureCommand(this),
|
||||
|
||||
Reference in New Issue
Block a user