mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
more bug fixes
This commit is contained in:
parent
c3e271b22b
commit
0efb9d62ca
@ -156,6 +156,7 @@ public enum C {
|
|||||||
/*
|
/*
|
||||||
Claiming
|
Claiming
|
||||||
*/
|
*/
|
||||||
|
PLOT_NOT_CLAIMED("&cCannot claim plot"),
|
||||||
PLOT_IS_CLAIMED("&cThis plot is already claimed"),
|
PLOT_IS_CLAIMED("&cThis plot is already claimed"),
|
||||||
CLAIMED("&6You successfully claimed the plot"),
|
CLAIMED("&6You successfully claimed the plot"),
|
||||||
/*
|
/*
|
||||||
|
@ -7,7 +7,7 @@ public class Flag {
|
|||||||
private String key;
|
private String key;
|
||||||
private String value;
|
private String value;
|
||||||
public Flag(String key, String value) {
|
public Flag(String key, String value) {
|
||||||
if (!StringUtils.isAlphanumeric(key) || !StringUtils.isAlphanumeric(ChatColor.stripColor(value)))
|
if (!StringUtils.isAlphanumeric(key) || !StringUtils.isAlphanumeric(ChatColor.stripColor(value).replace(" ", "")))
|
||||||
throw new IllegalArgumentException("Flag must be alphanumerical");
|
throw new IllegalArgumentException("Flag must be alphanumerical");
|
||||||
if (key.length()>16)
|
if (key.length()>16)
|
||||||
throw new IllegalArgumentException("Key must be <= 16 characters");
|
throw new IllegalArgumentException("Key must be <= 16 characters");
|
||||||
|
@ -67,8 +67,8 @@ public class Auto extends SubCommand {
|
|||||||
id = new PlotId(x,z);
|
id = new PlotId(x,z);
|
||||||
if(PlotHelper.getPlot(world, id).owner == null) {
|
if(PlotHelper.getPlot(world, id).owner == null) {
|
||||||
Plot plot = PlotHelper.getPlot(world, id);
|
Plot plot = PlotHelper.getPlot(world, id);
|
||||||
Claim.claimPlot(plr, plot, true);
|
boolean result = Claim.claimPlot(plr, plot, true);
|
||||||
br = true;
|
br = result;
|
||||||
}
|
}
|
||||||
if(z < q && (z - x) < q) {
|
if(z < q && (z - x) < q) {
|
||||||
z++;
|
z++;
|
||||||
|
@ -11,6 +11,7 @@ package com.intellectualcrafters.plot.commands;
|
|||||||
|
|
||||||
import com.intellectualcrafters.plot.*;
|
import com.intellectualcrafters.plot.*;
|
||||||
import com.intellectualcrafters.plot.events.PlayerClaimPlotEvent;
|
import com.intellectualcrafters.plot.events.PlayerClaimPlotEvent;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -40,8 +41,13 @@ public class Claim extends SubCommand{
|
|||||||
PlayerFunctions.sendMessage(plr, C.PLOT_IS_CLAIMED);
|
PlayerFunctions.sendMessage(plr, C.PLOT_IS_CLAIMED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
claimPlot(plr, plot, false);
|
boolean result = claimPlot(plr, plot, false);
|
||||||
|
if (!result) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.PLOT_NOT_CLAIMED);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -61,6 +67,7 @@ public class Claim extends SubCommand{
|
|||||||
SchematicHandler.Schematic schematic = handler.getSchematic(world.SCHEMATIC_FILE);
|
SchematicHandler.Schematic schematic = handler.getSchematic(world.SCHEMATIC_FILE);
|
||||||
handler.paste(player.getLocation(), schematic, plot);
|
handler.paste(player.getLocation(), schematic, plot);
|
||||||
}
|
}
|
||||||
|
plot.settings.setFlags(PlotMain.getWorldSettings(player.getWorld()).DEFAULT_FLAGS);
|
||||||
}
|
}
|
||||||
return event.isCancelled();
|
return event.isCancelled();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user