PyvesB / advanced-achievements

:fireworks: Popular plugin that adds unique and challenging achievements to Minecraft servers.
https://www.spigotmc.org/resources/83466
GNU General Public License v3.0
199 stars 215 forks source link

People can get achievements without losing any items #117

Closed seedie closed 7 years ago

seedie commented 7 years ago

People getting achievements in world guard protected zones. Example is the fertiliser one, people can spam bonemeal on a patch of grass in a protected region and it will increase their counter without removing the bonemeal. I do want people to get achievements in protected areas, but not if it doesn't remove the items they use. Thanks.

PyvesB commented 7 years ago

Hello,

These type of issues are normally handled since the early days of the plugin. I have not been able to reproduce the reported issue using WorldGuard 6.1.2, its default configuration and a zone in which building is denied.

All event listeners in Advanced Achievements are protected with the @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true), meaning that an action will not be taken into account by Advanced Achievements if another plugin cancels it, provided the plugin cancelling the action does things correctly and does not violate the Bukkit API.

Please ensure you are using the latest version of World Guard and the latest Spigot build, and that you have set up all configurations correctly.

Cheers,

Pyves

seedie commented 7 years ago

I am not on the latest Spigot, but I am on the latest World Guard and Advanced Achievements. Try it in a region with the following flags:

use: allow, interact: allow

after adding an owner to the region that is not testing this.

PyvesB commented 7 years ago

You have set interact: allow, therefore the user is allowed to interact with his environment using bone meal. In game, you can see the green sparkling of a bone meal being used, indicating that fertilisation was successful. As the player is not owner of the zone, only the consequence of the action is cancelled by World Guard, in other words new blocks being added to the environment (for instance grass in the case of fertilising) and the bonemeal being consumed. World Guard will say as default message "Sorry, you can't place that block here"; fertilising has happened, its effects were later on cancelled by World Guard. The server sends a "message" to Advanced Achievements stating that the player successfully interacted with his environment using bone meal, Advanced Achievements cannot know whether a plugin will later decide to revert the effects of the successful fertilisation.

If you set interact: deny, the fertilising will no longer happen. The fertilising animation will not appear in game (black smoke instead). World Guard will say "Sorry, but you can't use that here", cancelling the fertilising before it happens, instead of cancelling the effects once the fertilising has happened. This is the correct way to proceed and you should correctly set your World Guard flags keeping this in mind.

seedie commented 7 years ago

Thanks for looking into this for me, I was hoping there would be a way for Advanced Achievements to realise the action was cancelled by another plugin and then also revert the counter. I knew changing the flags on my regions would solve it but I was hoping it wouldn't come to that. Thanks again.

PyvesB commented 7 years ago

Sorry I couldn't come up with a more convenient solution. If changing the flags is an option, I would recommend going through the process even if it's tedious. In addition to making Advanced Achievements "happier", you will have a more logical visual effect when the usage of bone meal is blocked and a more relevant message ("Sorry, you can't place that block here" is confusing from my point of view in this scenario). ;-)