aromaa / WorldGuardExtraFlags

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

Ignore Player NPC's for WG Handlers where it doesn't make sense to apply them #54

Closed bundabrg closed 5 years ago

bundabrg commented 6 years ago

Overview

Player NPC's (as created by https://github.com/CitizensDev/Citizens2) trigger events that don't apply to non-players.

For example I have WG regions to provide an alertbar title of the area a player is in using the Console-Commands-On-Entry, and also change the game-mode of the player in the same way (As I've never managed to get WG gamemode region flag to work since 1.13). I also have a bunch of NPC's that wander around doing jobs and they trip these as well generating lots of console spam, especially as their names have spaces which mucks up the command.

This merely adds a check in some handlers for the NPC Metadata attribute and will short-circuit out of it exists.

Closes

Closes #41

aromaa commented 6 years ago

NPC’s most likely should just ignore all the flags and move this to the permission check

bundabrg commented 5 years ago

Should I have NPC's ignore all flags? There may be advantages for some flags making sense for NPC's though off the top of my head I can't think of any (though it would be nice if NPC's respected WG region flags since they walk right through protected doors, but that's a WG issue)

aromaa commented 5 years ago

Hmh, why am I not getting any notifications from new messages, sorry for the late response.

I was thinking of the same thing at the first but then decided its best to ignore them all together. People mostly use NPCs that just stand still and they are supposed to be decorative or serves some purpose that opens GUIs. Those NPCs should not be effected at all by the regions.

The other purpose is to have them to do some actions, like move around and they have been purposely given the instructions to do so. At the end, if someone wants them to do actions inside region(s) this can be programmed into them.