mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fix plot claim.
This commit is contained in:
parent
546c4defb7
commit
100861484a
@ -132,7 +132,7 @@ public class Claim extends SubCommand {
|
||||
final String finalSchematic = schematic;
|
||||
DBFunc.createPlotSafe(plot, () -> TaskManager.IMP.sync(new RunnableVal<Object>() {
|
||||
@Override public void run(Object value) {
|
||||
if (!plot.claim(player, true, finalSchematic)) {
|
||||
if (!plot.claim(player, true, finalSchematic, false)) {
|
||||
PlotSquared.get().getLogger().log(Captions.PREFIX.getTranslated() +
|
||||
String.format("Failed to claim plot %s", plot.getId().toCommaSeparatedString()));
|
||||
sendMessage(player, Captions.PLOT_NOT_CLAIMED);
|
||||
|
@ -1752,7 +1752,7 @@ public class Plot {
|
||||
return this.create(this.owner, true);
|
||||
}
|
||||
|
||||
public boolean claim(final PlotPlayer player, boolean teleport, String schematic) {
|
||||
public boolean claim(@NotNull final PlotPlayer player, boolean teleport, String schematic) {
|
||||
if (!canClaim(player)) {
|
||||
PlotSquared.debug(Captions.PREFIX.getTranslated() + String
|
||||
.format("Player %s attempted to claim plot %s, but was not allowed",
|
||||
@ -1762,7 +1762,7 @@ public class Plot {
|
||||
return claim(player, teleport, schematic, true);
|
||||
}
|
||||
|
||||
public boolean claim(final PlotPlayer player, boolean teleport, String schematic,
|
||||
public boolean claim(@NotNull final PlotPlayer player, boolean teleport, String schematic,
|
||||
boolean updateDB) {
|
||||
|
||||
if (updateDB) {
|
||||
@ -2390,9 +2390,9 @@ public class Plot {
|
||||
* @param player the claiming player
|
||||
* @return
|
||||
*/
|
||||
public boolean canClaim(@Nullable PlotPlayer player) {
|
||||
public boolean canClaim(@NotNull PlotPlayer player) {
|
||||
PlotCluster cluster = this.getCluster();
|
||||
if (cluster != null && player != null) {
|
||||
if (cluster != null) {
|
||||
if (!cluster.isAdded(player.getUUID()) && !Permissions
|
||||
.hasPermission(player, "plots.admin.command.claim")) {
|
||||
return false;
|
||||
@ -2400,9 +2400,7 @@ public class Plot {
|
||||
}
|
||||
final UUID owner = this.guessOwner();
|
||||
if (owner != null) {
|
||||
if (player == null || !player.getUUID().equals(owner)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return !isMerged();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user