mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Why was this made private?
This commit is contained in:
parent
89442a0e77
commit
7bdcde6d24
@ -11,7 +11,7 @@ import java.sql.SQLException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
abstract class APlotMeConnector {
|
||||
public abstract class APlotMeConnector {
|
||||
|
||||
public abstract Connection getPlotMeConnection(FileConfiguration plotConfig, String dataFolder);
|
||||
|
||||
|
@ -33,19 +33,19 @@ public class Buy extends Command {
|
||||
check(EconHandler.manager, C.ECON_DISABLED);
|
||||
final Plot plot;
|
||||
if (args.length != 0) {
|
||||
check(args.length == 1, C.COMMAND_SYNTAX, getUsage());
|
||||
checkTrue(args.length == 1, C.COMMAND_SYNTAX, getUsage());
|
||||
plot = check(MainUtil.getPlotFromString(player, args[0], true), null);
|
||||
} else {
|
||||
plot = check(player.getCurrentPlot(), C.NOT_IN_PLOT);
|
||||
}
|
||||
check(plot.hasOwner(), C.PLOT_UNOWNED);
|
||||
check(!plot.isOwner(player.getUUID()), C.CANNOT_BUY_OWN);
|
||||
checkTrue(plot.hasOwner(), C.PLOT_UNOWNED);
|
||||
checkTrue(!plot.isOwner(player.getUUID()), C.CANNOT_BUY_OWN);
|
||||
Set<Plot> plots = plot.getConnectedPlots();
|
||||
check(player.getPlotCount() + plots.size() <= player.getAllowedPlots(), C.CANT_CLAIM_MORE_PLOTS);
|
||||
checkTrue(player.getPlotCount() + plots.size() <= player.getAllowedPlots(), C.CANT_CLAIM_MORE_PLOTS);
|
||||
Optional<Double> flag = plot.getFlag(Flags.PRICE);
|
||||
check(flag.isPresent(), C.NOT_FOR_SALE);
|
||||
checkTrue(flag.isPresent(), C.NOT_FOR_SALE);
|
||||
final double price = flag.get();
|
||||
check(player.getMoney() >= price, C.CANNOT_AFFORD_PLOT);
|
||||
checkTrue(player.getMoney() >= price, C.CANNOT_AFFORD_PLOT);
|
||||
player.withdraw(price);
|
||||
confirm.run(this, new Runnable() {
|
||||
@Override // Success
|
||||
|
Loading…
Reference in New Issue
Block a user