Skip to content
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

(Feature) API - getOwner() in WarpRemoveEvent #91

Closed
Kryniowesegryderiusz opened this issue Jan 3, 2021 · 6 comments
Closed

(Feature) API - getOwner() in WarpRemoveEvent #91

Kryniowesegryderiusz opened this issue Jan 3, 2021 · 6 comments
Assignees

Comments

@Kryniowesegryderiusz
Copy link

Is your feature request related to a problem? Please describe.
I need for my own addon getting owner instance of Player of removed sign in WarpRemoveEvent. I'd love to see that <3

@tastybento
Copy link
Member

As the only player who can remove their sign is the sign's owner, the UUID of the owner is found by getRemover()

@Kryniowesegryderiusz
Copy link
Author

Kryniowesegryderiusz commented Jan 3, 2021

Not really, there is even permission for that.

String reqPerm = inWorld ? addon.getPermPrefix(b.getWorld()) + "mod.removesign" : Warp.WELCOME_WARP_SIGNS + ".mod.removesign";
return ((list.containsKey(player.getUniqueId()) && list.get(player.getUniqueId()).equals(b.getLocation()))
|| player.isOp() || player.hasPermission(reqPerm));

@tastybento
Copy link
Member

Okay, good point. I'll fix it.

@tastybento tastybento self-assigned this Jan 4, 2021
@tastybento tastybento added enhancement in progress the issue is being worked on labels Jan 4, 2021
tastybento added a commit that referenced this issue Jan 4, 2021
@tastybento tastybento added done and removed in progress the issue is being worked on labels Jan 4, 2021
@tastybento
Copy link
Member

Let me know if that works for you.

@Kryniowesegryderiusz
Copy link
Author

Maybe I'm doing something wrongly, but when I import warps as dependency it doesnt show me this method.

@tastybento
Copy link
Member

It's still in the development branch, so if you are using Maven then you need to use the SNAPSHOT until I release:

        <dependency>
            <groupId>world.bentobox</groupId>
            <artifactId>Warps</artifactId>
            <version>Warps-1.11.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

Make sure you have the snapshot repo in you pom.xml:

        <repository>
            <id>codemc</id>
            <url>https://repo.codemc.org/repository/maven-snapshots/</url>
        </repository>

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

No branches or pull requests

2 participants