From d71c62771e6dafedc9332e601810660167e1d344 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 09:58:14 +0200 Subject: [PATCH 1/5] build: Update dependency org.checkerframework:checker-qual to v3.22.0 (#3595) Co-authored-by: Renovate Bot --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 537d3fb41..e62f8bcde 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ guava = "31.0.1-jre" # Version set by Minecraft # Platform expectations paper = "1.18.1-R0.1-SNAPSHOT" -checker-qual = "3.21.4" +checker-qual = "3.22.0" guice = "5.1.0" spotbugs = "4.6.0" snakeyaml = "1.30" # Version set by Bukkit From f49ddb819d69bbc2455c626b3ab9023f26d47883 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Wed, 4 May 2022 23:21:24 +0200 Subject: [PATCH 2/5] Add Plot flag for projectiles (#3581) * feature: add flag for projectiles * build: add License to ProjectilesFlag.java Co-authored-by: Alexander Brandes --- .../bukkit/listener/PaperListener.java | 17 ++++--- .../listener/ProjectileEventListener.java | 19 ++++---- .../core/plot/flag/GlobalFlagContainer.java | 2 + .../flag/implementations/ProjectilesFlag.java | 46 +++++++++++++++++++ Core/src/main/resources/lang/messages_en.json | 1 + 5 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ProjectilesFlag.java diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java index 012fee6ff..079d04fe3 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java @@ -44,6 +44,7 @@ import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.flag.implementations.DoneFlag; +import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag; import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.util.Permissions; import net.kyori.adventure.text.minimessage.Template; @@ -352,13 +353,15 @@ public class PaperListener implements Listener { event.setCancelled(true); } } else if (!plot.isAdded(pp.getUUID())) { - if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { - pp.sendMessage( - TranslatableCaption.of("permission.no_permission_event"), - Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) - ); - entity.remove(); - event.setCancelled(true); + if (!plot.getFlag(ProjectilesFlag.class)) { + if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { + pp.sendMessage( + TranslatableCaption.of("permission.no_permission_event"), + Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) + ); + entity.remove(); + event.setCancelled(true); + } } } } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ProjectileEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ProjectileEventListener.java index 8754c4520..a09cf6943 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ProjectileEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ProjectileEventListener.java @@ -35,6 +35,7 @@ import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotHandler; +import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag; import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.util.Permissions; import net.kyori.adventure.text.minimessage.Template; @@ -128,13 +129,15 @@ public class ProjectileEventListener implements Listener { event.setCancelled(true); } } else if (!plot.isAdded(pp.getUUID())) { - if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { - pp.sendMessage( - TranslatableCaption.of("permission.no_permission_event"), - Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) - ); - entity.remove(); - event.setCancelled(true); + if (!plot.getFlag(ProjectilesFlag.class)) { + if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { + pp.sendMessage( + TranslatableCaption.of("permission.no_permission_event"), + Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) + ); + entity.remove(); + event.setCancelled(true); + } } } } @@ -162,7 +165,7 @@ public class ProjectileEventListener implements Listener { return; } if (plot.isAdded(pp.getUUID()) || Permissions - .hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { + .hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(ProjectilesFlag.class)) { return; } entity.remove(); diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java b/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java index 3b7c572d7..052086464 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java @@ -93,6 +93,7 @@ import com.plotsquared.core.plot.flag.implementations.PlayerInteractFlag; import com.plotsquared.core.plot.flag.implementations.PlotTitleFlag; import com.plotsquared.core.plot.flag.implementations.PreventCreativeCopyFlag; import com.plotsquared.core.plot.flag.implementations.PriceFlag; +import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag; import com.plotsquared.core.plot.flag.implementations.PveFlag; import com.plotsquared.core.plot.flag.implementations.PvpFlag; import com.plotsquared.core.plot.flag.implementations.RedstoneFlag; @@ -198,6 +199,7 @@ public final class GlobalFlagContainer extends FlagContainer { this.addFlag(VehicleUseFlag.VEHICLE_USE_FALSE); this.addFlag(VillagerInteractFlag.VILLAGER_INTERACT_FALSE); this.addFlag(VineGrowFlag.VINE_GROW_TRUE); + this.addFlag(ProjectilesFlag.PROJECTILES_FALSE); // Double flags this.addFlag(PriceFlag.PRICE_NOT_BUYABLE); diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ProjectilesFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ProjectilesFlag.java new file mode 100644 index 000000000..a8953b084 --- /dev/null +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ProjectilesFlag.java @@ -0,0 +1,46 @@ +/* + * _____ _ _ _____ _ + * | __ \| | | | / ____| | | + * | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| | + * | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` | + * | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| | + * |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_| + * | | + * |_| + * PlotSquared plot management system for Minecraft + * Copyright (C) 2014 - 2022 IntellectualSites + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.plotsquared.core.plot.flag.implementations; + +import com.plotsquared.core.configuration.caption.TranslatableCaption; +import com.plotsquared.core.plot.flag.types.BooleanFlag; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class ProjectilesFlag extends BooleanFlag { + + public static final ProjectilesFlag PROJECTILES_TRUE = new ProjectilesFlag(true); + public static final ProjectilesFlag PROJECTILES_FALSE = new ProjectilesFlag(false); + + private ProjectilesFlag(boolean value){ + super(value, TranslatableCaption.of("flags.flag_description_projectiles")); + } + + @Override + protected ProjectilesFlag flagOf(@NonNull final Boolean value) { + return value ? PROJECTILES_TRUE : PROJECTILES_FALSE; + } + +} diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 50b3639df..bc189c8c9 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -613,6 +613,7 @@ "flags.flag_description_lectern_read_book": "Prevent players taking books from lecterns.", "flags.flag_description_prevent_creative_copy": "Prevents people from copying item NBT data in the plot unless they're added as members.", "flags.flag_description_leaf_decay": "Set to `false` to prevent leaves from decaying.", + "flags.flag_description_projectiles": "Prevents guests from shooting projectiles on the plot when set to false.", "flags.flag_error_boolean": "Flag value must be a boolean (true | false).", "flags.flag_error_enum": "Must be one of: ", "flags.flag_error_integer": "Flag value must be a whole positive number.", From 9db7791835500087a70344c6d898128189dcdffb Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Thu, 5 May 2022 09:58:14 +0200 Subject: [PATCH 3/5] build: Release 6.7.0 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index c21177f5f..8b0b11344 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { idea } -version = "6.6.4-SNAPSHOT" +version = "6.7.0" allprojects { group = "com.plotsquared" From 2aeacb3dcf82b80f1354b03984337b653245d90d Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Thu, 5 May 2022 10:07:58 +0200 Subject: [PATCH 4/5] build: Back to snapshot for development --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8b0b11344..2d9ebf0a0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { idea } -version = "6.7.0" +version = "6.7.1-SNAPSHOT" allprojects { group = "com.plotsquared" From faadebd30e77419d09b9caf07934a2e4c4e9b8e8 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sat, 7 May 2022 15:56:24 +0200 Subject: [PATCH 5/5] chore: Update my name (#3599) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2d9ebf0a0..2e6b65b31 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -140,7 +140,7 @@ allprojects { } developer { id.set("NotMyFault") - name.set("NotMyFault") + name.set("Alexander Brandes") organization.set("IntellectualSites") email.set("contact@notmyfault.dev") }