mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-05 23:24:43 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
9fa28e1179 | |||
c3dd28caeb | |||
0888940307 | |||
ce7468e63a | |||
f5e7d08ace | |||
3ce225c044 | |||
c2f10a7065 |
@ -67,8 +67,9 @@ public class BukkitPlayer extends PlotPlayer {
|
||||
|
||||
@Override
|
||||
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("lastMessageTime", System.currentTimeMillis());
|
||||
this.player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class Clear extends Command {
|
||||
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.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() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -15,7 +15,7 @@ import java.io.IOException;
|
||||
|
||||
@CommandDeclaration(command = "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",
|
||||
category = CommandCategory.DEBUG)
|
||||
public class DebugPaste extends SubCommand {
|
||||
|
@ -3,6 +3,7 @@ package com.intellectualcrafters.plot.commands;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.ConsolePlayer;
|
||||
import com.intellectualcrafters.plot.object.Expression;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotArea;
|
||||
@ -158,8 +159,9 @@ public class MainCommand extends Command {
|
||||
if (EconHandler.manager != null) {
|
||||
PlotArea area = player.getApplicablePlotArea();
|
||||
if (area != null) {
|
||||
Double price = area.PRICES.get(cmd.getFullId()).evalute(0d);
|
||||
if (price != null && EconHandler.manager.getMoney(player) < price) {
|
||||
Expression<Double> priceEval = area.PRICES.get(cmd.getFullId());
|
||||
Double price = priceEval != null ? priceEval.evalute(0d) : 0d;
|
||||
if (price != 0d && EconHandler.manager.getMoney(player) < price) {
|
||||
if (failure != null) {
|
||||
failure.run();
|
||||
}
|
||||
|
@ -261,10 +261,6 @@ public class Settings extends Config {
|
||||
public static boolean DISABLE_OFFLINE = false;
|
||||
}
|
||||
|
||||
/*
|
||||
END OF CONFIGURATION SECTION:
|
||||
*/
|
||||
|
||||
public static final class Claim {
|
||||
@Comment("The max plots claimed in a single `/plot auto <size>` command")
|
||||
public static int MAX_AUTO_AREA = 4;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.plotsquared.general.commands;
|
||||
|
||||
import com.intellectualcrafters.configuration.file.YamlConfiguration;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.commands.CommandCategory;
|
||||
import com.intellectualcrafters.plot.commands.MainCommand;
|
||||
@ -176,25 +177,26 @@ public abstract class Command {
|
||||
options.put("usage", declaration.usage());
|
||||
options.put("confirmation", declaration.confirmation());
|
||||
boolean set = false;
|
||||
YamlConfiguration commands = PS.get() == null ? new YamlConfiguration() : PS.get().commands;
|
||||
for (Map.Entry<String, Object> entry : options.entrySet()) {
|
||||
String key = this.getFullId() + "." + entry.getKey();
|
||||
if (!PS.get().commands.contains(key)) {
|
||||
PS.get().commands.set(key, entry.getValue());
|
||||
if (!commands.contains(key)) {
|
||||
commands.set(key, entry.getValue());
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
if (set) {
|
||||
if (set && PS.get() != null) {
|
||||
try {
|
||||
PS.get().commands.save(PS.get().commandsFile);
|
||||
commands.save(PS.get().commandsFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
this.aliases = PS.get().commands.getStringList(this.getFullId() + ".aliases");
|
||||
this.description = PS.get().commands.getString(this.getFullId() + ".description");
|
||||
this.usage = PS.get().commands.getString(this.getFullId() + ".usage");
|
||||
this.confirmation = PS.get().commands.getBoolean(this.getFullId() + ".confirmation");
|
||||
this.aliases = commands.getStringList(this.getFullId() + ".aliases");
|
||||
this.description = commands.getString(this.getFullId() + ".description");
|
||||
this.usage = commands.getString(this.getFullId() + ".usage");
|
||||
this.confirmation = commands.getBoolean(this.getFullId() + ".confirmation");
|
||||
if (this.parent != null) {
|
||||
this.parent.register(this);
|
||||
}
|
||||
@ -432,6 +434,9 @@ public abstract class Command {
|
||||
}
|
||||
|
||||
public boolean canExecute(PlotPlayer player, boolean message) {
|
||||
if (player == null) {
|
||||
return true;
|
||||
}
|
||||
if (!this.required.allows(player)) {
|
||||
if (message) {
|
||||
MainUtil.sendMessage(player, this.required == RequiredType.PLAYER ? C.IS_CONSOLE : C.NOT_CONSOLE);
|
||||
|
@ -74,8 +74,9 @@ public class SpongePlayer extends PlotPlayer {
|
||||
|
||||
@Override
|
||||
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("lastMessageTime", System.currentTimeMillis());
|
||||
this.player.sendMessage(ChatTypes.CHAT, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(message));
|
||||
}
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ public class GenChunk extends ScopedLocalBlockQueue {
|
||||
return;
|
||||
}
|
||||
BiomeType biome = SpongeUtil.getBiome(biomeName.toUpperCase());
|
||||
for (int x = 0; x <= 15; x++) {
|
||||
for (int z = 0; z < 15; z++) {
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
this.biome.setBiome(this.bx + x, this.bz + z, biome);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ ext {
|
||||
git = Grgit.open(file(".git"))
|
||||
revision = "-${git.head().abbreviatedId}"
|
||||
}
|
||||
version = "3.4.1${revision}"
|
||||
version = "3.4.3${revision}"
|
||||
description = """PlotSquared"""
|
||||
|
||||
subprojects {
|
||||
|
Reference in New Issue
Block a user