CitizensDev / Citizens2

Citizens - the premier plugin and API for creating server-side NPCs in Minecraft.
https://citizensnpcs.co
Open Software License 3.0
589 stars 313 forks source link

The follow trait tries to protect regardless of paramater #2328

Closed mart-r closed 4 years ago

mart-r commented 4 years ago

The output of command /version on my server is: [10:30:03 INFO]: This server is running Paper version git-Paper-195 (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT) [10:30:03 INFO]: Checking version, please wait... [10:30:03 INFO]: Previous version: git-Paper-138 (MC: 1.16.1) [10:30:03 INFO]: You are running the latest version

The output of command /version citizens on my server is: [10:30:10 INFO]: Citizens version 2.0.27-SNAPSHOT (build 2113) [10:30:10 INFO]: Website: http://www.citizensnpcs.co [10:30:10 INFO]: Author: fullwall

When I create an npc and then use the /npc follow command, the NPC will try to protect me regardless of whether or not the -p parameter is added.

The same is true when doing this within a plugin (i.e the NPC will try to protect regardless of the second argument passed to FollowTrait#toggle).

If I've misunderstood the purpose/behaviour of the follow trait, then I apologize, but would kindly request I be educated on the matter.

mcmonkey4eva commented 4 years ago

Confirmed, it seems like protect is stuck on.

EDIT: Or rather the boolean is literally ignored.

The fix should be as simple as checking the protect boolean here: https://github.com/CitizensDev/Citizens2/blob/ab16b50814943f3b341fa9bde903885d18735c18/main/src/main/java/net/citizensnpcs/trait/FollowTrait.java#L45-L47

mcmonkey4eva commented 4 years ago

Fixed via https://github.com/CitizensDev/Citizens2/commit/450bff76ec8e679e6e3587141486bfe88a0361de for build 2117+