This commit is contained in:
boy0001 2014-10-28 13:34:22 +11:00
parent 595db4a51f
commit 64314723c9
3 changed files with 15 additions and 12 deletions

4
.gitignore vendored
View File

@ -92,4 +92,6 @@ local.properties
*.ear *.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
.classpath
.project

View File

@ -143,11 +143,11 @@ public class PlotMain extends JavaPlugin {
*/ */
public static int hasPermissionRange(Player player, String stub, int range) { public static int hasPermissionRange(Player player, String stub, int range) {
if (player==null || player.isOp()) { if (player==null || player.isOp()) {
return range; return Integer.MAX_VALUE;
} }
if (player.hasPermission(stub + ".*")) { if (player.hasPermission(stub + ".*")) {
return range; return Integer.MAX_VALUE;
} }
for (int i = range; i > 0; i--) { for (int i = range; i > 0; i--) {
if (player.hasPermission(stub + "." + i)) { if (player.hasPermission(stub + "." + i)) {
return i; return i;

View File

@ -100,20 +100,21 @@ public class Claim extends SubCommand {
} }
PlotWorld world = PlotMain.getWorldSettings(plot.getWorld()); PlotWorld world = PlotMain.getWorldSettings(plot.getWorld());
if (world.SCHEMATIC_ON_CLAIM) { if (world.SCHEMATIC_ON_CLAIM) {
SchematicHandler handler = new SchematicHandler();
SchematicHandler.Schematic sch; SchematicHandler.Schematic sch;
if (schematic.equals("")) { if (schematic.equals("")) {
sch = handler.getSchematic(world.SCHEMATIC_FILE); sch = SchematicHandler.getSchematic(world.SCHEMATIC_FILE);
} }
else { else {
sch = handler.getSchematic(schematic); sch = SchematicHandler.getSchematic(schematic);
if (sch == null) { if (sch == null) {
sch = handler.getSchematic(world.SCHEMATIC_FILE); sch = SchematicHandler.getSchematic(world.SCHEMATIC_FILE);
} }
} }
handler.paste(player.getLocation(), sch, plot); SchematicHandler.paste(player.getLocation(), sch, plot);
}
if (world.DEFAULT_FLAGS != null && world.DEFAULT_FLAGS.size() > 0) {
plot.settings.setFlags(FlagManager.parseFlags(PlotMain.getWorldSettings(player.getWorld()).DEFAULT_FLAGS));
} }
plot.settings.setFlags(FlagManager.parseFlags(PlotMain.getWorldSettings(player.getWorld()).DEFAULT_FLAGS));
} }
return event.isCancelled(); return event.isCancelled();
} }