dough icon indicating copy to clipboard operation
dough copied to clipboard

Lockette fixes, LockettePro support

Open Techirion opened this issue 1 year ago • 9 comments

Techirion avatar Dec 10 '23 22:12 Techirion

The dependency is not being found, could you double check if it's correct please?

EDIT: Could it be you need one from https://github.com/brunyman/LockettePro rather than NyaaCat's one?

Alessio-Colombo avatar Dec 11 '23 20:12 Alessio-Colombo

It should be updated fork of https://github.com/connection-lost/LockettePro

probably...

https://github.com/NyaaCat/LockettePro https://github.com/GreenSurvivors/LockettePro https://github.com/233Chad/LockettePro

personally I'm using the one from NyanCat, also the one from 233Chad is good, they all use same package names.

Techirion avatar Dec 11 '23 22:12 Techirion

My bad I just realized I'm using 233Chad's version.

Techirion avatar Dec 11 '23 22:12 Techirion

This should fix the issue.

Techirion avatar Dec 14 '23 09:12 Techirion

Would also like to point out that the I suspect original Lockette implementation is wrong:

https://github.com/baked-libs/dough/blob/dd9b6b617f0539e832bfe6a31b169d13cd82551e/dough-protection/src/main/java/io/github/bakedlibs/dough/protection/modules/LocketteProtectionModule.java#L36

If block is NOT protected by lockette is would always return false for hasPermission, this is probably not right?

Furthermore booleans are also wrongly negated? So if Lockette#isOwner returns true, hasPermission would actually return false?

Techirion avatar Dec 14 '23 09:12 Techirion

Would also like to point out that the I suspect original Lockette implementation is wrong:

main/dough-protection/src/main/java/io/github/bakedlibs/dough/protection/modules/LocketteProtectionModule.java

` @OverRide public boolean hasPermission(OfflinePlayer p, Location l, Interaction action) { if (action.getType() != ActionType.BLOCK) { return true; }

    Block b = l.getBlock();

    if (Lockette.isProtected(b)) {
        BlockState state = b.getState();

        if (state instanceof Sign) {
            return !Lockette.isOwner((Sign) state, p);
        } else {
            return !Lockette.isOwner(b, p);
        }
    } else
        return false;
}

`

If block is NOT protected by lockette is would always return false for hasPermission, this is probably not right?

Furthermore booleans are also wrongly negated? So if Lockette#isOwner returns true, hasPermission would actually return false?

What you are saying could very well be true, This is why i said on discord to you we do not implement these things since we do not know how their stuff works. This might very well be case of a user like you implementing this wrongly and since we do not the implementation these issues would arrise

J3fftw1 avatar Dec 14 '23 09:12 J3fftw1

https://github.com/NyaaCat/LockettePro/blob/1.20.1/src/main/java/me/crafter/mc/lockettepro/LocketteProAPI.java

I understand, sorry for the confusion, I guess I can just close this?

Techirion avatar Dec 14 '23 10:12 Techirion

You dont have to close this we appreciate the PR. We just need to be sure its working.

J3fftw1 avatar Dec 14 '23 10:12 J3fftw1

Marking this as stale. The repo is no merged to the Slimefun org so it should be reviewed faster in the future.

J3fftw1 avatar Feb 25 '24 16:02 J3fftw1