litematica-printer icon indicating copy to clipboard operation
litematica-printer copied to clipboard

[SUGGESTION] Making the printer faster.

Open JackDainzh opened this issue 2 years ago • 3 comments

So I've recently modified the code of a printer and made it so that non-rotating and rotating blocks are placed at different speeds. This allows for instant placing for non-rotating blocks and a relatively fast speed for all other redstone stuff. Should I create a pull-request or rather keep it to my own fork?

JackDainzh avatar Aug 14 '22 18:08 JackDainzh

I that sounds like something people would be interested in and a pr would me much appreciated. Two things though: have you tried if placing non-rotating blocks fast on high ping servers produces ghost blocks? Also, I think people should be able to configure the fast printing speed separately with a slider or a checkbox (in case the ghost blocks become an issue). How have you implemented the fast printing currently?

Once those have been resolved, I'd be happy to include the feature in my repo :)

aleksilassila avatar Aug 14 '22 18:08 aleksilassila

I implemented it as two separate sliders of Intervals. One for rotating blocks and one not for rotating blocks. The printer itself is sped up by 10. so the default value of the Interval for rotating blocks would be 10, and 2 for non rotating blocks. I also made some modifications to how we process stuff there. The ranging and placement prep is now a separate method. Then there is filtering for if the block has a facing property at all, depending on that we add it to the corresponding array and later use it as a condition. clearQueue is also sped up to remove blocks rotating wrong between speed changes. I will make a PR tomorrow, you can see for yourself. The ghost block problem is non existent, I placed it on the server with a 80 ping, works fine, tho speed might depend on ping. So far as I know no ghost blocks were noticed. All this is made with little Java knowledge, so feel free to change anything.

JackDainzh avatar Aug 14 '22 19:08 JackDainzh

https://user-images.githubusercontent.com/44118724/184589232-5892c106-d320-4eae-9ad5-a15b67606819.mp4

JackDainzh avatar Aug 15 '22 06:08 JackDainzh

I've addressed this in 3.0, though I haven't done much testing on servers, so I don't know if it gets some of the rotations wrong on high speeds. If it does and you think it could be solved by modifying the placement speed of blocks requiring a look direction, reopen this issue and I will look into it.

aleksilassila avatar Dec 07 '22 22:12 aleksilassila