mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fix ArrayIndexOutOfBoundsExceptions
Occured for /plot trust and /plot add
This commit is contained in:
parent
8d4f042abc
commit
83fa310fbb
@ -31,7 +31,6 @@ import com.intellectualcrafters.plot.util.Permissions;
|
|||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
import com.plotsquared.general.commands.Argument;
|
import com.plotsquared.general.commands.Argument;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@CommandDeclaration(
|
@CommandDeclaration(
|
||||||
@ -50,6 +49,10 @@ public class Add extends SubCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(PlotPlayer plr, String[] args) {
|
public boolean onCommand(PlotPlayer plr, String[] args) {
|
||||||
|
if (args.length != 1) {
|
||||||
|
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, this.getUsage());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Location loc = plr.getLocation();
|
Location loc = plr.getLocation();
|
||||||
Plot plot = loc.getPlotAbs();
|
Plot plot = loc.getPlotAbs();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
|
@ -29,7 +29,6 @@ import com.intellectualcrafters.plot.util.Permissions;
|
|||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
import com.plotsquared.general.commands.Argument;
|
import com.plotsquared.general.commands.Argument;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -51,7 +50,7 @@ public class Remove extends SubCommand {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCommand(PlotPlayer plr, String[] args) {
|
public boolean onCommand(PlotPlayer plr, String[] args) {
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot remove <player>");
|
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, this.getUsage());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Location loc = plr.getLocation();
|
Location loc = plr.getLocation();
|
||||||
|
@ -31,7 +31,6 @@ import com.intellectualcrafters.plot.util.Permissions;
|
|||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
import com.plotsquared.general.commands.Argument;
|
import com.plotsquared.general.commands.Argument;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@CommandDeclaration(
|
@CommandDeclaration(
|
||||||
@ -49,7 +48,10 @@ public class Trust extends SubCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(PlotPlayer plr, String[] args) {
|
public boolean onCommand(PlotPlayer plr, String[] args) {
|
||||||
|
if (args.length != 1) {
|
||||||
|
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, this.getUsage());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Location loc = plr.getLocation();
|
Location loc = plr.getLocation();
|
||||||
Plot plot = loc.getPlotAbs();
|
Plot plot = loc.getPlotAbs();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user