Flexible Block Placement has glitchy UI
VIXIVIXIV opened this issue ยท 7 comments
When opening the flexible placement GUI for offset and adjacent blocks, if you move your cursor such that the direction selection changes (like starting in the middle, but changing your mind and going to an edge, or starting outside the selection box, then moving your cursor inside), then the flexible placement function fails and the block is placed against the targeted block face (vanilla behavior).
Worth noting that this was observed on a PaperMC server, no plugins related to block placement installed. And flexible placement does work if you target the direction you want when activating the tweak (not changing the selected direction while the GUI is open)
By the way, to what extent should flexible rotation work on servers without Carpetmod installed? When using flexible rotation, I don't get kicked, and the server log doesn't say anything about invalid block placements, but the block only rotates for an instant before returning to the vanilla direction. Is that related to Paper/Spigot anti-cheat, or is it because Carpetmod is not installed serverside?
The rotation issues seem to be related to certain blocks that are view angle-based, that's related to how Paper handles things. Everything else has been working fine, but I had to configure the hotkeys so they'd ignore other keypresses.
Update: I got flexible rotation working with certain blocks (e.g. logs), which makes the rotation issue appear to only apply to player-rotation-sensitive blocks (pistons). However, the same bug with the UI as mentioned above applies.
Update 2: I did some more testing and it seems the glitch is not directly caused by moving the cursor between the different block face regions, but instead by holding the activation key for too long (which is more likely if one is initially off-target and then has to readjust). For example, starting the center selected and then moving to an edge does work as long as you do it quickly enough while targeting the center and holding the UI open does not work (block placed according to vanilla behavior).
Also tested in singleplayer to eliminate potential confounding factors with PaperMC.
There is nothing at all in the code that would care about how long you've had the hotkey pressed down. The main issue here is that the rotation simply will not work in multiplayer without Carpet mod with accurateBlockPlacement
rule enabled on the server side. There are a few blocks that will work without Carpet mod, and those are blocks that only care about the clicked block side, such as Hoppers, Logs, Quartz Pillars (like you have discovered).
This should work perfectly fine in single player, however you do need to enable the carpetAccuratePlacementProtocol
option (currently in Tweak Toggles) which is by default disabled. (And also the clientPlacementRotation
option in Generic needs to be enabled, and that one is enabled by default.)
The quick moves allowing it to work may be related to the reason why this for the most part does not work in multiplayer, especially for pistons, observers, droppers and dispensers. And that is that in 1.13+ those blocks are now placed based on the player's head rotation on the servers side, and the head rotation is updated in the player's tick method, so there is a slight delay from the client to the server on when the head will rotate. So it's therefore now possible to place pistons even in vanilla in the opposite rotation from the normal, by doing a very quick head flip (https://www.youtube.com/watch?v=3AnDuy-aj5Q).
I recognize the true source of the issues with placing rotated blocks, but offset blocks exhibit the issues I described with the GUI, even in singleplayer. Link to YouTube demonstrating various cases in which the flexible placement does or does not work, at least according to expected behavior.
Whoops, forgot to actually paste the link
https://youtu.be/xOt2aKULDHg