TF-PlotSquared/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugSaveTest.java

64 lines
2.1 KiB
Java
Raw Normal View History

2014-10-31 10:19:36 +11:00
/*
* Copyright (c) IntellectualCrafters - 2014. You are not allowed to distribute
* and/or monetize any of our intellectual property. IntellectualCrafters is not
* affiliated with Mojang AB. Minecraft is a trademark of Mojang AB.
*
* >> File = Claim.java >> Generated by: Citymonstret at 2014-08-09 01:41
*/
package com.intellectualcrafters.plot.commands;
import java.util.ArrayList;
import java.util.Set;
import java.util.UUID;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import com.google.common.collect.BiMap;
import com.intellectualcrafters.plot.C;
import com.intellectualcrafters.plot.FlagManager;
import com.intellectualcrafters.plot.PlayerFunctions;
import com.intellectualcrafters.plot.Plot;
import com.intellectualcrafters.plot.PlotHelper;
import com.intellectualcrafters.plot.PlotId;
import com.intellectualcrafters.plot.PlotMain;
import com.intellectualcrafters.plot.PlotManager;
import com.intellectualcrafters.plot.PlotWorld;
import com.intellectualcrafters.plot.SchematicHandler;
import com.intellectualcrafters.plot.StringWrapper;
import com.intellectualcrafters.plot.UUIDHandler;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.events.PlayerClaimPlotEvent;
/**
* @author Citymonstret
*/
public class DebugSaveTest extends SubCommand {
public DebugSaveTest() {
super(Command.DEBUGCLAIMTEST, "This debug command will force the recreation of all plots in the DB", "claim", CommandCategory.DEBUG, false);
}
@Override
public boolean execute(Player plr, String... args) {
if (plr==null) {
ArrayList<Plot> plots = new ArrayList<Plot>();
plots.addAll(PlotMain.getPlots());
DBFunc.createPlots(plots);
DBFunc.createAllSettingsAndHelpers(plots);
}
else {
PlayerFunctions.sendMessage(plr, "This debug command can only be executed by console as it has been deemed unsafe if abused.");
}
return true;
}
}