Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

added permissions.interact to allows player interaction when build is false #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leagris
Copy link

@leagris leagris commented Mar 26, 2012

New permission node:
permissions.interact:
description: Allows player to interact when build is false.
default: false

  permissions.interact:
    description: Allows player to interact when build is false.
    default: false
@credomane
Copy link
Contributor

No offense but isn't that the opposite of the problem I just mentioned in #8 ?

Instead of being unable to build when permissions.interact is false and permissions.build is true.
You can now interact when permissions.interact is false and permissions.build is true.

I'm at work so I can't test it to be completely certain but that is what it looks like.

@leagris
Copy link
Author

leagris commented Mar 26, 2012

On 03/26/2012 5:33pm, Credomane Evonguard wrote:

No offense but isn't that the opposite of the problem I just mentioned in #8 ?
Instead of being unable to build when permissions.interact is false and permissions.build is true.
You can now interact when permissions.interact is false and permissions.build is true.
You can now interact wether permissions.interact is true or
permissions.buid is true:

The following rules in bool algebra, de Morgan theorem, applies here:
NOT(A) AND NOT(B) = NOT(A OR B)

NOT(A) AND NOT(B):

if (!event.getPlayer().hasPermission("permissions.build")&&!event.getPlayer().hasPermission("permissions.interact"))
{
   bother(event.getPlayer());
   event.setCancelled(true);
}

IF has NOT(build permission) AND has NOT(interact permission)
THEN block interaction by cancelling the onPlayerInteract event

This equals to:

NOT(A OR B)

IF has NOT(build OR interact permission)
THEN block interaction by cancelling the interact event

Equivalent to:

IF has either build OR interact permission
THEN let interaction go by letting the event through.

I think there is no much use of denying interactions for players able to build.
So, either build or interact permission will allow interaction.

The interact permission has been set to default false to ensure existing setup in config.yml will continue to act as in the current version. (players with explicit permissions.build false and implicit default permissions.interact false are blocked from interacting)
If you need to allow interaction for non-builders, then you need to explicitely set permissions.interact as true.

@credomane
Copy link
Contributor

I'm aware of how it all works. I just wasn't sure if I was missing part of the picture here or not.

I think there is no much use of denying interactions for players able to build.
So, either build or interact permission will allow interaction.

was the part of the picture I was missing. Was just trying to make sure I understood how and why it was the way it was. Sorry if I came off a little tart. :)

Off-topic, I also noticed that PermissionsBukkit doesn't have a way to prevent players from harming other entities. Had a few random players join the server and kill off many of the community farm animals. I've made an addition to PermissionsBukkit to prevent players without "permissions.entity" from harming any entity (meaning other players and NPCs). Granted this means they are defenseless to any attackers but on my server the spawn is monster-less and non-pvp. Should they wander outside of this fairly large safe area it is their own fault.

The more I work on extending PermissionsBukkit the more I think making a dedicated plugin to do all of this would be better. :/

@leagris
Copy link
Author

leagris commented Mar 26, 2012

I've made an addition to PermissionsBukkit to prevent players without "permissions.entity" from harming any entity (meaning other players and NPCs). Granted this means they are defenseless to any attackers but on my server the spawn is monster-less and non-pvp. Should they wander outside of this fairly large safe area it is their own fault.

It also means they miss the ability to sustain with animals meat.

The more I work on extending PermissionsBukkit the more I think making a dedicated plugin to do all of this would be better. :/

This feature would integrate quite well with WorldGuard region flags. It already provides consistent use and build flags I ended-up using instead of PermissionsBukkit due to this one here interact issue. Being able to separate hostile entities killing from others, or deny specific entity killing and then protect the motionless painting entities from dropping would be nice.
I agree, extending PermissionsBukkit too much out of a pure permission scope is a bad idea.

@dawninginnovations
Copy link

I would recommend that you let the permission system be that - a system to manage permissions. There are plenty region management plugins (e.g. Residence, WorldGuard, etc.) that provide much greater flexibility on what you can allow a player to do. As far as I know, the only purpose of the build restriction built into PermissionsBukkkit, was to provide some sort of protection for the lesser knowledgeable using PB for the first time, rather than immediately exposing their creations to griefing attacks.

@Lying-cake
Copy link

Did this get added to a dev build I can download from somewhere? I am looking for this feature but the version I have doesn't have these nodes. I am not sure how this pull request works, but will this be added in the future? Or better yet is there a way I can add this into my copy of permissionsbukkit?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants