Merge branch 'breaking' into we

This commit is contained in:
Alexander Söderberg
2019-11-10 13:18:16 +01:00
committed by GitHub
7 changed files with 41 additions and 31 deletions

View File

@ -5,18 +5,18 @@ def textVersion = "3.0.2"
dependencies {
implementation("org.yaml:snakeyaml:1.25")
implementation("com.google.code.gson:gson:2.8.6") {
implementation("com.google.code.gson:gson:2.8.0") {
because("Minecraft uses GSON 2.8.0")
force = true
}
implementation("org.projectlombok:lombok:1.18.10")
implementation("org.projectlombok:lombok:1.18.8")
compileOnly("org.projectlombok:lombok:1.18.8")
testCompileOnly("org.projectlombok:lombok:1.18.8")
annotationProcessor("org.projectlombok:lombok:1.18.8")
testAnnotationProcessor("org.projectlombok:lombok:1.18.8")
implementation("com.github.Sauilitired:Jenkins4J:2.0-SNAPSHOT")
implementation("com.squareup.okhttp3:okhttp:4.2.2")
implementation("com.squareup.okio:okio:2.4.1")
implementation("com.squareup.okhttp3:okhttp:3.12.0")
implementation("com.squareup.okio:okio:2.2.2")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.50")
}

View File

@ -20,6 +20,10 @@ import java.util.UUID;
requiredType = RequiredType.NONE, confirmation = true) public class Owner extends SetCommand {
@Override public boolean set(final PlotPlayer player, final Plot plot, String value) {
if (value == null || value.isEmpty()) {
Captions.SET_OWNER_MISSING_PLAYER.send(player);
return false;
}
Set<Plot> plots = plot.getConnectedPlots();
UUID uuid = null;
String name = null;
@ -75,20 +79,18 @@ import java.util.UUID;
final String finalName = name;
final UUID finalUUID = uuid;
final boolean removeDenied = plot.isDenied(finalUUID);
Runnable run = new Runnable() {
@Override public void run() {
if (plot.setOwner(finalUUID, player)) {
if (removeDenied)
plot.removeDenied(finalUUID);
plot.setSign(finalName);
MainUtil.sendMessage(player, Captions.SET_OWNER);
if (other != null) {
MainUtil.sendMessage(other, Captions.NOW_OWNER,
plot.getArea() + ";" + plot.getId());
}
} else {
MainUtil.sendMessage(player, Captions.SET_OWNER_CANCELLED);
Runnable run = () -> {
if (plot.setOwner(finalUUID, player)) {
if (removeDenied)
plot.removeDenied(finalUUID);
plot.setSign(finalName);
MainUtil.sendMessage(player, Captions.SET_OWNER);
if (other != null) {
MainUtil.sendMessage(other, Captions.NOW_OWNER,
plot.getArea() + ";" + plot.getId());
}
} else {
MainUtil.sendMessage(player, Captions.SET_OWNER_CANCELLED);
}
};
if (hasConfirmation(player)) {

View File

@ -578,6 +578,7 @@ public enum Captions {
//<editor-fold desc="Set Owner">
SET_OWNER("$4You successfully set the plot owner", "Owner"),
SET_OWNER_CANCELLED("$2The set owner action was cancelled", "Owner"),
SET_OWNER_MISSING_PLAYER("$1You need to specify a new owner. Correct usage is: $2/plot setowner <owner>", "Owner"),
NOW_OWNER("$4You are now owner of plot %s", "Owner"),
//</editor-fold>
//<editor-fold desc="Signs">