Compare commits

..

7 Commits

Author SHA1 Message Date
9fa28e1179 * 2016-06-20 01:50:43 +10:00
c3dd28caeb Fix clear done flag requirements 2016-06-20 01:49:35 +10:00
0888940307 bump version 2016-06-20 01:37:27 +10:00
ce7468e63a Fix economy NPE 2016-06-20 00:52:05 +10:00
f5e7d08ace Allow duplicates after 5s 2016-06-19 16:14:13 +10:00
3ce225c044 Bump version 2016-06-19 15:51:46 +10:00
c2f10a7065 Update desc for debugpaste 2016-06-19 13:44:14 +10:00
10 changed files with 27 additions and 22 deletions

View File

@ -67,8 +67,9 @@ public class BukkitPlayer extends PlotPlayer {
@Override @Override
public void sendMessage(String message) { public void sendMessage(String message) {
if (!StringMan.isEqual(this.<String>getMeta("lastMessage"), message)) { if (!StringMan.isEqual(this.<String>getMeta("lastMessage"), message) || (System.currentTimeMillis() - this.<Long>getMeta("lastMessageTime") > 5000)) {
setMeta("lastMessage", message); setMeta("lastMessage", message);
setMeta("lastMessageTime", System.currentTimeMillis());
this.player.sendMessage(message); this.player.sendMessage(message);
} }
} }

View File

@ -36,7 +36,7 @@ public class Clear extends Command {
final Plot plot = check(player.getCurrentPlot(), C.NOT_IN_PLOT); final Plot plot = check(player.getCurrentPlot(), C.NOT_IN_PLOT);
checkTrue(plot.isOwner(player.getUUID()) || Permissions.hasPermission(player, "plots.admin.command.clear"), C.NO_PLOT_PERMS); checkTrue(plot.isOwner(player.getUUID()) || Permissions.hasPermission(player, "plots.admin.command.clear"), C.NO_PLOT_PERMS);
checkTrue(plot.getRunning() == 0, C.WAIT_FOR_TIMER); checkTrue(plot.getRunning() == 0, C.WAIT_FOR_TIMER);
checkTrue((!Flags.DONE.isSet(plot) || Permissions.hasPermission(player, "plots.continue")) && (!Settings.Done.COUNTS_TOWARDS_LIMIT || player.getAllowedPlots() >= player.getPlotCount() + plot.getConnectedPlots().size()), C.DONE_ALREADY_DONE); checkTrue(!Settings.Done.RESTRICT_BUILDING || !Flags.DONE.isSet(plot) || Permissions.hasPermission(player, "plots.continue"), C.DONE_ALREADY_DONE);
confirm.run(this, new Runnable() { confirm.run(this, new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -15,7 +15,7 @@ import java.io.IOException;
@CommandDeclaration(command = "debugpaste", @CommandDeclaration(command = "debugpaste",
aliases = "dp", usage = "/plot debugpaste", aliases = "dp", usage = "/plot debugpaste",
description = "Upload settings.yml & latest.log to HasteBin", description = "Upload settings.yml, worlds.yml, commands.yml and latest.log to www.hastebin.com",
permission = "plots.debugpaste", permission = "plots.debugpaste",
category = CommandCategory.DEBUG) category = CommandCategory.DEBUG)
public class DebugPaste extends SubCommand { public class DebugPaste extends SubCommand {

View File

@ -3,6 +3,7 @@ package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.ConsolePlayer; import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.Expression;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea; import com.intellectualcrafters.plot.object.PlotArea;
@ -158,8 +159,9 @@ public class MainCommand extends Command {
if (EconHandler.manager != null) { if (EconHandler.manager != null) {
PlotArea area = player.getApplicablePlotArea(); PlotArea area = player.getApplicablePlotArea();
if (area != null) { if (area != null) {
Double price = area.PRICES.get(cmd.getFullId()).evalute(0d); Expression<Double> priceEval = area.PRICES.get(cmd.getFullId());
if (price != null && EconHandler.manager.getMoney(player) < price) { Double price = priceEval != null ? priceEval.evalute(0d) : 0d;
if (price != 0d && EconHandler.manager.getMoney(player) < price) {
if (failure != null) { if (failure != null) {
failure.run(); failure.run();
} }

View File

@ -261,10 +261,6 @@ public class Settings extends Config {
public static boolean DISABLE_OFFLINE = false; public static boolean DISABLE_OFFLINE = false;
} }
/*
END OF CONFIGURATION SECTION:
*/
public static final class Claim { public static final class Claim {
@Comment("The max plots claimed in a single `/plot auto <size>` command") @Comment("The max plots claimed in a single `/plot auto <size>` command")
public static int MAX_AUTO_AREA = 4; public static int MAX_AUTO_AREA = 4;

View File

@ -1,5 +1,6 @@
package com.plotsquared.general.commands; package com.plotsquared.general.commands;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.commands.CommandCategory; import com.intellectualcrafters.plot.commands.CommandCategory;
import com.intellectualcrafters.plot.commands.MainCommand; import com.intellectualcrafters.plot.commands.MainCommand;
@ -176,25 +177,26 @@ public abstract class Command {
options.put("usage", declaration.usage()); options.put("usage", declaration.usage());
options.put("confirmation", declaration.confirmation()); options.put("confirmation", declaration.confirmation());
boolean set = false; boolean set = false;
YamlConfiguration commands = PS.get() == null ? new YamlConfiguration() : PS.get().commands;
for (Map.Entry<String, Object> entry : options.entrySet()) { for (Map.Entry<String, Object> entry : options.entrySet()) {
String key = this.getFullId() + "." + entry.getKey(); String key = this.getFullId() + "." + entry.getKey();
if (!PS.get().commands.contains(key)) { if (!commands.contains(key)) {
PS.get().commands.set(key, entry.getValue()); commands.set(key, entry.getValue());
set = true; set = true;
} }
} }
if (set) { if (set && PS.get() != null) {
try { try {
PS.get().commands.save(PS.get().commandsFile); commands.save(PS.get().commandsFile);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
this.aliases = PS.get().commands.getStringList(this.getFullId() + ".aliases"); this.aliases = commands.getStringList(this.getFullId() + ".aliases");
this.description = PS.get().commands.getString(this.getFullId() + ".description"); this.description = commands.getString(this.getFullId() + ".description");
this.usage = PS.get().commands.getString(this.getFullId() + ".usage"); this.usage = commands.getString(this.getFullId() + ".usage");
this.confirmation = PS.get().commands.getBoolean(this.getFullId() + ".confirmation"); this.confirmation = commands.getBoolean(this.getFullId() + ".confirmation");
if (this.parent != null) { if (this.parent != null) {
this.parent.register(this); this.parent.register(this);
} }
@ -432,6 +434,9 @@ public abstract class Command {
} }
public boolean canExecute(PlotPlayer player, boolean message) { public boolean canExecute(PlotPlayer player, boolean message) {
if (player == null) {
return true;
}
if (!this.required.allows(player)) { if (!this.required.allows(player)) {
if (message) { if (message) {
MainUtil.sendMessage(player, this.required == RequiredType.PLAYER ? C.IS_CONSOLE : C.NOT_CONSOLE); MainUtil.sendMessage(player, this.required == RequiredType.PLAYER ? C.IS_CONSOLE : C.NOT_CONSOLE);

View File

@ -74,8 +74,9 @@ public class SpongePlayer extends PlotPlayer {
@Override @Override
public void sendMessage(String message) { public void sendMessage(String message) {
if (!StringMan.isEqual(this.<String>getMeta("lastMessage"), message)) { if (!StringMan.isEqual(this.<String>getMeta("lastMessage"), message) || (System.currentTimeMillis() - this.<Long>getMeta("lastMessageTime") > 5000)) {
setMeta("lastMessage", message); setMeta("lastMessage", message);
setMeta("lastMessageTime", System.currentTimeMillis());
this.player.sendMessage(ChatTypes.CHAT, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(message)); this.player.sendMessage(ChatTypes.CHAT, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(message));
} }
} }

View File

@ -34,8 +34,8 @@ public class GenChunk extends ScopedLocalBlockQueue {
return; return;
} }
BiomeType biome = SpongeUtil.getBiome(biomeName.toUpperCase()); BiomeType biome = SpongeUtil.getBiome(biomeName.toUpperCase());
for (int x = 0; x <= 15; x++) { for (int x = 0; x < 16; x++) {
for (int z = 0; z < 15; z++) { for (int z = 0; z < 16; z++) {
this.biome.setBiome(this.bx + x, this.bz + z, biome); this.biome.setBiome(this.bx + x, this.bz + z, biome);
} }
} }

View File

@ -19,7 +19,7 @@ ext {
git = Grgit.open(file(".git")) git = Grgit.open(file(".git"))
revision = "-${git.head().abbreviatedId}" revision = "-${git.head().abbreviatedId}"
} }
version = "3.4.1${revision}" version = "3.4.3${revision}"
description = """PlotSquared""" description = """PlotSquared"""
subprojects { subprojects {

View File

@ -7,7 +7,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<artifactId>PlotSquared</artifactId> <artifactId>PlotSquared</artifactId>
<version>3.4.1-SNAPSHOT</version> <version>3.4.3-SNAPSHOT</version>
<name>PlotSquared</name> <name>PlotSquared</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>