PlotSquared icon indicating copy to clipboard operation
PlotSquared copied to clipboard

feature: add flag for beacon effects of other plots

Open DerEingerostete opened this issue 3 years ago • 9 comments

Overview

Adds a Plot Flag that enables players to disable beacon effects from other plots Fixes #3626

Description

Adds the new Plot Flag "beacon-effects" to toggle beacon effects from other plots. By default beacon effects from other plots are enabled but can be toggled off by setting this flag to false. Note: Works only on Paper (requires the BeaconEffectEvent from Paper)

Submitter Checklist

  • [X] Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • [X] Ensure that the pull request title represents the desired changelog entry.
  • [X] New public fields and methods are annotated with @since TODO.
  • [X] I read and followed the contribution guidelines.

DerEingerostete avatar May 18 '22 18:05 DerEingerostete

I think it would also be a good idea to add a global prevention for beacon effects "leaking" out of plots, able to be enabled/disabled under the paper block in settings.yml (probably enabled by default). This way, beacons can still affect players in their own plot, but they will not be affected by beacons in other plots and vice versa.

dordsor21 avatar May 19 '22 12:05 dordsor21

I'm not sure if the option/flag names are user-friendly. Now we have the following setup:

  • Config option "BEACON_EFFECTS", true by default = Prevent cross plot beacon effects, if it's true
  • Flag "BeaconEffect", true by default = Prevent cross plot beacon effects, if it's true

RedstoneFuture avatar May 21 '22 21:05 RedstoneFuture

I'm not sure if the option/flag names are user-friendly. Now we have the following setup:

* Config option "BEACON_EFFECTS", `true` by default = Prevent cross plot beacon effects, if it's `true`

* Flag "BeaconEffect", `true` by default = Prevent cross plot beacon effects, if it's `true`

Should I remove the flag and only keep the setting or should we change the description for the flag?

DerEingerostete avatar May 21 '22 23:05 DerEingerostete

Works out nicely overall, thanks for addressing the outstanding concerns.

Minor nit: The settings.yml option should consider PlayerLeavePlotEvent, otherwise players can step on the plot, grab the effect and leave again, which kinda defeats the purpose of the flag.

NotMyFault avatar Jun 14 '22 13:06 NotMyFault

Works out nicely overall, thanks for addressing the outstanding concerns.

Minor nit: The settings.yml option should consider PlayerLeavePlotEvent, otherwise players can step on the plot, grab the effect and leave again, which kinda defeats the purpose of the flag.

Okay will remember that and change it. Is this event an event working with the Bukkit EventHandler or do I need a special class/listener?

DerEingerostete avatar Jun 14 '22 14:06 DerEingerostete

You can add it to the plotExit method in com.plotsquared.core.listener.PlotListener

dordsor21 avatar Jun 14 '22 14:06 dordsor21

You can add it to the plotExit method in com.plotsquared.core.listener.PlotListener

This saidly dosen't work because the player abstraction dosen't have a remove effect mathod. Should I add one or rather register a own listener in the Bukkit module?

DerEingerostete avatar Jun 22 '22 11:06 DerEingerostete

It would probably be best to add it to the PlotPlayer

dordsor21 avatar Jun 25 '22 08:06 dordsor21

Thanks for addressing the outstandign concerns, looks promising so far!

NotMyFault avatar Jul 24 '22 16:07 NotMyFault

What's the status of this PR? The changes requested have been addressed and there is no more blocking feedback that prevents a merge. Shall we include this in next week's release?

NotMyFault avatar Aug 19 '22 17:08 NotMyFault

No further reviews after an explicit request imply this PR is ready to go, thanks for your contribution!

NotMyFault avatar Sep 05 '22 18:09 NotMyFault