More changes

This commit is contained in:
boy0001 2015-02-19 19:51:10 +11:00
parent d227bcc739
commit fde378c965
96 changed files with 3323 additions and 1354 deletions

View file

@ -25,7 +25,7 @@ import net.milkbowl.vault.economy.Economy;
import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.PlotMain;
import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.Plot;
@ -48,20 +48,20 @@ public class Delete extends SubCommand {
if (!PlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(PlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return !sendMessage(plr, C.UNLINK_REQUIRED);
}
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.uuidWrapper.getUUID(plr)))) && !PlotMain.hasPermission(plr, "plots.admin.command.delete")) {
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.uuidWrapper.getUUID(plr)))) && !PlotSquared.hasPermission(plr, "plots.admin.command.delete")) {
return !sendMessage(plr, C.NO_PLOT_PERMS);
}
assert plot != null;
final PlotWorld pWorld = PlotMain.getWorldSettings(plot.getWorld());
if (PlotMain.useEconomy && pWorld.USE_ECONOMY && (plot != null) && plot.hasOwner() && plot.getOwner().equals(UUIDHandler.getUUID(plr))) {
final PlotWorld pWorld = PlotSquared.getWorldSettings(plot.getWorld());
if (PlotSquared.useEconomy && pWorld.USE_ECONOMY && (plot != null) && plot.hasOwner() && plot.getOwner().equals(UUIDHandler.getUUID(plr))) {
final double c = pWorld.SELL_PRICE;
if (c > 0d) {
final Economy economy = PlotMain.economy;
final Economy economy = PlotSquared.economy;
economy.depositPlayer(plr, c);
sendMessage(plr, C.ADDED_BALANCE, c + "");
}
}
final boolean result = PlotMain.removePlot(plr.getWorld().getName(), plot.id, true);
final boolean result = PlotSquared.removePlot(plr.getWorld().getName(), plot.id, true);
if (result) {
plot.clear(plr, true);
DBFunc.delete(plr.getWorld().getName(), plot);