aromaa / WorldGuardExtraFlags

Extension for the WorldGuard plugin.
https://www.spigotmc.org/resources/worldguard-extra-flags.4823
MIT License
88 stars 70 forks source link

Regarding allow-block-place & deny-block-break flags #226

Open aromaa opened 1 year ago

aromaa commented 1 year ago

TL;DR: If you are interested in these flags, thumps up EngineHub/WorldGuard#1690 to prioritize the issue. Do not spam the issue.

Originally the plugin supported allow-block-place and deny-block-break flags. Unfortunately these flags had to be removed due to the breaking changes made in Spigot for the Minecraft 1.13 release and more unfortunately these changes were inconsistencies between different APIs. These changes forced some internal changes in WG 7 which ultimately breaks the way WGEF was overriding WorldGuard's decision on whatever the block placement was successful or not. For more detailed technical explanation of the problem you can read the #152 (comment).

This lead to bugs like #152 where the plugin broke WG's protection in certain cases and there is no easy way to fix this in the plugin itself without opening can of worms and resulting to even more bugs related to these flags in the future. This would burden both the EngineHub's team who receive complains about regions misbehaving and mine trying to track them down.

Due to the complexity of dealing with block specific actions its best to implement this natively in the WorldGuard itself. The best course of action is to upvote EngineHub/WorldGuard#1690 to prioritize the issue. Please do not spam the issue. Leaving a thumps up is enough.

Workaround

You might be able to take advantage of permission context (https://luckperms.net/wiki/Context) with the help of the extra contexts extension (https://github.com/LuckPerms/ExtraContexts) and combining these with build permissions or plugins like Essentials to allow/denying placing specific blocks by permissions.

dandud100 commented 1 year ago

Workaround You might be able to take advantage of permission context (https://luckperms.net/wiki/Context) with the help of the extra contexts extension (https://github.com/LuckPerms/ExtraContexts) and combining these with build permissions or plugins like Essentials to allow/denying placing specific blocks by permissions.

Can you please provide an example what is defaultly needed to get basic interactions working again after doing this? I really struggled to get the easiest things working again...

If anyone ever stumbled upon this, just try it in a world first where you really need this and enable the worldguard permission feature just in the right world config. /plugins/WorldGuard/worlds/Arena1/config.yml for example. Do not do it in the global config.

#
# WorldGuard's world configuration file
#
# This is a world configuration file. Anything placed into here will only
# affect this world. If you don't put anything in this file, then the
# settings will be inherited from the main configuration file.
#
# If you see {} below, that means that there are NO entries in this file.
# Remove the {} and add your own entries.
#

regions:
    titles-always-use-default-times: true
build-permission-nodes:
    enable: true
    deny-message: ''

This are just the permissions needed to allow an user to fight, drop and pickup items and place tnt in an wg region called mobarena1. Maybe they aren't even enough... Also do not forget to do /rg flag mobarena1 block-place allow.

image

Maybe they aren't even enough, but i figured them out the hard way with a second player /lp verbose on worldguard, /lp verbose upload and a lot of headache.

Edit: Also do not forget to set the following to true in the /plugins/ExtraContexts/config.yml

# Provides the 'worldguard:region' and 'worldguard:in-region' contexts.
# Returns the name of each WorldGuard region the player is currently in.
#
# e.g. worldguard:in-region=true and worldguard:region=spawn
worldguard-region: true