mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-25 13:28:58 +02:00
Fix removing negative nodes
This commit is contained in:
@@ -390,7 +390,7 @@ public abstract class PermissionHolder {
|
|||||||
* @throws ObjectAlreadyHasException if the holder has this permission already
|
* @throws ObjectAlreadyHasException if the holder has this permission already
|
||||||
*/
|
*/
|
||||||
public void setPermission(Node node) throws ObjectAlreadyHasException {
|
public void setPermission(Node node) throws ObjectAlreadyHasException {
|
||||||
if (hasPermission(node, false) == Tristate.TRUE) {
|
if (hasPermission(node, false) != Tristate.UNDEFINED) {
|
||||||
throw new ObjectAlreadyHasException();
|
throw new ObjectAlreadyHasException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ public abstract class PermissionHolder {
|
|||||||
* @throws ObjectAlreadyHasException if the holder has this permission already
|
* @throws ObjectAlreadyHasException if the holder has this permission already
|
||||||
*/
|
*/
|
||||||
public void setTransientPermission(Node node) throws ObjectAlreadyHasException {
|
public void setTransientPermission(Node node) throws ObjectAlreadyHasException {
|
||||||
if (hasPermission(node, true) == Tristate.TRUE) {
|
if (hasPermission(node, true) != Tristate.UNDEFINED) {
|
||||||
throw new ObjectAlreadyHasException();
|
throw new ObjectAlreadyHasException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +442,7 @@ public abstract class PermissionHolder {
|
|||||||
* @throws ObjectLacksException if the holder doesn't have this node already
|
* @throws ObjectLacksException if the holder doesn't have this node already
|
||||||
*/
|
*/
|
||||||
public void unsetPermission(Node node) throws ObjectLacksException {
|
public void unsetPermission(Node node) throws ObjectLacksException {
|
||||||
if (hasPermission(node, false) != Tristate.TRUE) {
|
if (hasPermission(node, false) == Tristate.UNDEFINED) {
|
||||||
throw new ObjectLacksException();
|
throw new ObjectLacksException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ public abstract class PermissionHolder {
|
|||||||
* @throws ObjectLacksException if the holder doesn't have this node already
|
* @throws ObjectLacksException if the holder doesn't have this node already
|
||||||
*/
|
*/
|
||||||
public void unsetTransientPermission(Node node) throws ObjectLacksException {
|
public void unsetTransientPermission(Node node) throws ObjectLacksException {
|
||||||
if (hasPermission(node, true) == Tristate.FALSE) {
|
if (hasPermission(node, true) == Tristate.UNDEFINED) {
|
||||||
throw new ObjectLacksException();
|
throw new ObjectLacksException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user