From 06fddfb6d11dce0e30520b31ad720758eccf17dd Mon Sep 17 00:00:00 2001 From: RedstoneFuture Date: Sat, 12 Oct 2024 17:19:24 +0200 Subject: [PATCH 1/5] Adding "weaving-death-place" flag --- .../bukkit/listener/EntityEventListener.java | 32 +++++- .../core/plot/flag/GlobalFlagContainer.java | 97 +------------------ .../implementations/WeavingDeathPlace.java | 39 ++++++++ Core/src/main/resources/lang/messages_en.json | 1 + 4 files changed, 69 insertions(+), 100 deletions(-) create mode 100644 Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeavingDeathPlace.java diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java index 771738fb59..5baf18dc2d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java @@ -32,11 +32,7 @@ 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.DisablePhysicsFlag; -import com.plotsquared.core.plot.flag.implementations.EntityChangeBlockFlag; -import com.plotsquared.core.plot.flag.implementations.ExplosionFlag; -import com.plotsquared.core.plot.flag.implementations.InvincibleFlag; -import com.plotsquared.core.plot.flag.implementations.ProjectileChangeBlockFlag; +import com.plotsquared.core.plot.flag.implementations.*; import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.PlotFlagUtil; @@ -243,6 +239,32 @@ public void onEntityFall(EntityChangeBlockEvent event) { } } + @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) + public void onWeavingEffect(EntityChangeBlockEvent event) { + if (event.getTo() != Material.COBWEB) { + return; + } + Block block = event.getBlock(); + World world = block.getWorld(); + String worldName = world.getName(); + if (!this.plotAreaManager.hasPlotArea(worldName)) { + return; + } + Location location = BukkitUtil.adapt(block.getLocation()); + PlotArea area = location.getPlotArea(); + if (area == null) { + return; + } + Plot plot = area.getOwnedPlotAbs(location); + + if (plot == null || !plot.getFlag(WeavingDeathPlace.class)) { + event.setCancelled(true); + if (plot != null) { + plot.debug("Falling block event was cancelled because weaving-death-place = false"); + } + } + } + @EventHandler(priority = EventPriority.HIGH) public void onDamage(EntityDamageEvent event) { if (event.getEntityType() != EntityType.PLAYER) { 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 bff2b0c8b8..63bbe114b0 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 @@ -19,101 +19,7 @@ package com.plotsquared.core.plot.flag; import com.google.common.base.Preconditions; -import com.plotsquared.core.plot.flag.implementations.AnalysisFlag; -import com.plotsquared.core.plot.flag.implementations.AnimalAttackFlag; -import com.plotsquared.core.plot.flag.implementations.AnimalCapFlag; -import com.plotsquared.core.plot.flag.implementations.AnimalInteractFlag; -import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag; -import com.plotsquared.core.plot.flag.implementations.BlockBurnFlag; -import com.plotsquared.core.plot.flag.implementations.BlockIgnitionFlag; -import com.plotsquared.core.plot.flag.implementations.BlockedCmdsFlag; -import com.plotsquared.core.plot.flag.implementations.BreakFlag; -import com.plotsquared.core.plot.flag.implementations.ChatFlag; -import com.plotsquared.core.plot.flag.implementations.ConcreteHardenFlag; -import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag; -import com.plotsquared.core.plot.flag.implementations.CoralDryFlag; -import com.plotsquared.core.plot.flag.implementations.CropGrowFlag; -import com.plotsquared.core.plot.flag.implementations.DenyExitFlag; -import com.plotsquared.core.plot.flag.implementations.DenyPortalTravelFlag; -import com.plotsquared.core.plot.flag.implementations.DenyPortalsFlag; -import com.plotsquared.core.plot.flag.implementations.DenyTeleportFlag; -import com.plotsquared.core.plot.flag.implementations.DescriptionFlag; -import com.plotsquared.core.plot.flag.implementations.DeviceInteractFlag; -import com.plotsquared.core.plot.flag.implementations.DisablePhysicsFlag; -import com.plotsquared.core.plot.flag.implementations.DoneFlag; -import com.plotsquared.core.plot.flag.implementations.DropProtectionFlag; -import com.plotsquared.core.plot.flag.implementations.EditSignFlag; -import com.plotsquared.core.plot.flag.implementations.EntityCapFlag; -import com.plotsquared.core.plot.flag.implementations.EntityChangeBlockFlag; -import com.plotsquared.core.plot.flag.implementations.ExplosionFlag; -import com.plotsquared.core.plot.flag.implementations.FarewellFlag; -import com.plotsquared.core.plot.flag.implementations.FeedFlag; -import com.plotsquared.core.plot.flag.implementations.FishingFlag; -import com.plotsquared.core.plot.flag.implementations.FlyFlag; -import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag; -import com.plotsquared.core.plot.flag.implementations.GamemodeFlag; -import com.plotsquared.core.plot.flag.implementations.GrassGrowFlag; -import com.plotsquared.core.plot.flag.implementations.GreetingFlag; -import com.plotsquared.core.plot.flag.implementations.GuestGamemodeFlag; -import com.plotsquared.core.plot.flag.implementations.HangingBreakFlag; -import com.plotsquared.core.plot.flag.implementations.HangingPlaceFlag; -import com.plotsquared.core.plot.flag.implementations.HealFlag; -import com.plotsquared.core.plot.flag.implementations.HideInfoFlag; -import com.plotsquared.core.plot.flag.implementations.HostileAttackFlag; -import com.plotsquared.core.plot.flag.implementations.HostileCapFlag; -import com.plotsquared.core.plot.flag.implementations.HostileInteractFlag; -import com.plotsquared.core.plot.flag.implementations.IceFormFlag; -import com.plotsquared.core.plot.flag.implementations.IceMeltFlag; -import com.plotsquared.core.plot.flag.implementations.InstabreakFlag; -import com.plotsquared.core.plot.flag.implementations.InvincibleFlag; -import com.plotsquared.core.plot.flag.implementations.ItemDropFlag; -import com.plotsquared.core.plot.flag.implementations.KeepFlag; -import com.plotsquared.core.plot.flag.implementations.KeepInventoryFlag; -import com.plotsquared.core.plot.flag.implementations.KelpGrowFlag; -import com.plotsquared.core.plot.flag.implementations.LeafDecayFlag; -import com.plotsquared.core.plot.flag.implementations.LecternReadBookFlag; -import com.plotsquared.core.plot.flag.implementations.LiquidFlowFlag; -import com.plotsquared.core.plot.flag.implementations.MiscBreakFlag; -import com.plotsquared.core.plot.flag.implementations.MiscCapFlag; -import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag; -import com.plotsquared.core.plot.flag.implementations.MiscPlaceFlag; -import com.plotsquared.core.plot.flag.implementations.MobBreakFlag; -import com.plotsquared.core.plot.flag.implementations.MobCapFlag; -import com.plotsquared.core.plot.flag.implementations.MobPlaceFlag; -import com.plotsquared.core.plot.flag.implementations.MusicFlag; -import com.plotsquared.core.plot.flag.implementations.MycelGrowFlag; -import com.plotsquared.core.plot.flag.implementations.NoWorldeditFlag; -import com.plotsquared.core.plot.flag.implementations.NotifyEnterFlag; -import com.plotsquared.core.plot.flag.implementations.NotifyLeaveFlag; -import com.plotsquared.core.plot.flag.implementations.PlaceFlag; -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.ProjectileChangeBlockFlag; -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; -import com.plotsquared.core.plot.flag.implementations.SculkSensorInteractFlag; -import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag; -import com.plotsquared.core.plot.flag.implementations.SnowFormFlag; -import com.plotsquared.core.plot.flag.implementations.SnowMeltFlag; -import com.plotsquared.core.plot.flag.implementations.SoilDryFlag; -import com.plotsquared.core.plot.flag.implementations.TamedAttackFlag; -import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag; -import com.plotsquared.core.plot.flag.implementations.TileDropFlag; -import com.plotsquared.core.plot.flag.implementations.TimeFlag; -import com.plotsquared.core.plot.flag.implementations.TitlesFlag; -import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag; -import com.plotsquared.core.plot.flag.implementations.UseFlag; -import com.plotsquared.core.plot.flag.implementations.VehicleBreakFlag; -import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag; -import com.plotsquared.core.plot.flag.implementations.VehiclePlaceFlag; -import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag; -import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag; -import com.plotsquared.core.plot.flag.implementations.VineGrowFlag; -import com.plotsquared.core.plot.flag.implementations.WeatherFlag; +import com.plotsquared.core.plot.flag.implementations.*; import org.checkerframework.checker.nullness.qual.NonNull; import java.util.Collections; @@ -207,6 +113,7 @@ private GlobalFlagContainer() { this.addFlag(VillagerInteractFlag.VILLAGER_INTERACT_FALSE); this.addFlag(VineGrowFlag.VINE_GROW_TRUE); this.addFlag(ProjectilesFlag.PROJECTILES_FALSE); + this.addFlag(WeavingDeathPlace.WEAVING_DEATH_PLACE_FALSE); // Double flags this.addFlag(PriceFlag.PRICE_NOT_BUYABLE); diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeavingDeathPlace.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeavingDeathPlace.java new file mode 100644 index 0000000000..3eb489c31e --- /dev/null +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeavingDeathPlace.java @@ -0,0 +1,39 @@ +/* + * PlotSquared, a land and world management plugin for Minecraft. + * Copyright (C) IntellectualSites + * Copyright (C) IntellectualSites team and contributors + * + * 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 WeavingDeathPlace extends BooleanFlag { + + public static final WeavingDeathPlace WEAVING_DEATH_PLACE_TRUE = new WeavingDeathPlace(true); + public static final WeavingDeathPlace WEAVING_DEATH_PLACE_FALSE = new WeavingDeathPlace(false); + + private WeavingDeathPlace(boolean value) { + super(value, TranslatableCaption.of("flags.flag_description_weaving_death_place")); + } + + @Override + protected WeavingDeathPlace flagOf(@NonNull Boolean value) { + return value ? WEAVING_DEATH_PLACE_TRUE : WEAVING_DEATH_PLACE_FALSE; + } + +} diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 5ea33d6a6f..51e825e526 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -628,6 +628,7 @@ "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_description_weaving_death_place": "Set to `false` to prevent spawning of cobwebs by the Weaving status effect on death of any entity.", "flags.flag_description_beacon_effect": "Enables beacon effects on the plot.", "flags.flag_error_boolean": "Flag value must be a boolean (true | false).", "flags.flag_error_enum": "Must be one of: ", From 8ad90b08f96d86739d990b7a716f8fc22a72be62 Mon Sep 17 00:00:00 2001 From: RedstoneFuture Date: Sat, 12 Oct 2024 19:04:49 +0200 Subject: [PATCH 2/5] Improving spelling of flag description --- Core/src/main/resources/lang/messages_en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 51e825e526..53e42cbad0 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -628,7 +628,7 @@ "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_description_weaving_death_place": "Set to `false` to prevent spawning of cobwebs by the Weaving status effect on death of any entity.", + "flags.flag_description_weaving_death_place": "Set to `false` to prevent spawning of cobwebs by the Weaving status effect on the death of an entity.", "flags.flag_description_beacon_effect": "Enables beacon effects on the plot.", "flags.flag_error_boolean": "Flag value must be a boolean (true | false).", "flags.flag_error_enum": "Must be one of: ", From 7ff8c185cae38e08e721d9077f9da4ce9e34b7a3 Mon Sep 17 00:00:00 2001 From: RedstoneFuture Date: Sat, 12 Oct 2024 21:05:20 +0200 Subject: [PATCH 3/5] Reworking event listener for Weaving effect --- .../bukkit/listener/EntityEventListener.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java index 5baf18dc2d..d18a2eaec7 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java @@ -244,24 +244,21 @@ public void onWeavingEffect(EntityChangeBlockEvent event) { if (event.getTo() != Material.COBWEB) { return; } - Block block = event.getBlock(); - World world = block.getWorld(); - String worldName = world.getName(); - if (!this.plotAreaManager.hasPlotArea(worldName)) { - return; - } - Location location = BukkitUtil.adapt(block.getLocation()); + Location location = BukkitUtil.adapt(event.getBlock().getLocation()); PlotArea area = location.getPlotArea(); if (area == null) { return; } - Plot plot = area.getOwnedPlotAbs(location); - - if (plot == null || !plot.getFlag(WeavingDeathPlace.class)) { - event.setCancelled(true); - if (plot != null) { - plot.debug("Falling block event was cancelled because weaving-death-place = false"); + Plot plot = location.getOwnedPlot(); + if (plot == null) { + if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, WeavingDeathPlace.class, false)) { + event.setCancelled(true); } + return; + } + if (plot.getFlag(WeavingDeathPlace.class)) { + plot.debug(event.getTo() + " could not spawn because weaving-death-place = false"); + event.setCancelled(true); } } From b7403a2f376661d69a96a1bbcdd7293951832858 Mon Sep 17 00:00:00 2001 From: RedstoneFuture Date: Sat, 12 Oct 2024 21:13:43 +0200 Subject: [PATCH 4/5] Undoing import optimization --- .../bukkit/listener/EntityEventListener.java | 7 +- .../core/plot/flag/GlobalFlagContainer.java | 97 ++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java index d18a2eaec7..4ae45c5f3f 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java @@ -32,7 +32,12 @@ 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.*; +import com.plotsquared.core.plot.flag.implementations.DisablePhysicsFlag; +import com.plotsquared.core.plot.flag.implementations.EntityChangeBlockFlag; +import com.plotsquared.core.plot.flag.implementations.ExplosionFlag; +import com.plotsquared.core.plot.flag.implementations.InvincibleFlag; +import com.plotsquared.core.plot.flag.implementations.ProjectileChangeBlockFlag; +import com.plotsquared.core.plot.flag.implementations.WeavingDeathPlace; import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.PlotFlagUtil; 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 63bbe114b0..3e704a021a 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 @@ -19,7 +19,102 @@ package com.plotsquared.core.plot.flag; import com.google.common.base.Preconditions; -import com.plotsquared.core.plot.flag.implementations.*; +import com.plotsquared.core.plot.flag.implementations.AnalysisFlag; +import com.plotsquared.core.plot.flag.implementations.AnimalAttackFlag; +import com.plotsquared.core.plot.flag.implementations.AnimalCapFlag; +import com.plotsquared.core.plot.flag.implementations.AnimalInteractFlag; +import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag; +import com.plotsquared.core.plot.flag.implementations.BlockBurnFlag; +import com.plotsquared.core.plot.flag.implementations.BlockIgnitionFlag; +import com.plotsquared.core.plot.flag.implementations.BlockedCmdsFlag; +import com.plotsquared.core.plot.flag.implementations.BreakFlag; +import com.plotsquared.core.plot.flag.implementations.ChatFlag; +import com.plotsquared.core.plot.flag.implementations.ConcreteHardenFlag; +import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag; +import com.plotsquared.core.plot.flag.implementations.CoralDryFlag; +import com.plotsquared.core.plot.flag.implementations.CropGrowFlag; +import com.plotsquared.core.plot.flag.implementations.DenyExitFlag; +import com.plotsquared.core.plot.flag.implementations.DenyPortalTravelFlag; +import com.plotsquared.core.plot.flag.implementations.DenyPortalsFlag; +import com.plotsquared.core.plot.flag.implementations.DenyTeleportFlag; +import com.plotsquared.core.plot.flag.implementations.DescriptionFlag; +import com.plotsquared.core.plot.flag.implementations.DeviceInteractFlag; +import com.plotsquared.core.plot.flag.implementations.DisablePhysicsFlag; +import com.plotsquared.core.plot.flag.implementations.DoneFlag; +import com.plotsquared.core.plot.flag.implementations.DropProtectionFlag; +import com.plotsquared.core.plot.flag.implementations.EditSignFlag; +import com.plotsquared.core.plot.flag.implementations.EntityCapFlag; +import com.plotsquared.core.plot.flag.implementations.EntityChangeBlockFlag; +import com.plotsquared.core.plot.flag.implementations.ExplosionFlag; +import com.plotsquared.core.plot.flag.implementations.FarewellFlag; +import com.plotsquared.core.plot.flag.implementations.FeedFlag; +import com.plotsquared.core.plot.flag.implementations.FishingFlag; +import com.plotsquared.core.plot.flag.implementations.FlyFlag; +import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag; +import com.plotsquared.core.plot.flag.implementations.GamemodeFlag; +import com.plotsquared.core.plot.flag.implementations.GrassGrowFlag; +import com.plotsquared.core.plot.flag.implementations.GreetingFlag; +import com.plotsquared.core.plot.flag.implementations.GuestGamemodeFlag; +import com.plotsquared.core.plot.flag.implementations.HangingBreakFlag; +import com.plotsquared.core.plot.flag.implementations.HangingPlaceFlag; +import com.plotsquared.core.plot.flag.implementations.HealFlag; +import com.plotsquared.core.plot.flag.implementations.HideInfoFlag; +import com.plotsquared.core.plot.flag.implementations.HostileAttackFlag; +import com.plotsquared.core.plot.flag.implementations.HostileCapFlag; +import com.plotsquared.core.plot.flag.implementations.HostileInteractFlag; +import com.plotsquared.core.plot.flag.implementations.IceFormFlag; +import com.plotsquared.core.plot.flag.implementations.IceMeltFlag; +import com.plotsquared.core.plot.flag.implementations.InstabreakFlag; +import com.plotsquared.core.plot.flag.implementations.InvincibleFlag; +import com.plotsquared.core.plot.flag.implementations.ItemDropFlag; +import com.plotsquared.core.plot.flag.implementations.KeepFlag; +import com.plotsquared.core.plot.flag.implementations.KeepInventoryFlag; +import com.plotsquared.core.plot.flag.implementations.KelpGrowFlag; +import com.plotsquared.core.plot.flag.implementations.LeafDecayFlag; +import com.plotsquared.core.plot.flag.implementations.LecternReadBookFlag; +import com.plotsquared.core.plot.flag.implementations.LiquidFlowFlag; +import com.plotsquared.core.plot.flag.implementations.MiscBreakFlag; +import com.plotsquared.core.plot.flag.implementations.MiscCapFlag; +import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag; +import com.plotsquared.core.plot.flag.implementations.MiscPlaceFlag; +import com.plotsquared.core.plot.flag.implementations.MobBreakFlag; +import com.plotsquared.core.plot.flag.implementations.MobCapFlag; +import com.plotsquared.core.plot.flag.implementations.MobPlaceFlag; +import com.plotsquared.core.plot.flag.implementations.MusicFlag; +import com.plotsquared.core.plot.flag.implementations.MycelGrowFlag; +import com.plotsquared.core.plot.flag.implementations.NoWorldeditFlag; +import com.plotsquared.core.plot.flag.implementations.NotifyEnterFlag; +import com.plotsquared.core.plot.flag.implementations.NotifyLeaveFlag; +import com.plotsquared.core.plot.flag.implementations.PlaceFlag; +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.ProjectileChangeBlockFlag; +import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag; +import com.plotsquared.core.plot.flag.implementations.WeavingDeathPlace; +import com.plotsquared.core.plot.flag.implementations.PveFlag; +import com.plotsquared.core.plot.flag.implementations.PvpFlag; +import com.plotsquared.core.plot.flag.implementations.RedstoneFlag; +import com.plotsquared.core.plot.flag.implementations.SculkSensorInteractFlag; +import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag; +import com.plotsquared.core.plot.flag.implementations.SnowFormFlag; +import com.plotsquared.core.plot.flag.implementations.SnowMeltFlag; +import com.plotsquared.core.plot.flag.implementations.SoilDryFlag; +import com.plotsquared.core.plot.flag.implementations.TamedAttackFlag; +import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag; +import com.plotsquared.core.plot.flag.implementations.TileDropFlag; +import com.plotsquared.core.plot.flag.implementations.TimeFlag; +import com.plotsquared.core.plot.flag.implementations.TitlesFlag; +import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag; +import com.plotsquared.core.plot.flag.implementations.UseFlag; +import com.plotsquared.core.plot.flag.implementations.VehicleBreakFlag; +import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag; +import com.plotsquared.core.plot.flag.implementations.VehiclePlaceFlag; +import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag; +import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag; +import com.plotsquared.core.plot.flag.implementations.VineGrowFlag; +import com.plotsquared.core.plot.flag.implementations.WeatherFlag; import org.checkerframework.checker.nullness.qual.NonNull; import java.util.Collections; From 5e0ee2e0e7e3660742896c516a9b1f065c2cd85e Mon Sep 17 00:00:00 2001 From: RedstoneFuture Date: Sat, 12 Oct 2024 21:21:58 +0200 Subject: [PATCH 5/5] Fixing weaving-death-place check for plots --- .../com/plotsquared/bukkit/listener/EntityEventListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java index 4ae45c5f3f..4a6c8c5e42 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java @@ -261,7 +261,7 @@ public void onWeavingEffect(EntityChangeBlockEvent event) { } return; } - if (plot.getFlag(WeavingDeathPlace.class)) { + if (!plot.getFlag(WeavingDeathPlace.class)) { plot.debug(event.getTo() + " could not spawn because weaving-death-place = false"); event.setCancelled(true); }