-
-
Notifications
You must be signed in to change notification settings - Fork 367
Improve permission handling around interaction events #10599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: version/main
Are you sure you want to change the base?
Conversation
# Conflicts: # src/main/java/com/minecolonies/core/client/gui/townhall/WindowMainPage.java
src/main/java/com/minecolonies/core/client/gui/townhall/WindowMainPage.java
Show resolved
Hide resolved
Did you test this very well for all the permission things you changed, both where you should have and shouldn't have permission? It touches a lot of stuff, so it should be well tested |
I ensured that all events under every condition work as they should, I had a MP server open where I slowly granted the other player additional permissions to see if all the conditions worked as they should. Note: There are some odd behavioural ones, but that's unfortunate due to how Mojang calls these different events. |
src/main/java/com/minecolonies/core/event/PermissionEventHandler.java
Outdated
Show resolved
Hide resolved
@@ -52,6 +54,13 @@ public InteractionClose( | |||
this.key = key; | |||
} | |||
|
|||
@Override | |||
@Nullable | |||
public Action permissionNeeded() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all interactions need the same condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the reason I did this is because there is no reason for a message that closes a window to require any kind of permission level, on top of that the default is MANAGE_HUTS, which is wrong to begin with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, we should just have all interactions have the same and not have a new function in all of them for some edge case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an override, this method exists in the abstract message and is set by default to MANAGE_HUTS, I haven't added anything new, just lowered the permissions required for triggering this message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before merge, please do another SMP test and test some fundamental interactions with 2 colonies existing in the same world.
Changes proposed in this pull request
Testing
Review please