-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
Blocks in 'place' flag only placeable if clicked block is also in flag #2524
Comments
Removing any onInteract check tends to break a lot of other things unintentionally. I believe this is intended behavior though. |
So if you want to allow anyone to place flowers on your grass, you have to add grass to the 'place' flag, too? If this is intended, then why? Isn't it sufficient to specify the blocks that you want to be able to be placed? |
I misread the issue when I made that first comment. Ignore everything I said except for the onItemInteract part. |
To me, honestly, it sounds like something is broken - but not what @mindw0rm is thinking. However, since I'm just a drop in the bucket of users in this, I think it would be up to the devs to decide which is actually broken. |
Someone who is trusted/added can place anything anyway, why should there be a flag required? Or maybe they only should be able to place anything if the place flag is empty, and if it is not, they can place only the specified blocks? |
Same issue by myself: |
Why haven't I found that issue when I searched for 'place'? :( |
I'm derp. Sorry. Yes, the flags are for non-added players to be able to interact. |
@AeSix I don't agree that it is a duplicate, because the problematic here is not mentioned in #2483 at all (except shortly in one of my comments, but only as a reference to here). I'm not even sure what exactly the issue of the other bug is (maybe that there should be a possibility to add all blocks to the blocklist flags?), but it has nothing to do with the problem that the block that you clicked on is also important for placing blocks. Please reconsider you decision, or at least edit the other bug so that the problem described here is mentioned in the first post. Because else it will be forgotten, and I'll have to report it again in the future. |
they appear to be the same root cause to me. |
Well I think the root cause of this bug is that here, IF that is done, the check called here gets a block with the material in the hand you clicked with (i.e. the one you want to place) instead of the the material of the block that you clicked at. But that won't help with the other issue. I just added the line |
Fun fact: all I had to do move a line up a bit. Took me a while to realize that the thing that I want to happen is already done directly after the if where it is required :) |
Place flag bugfix (fixxes issue #2524)
Debug paste link:
https://athion.net/ISPaster/paste/view/da7449b0efc14e5c9b20249b5171ae49
[REQUIRED] Spigot/Paper Version Number:
CraftBukkit version git-Spigot-94af569-c2d1201 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT) [latest version]
[REQUIRED] Minecraft Version Number: 1.14.4
[REQUIRED] Description of the problem:
If you try to place a block on a plot where you are not a member, but where the block type is in the 'place' flag, you can only place it if the block that you clicked at is also in the 'place' flag.
If you click on a block which is not in 'place', the message "Have an admin set the flag: place" is shown.
If you click on a block which is in 'place', but the block in your hand is not, the message "You are lacking the permission node: plots.admin.build.other" is shown.
Only if both the block in your hand and the one you click at is in 'place', it can be placed.
Note that while the above debugpaste shows the current release of PlotSquared (4.353), the bug also happens with the current github version - I normally use a custom version which branched at 4.386 (but the stuff I added - #2506, and some new flag which I might turn to a pull request later when it works as intended, see my fork if you are curious - does not concern block placement).
I tracked it to https://github.com/IntellectualSites/PlotSquared/blob/breaking/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java#L2139: here lb is the block that was interacted with, i.e. the one clicked at, and EventUtil.manager.checkPlayerBlockEvent uses the type of lb when checking the 'place' flag.
Since 'place' is checked later anyway (in https://github.com/IntellectualSites/PlotSquared/blob/breaking/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java#L3005), maybe the check in onInteract can be removed?
Plugins being used on the server:
see debugpaste above, none should be relevant for this bug.
[REQUIRED] How to replicate:
/plot flag add stone
)block types reachable (e.g. grass_block)
** place the block in place on blocks of different type, which is not in 'place' --> error message shown (but this should imho work)
** place it on a block with the same type --> can be placed
** place a different block (which is not in 'place') on the block in 'place' --> different error message shown (which is correct)
[REQUIRED] Checklist:
The text was updated successfully, but these errors were encountered: