Litematica (Forge)

Litematica (Forge)

336k Downloads

Litematica 0.11.2 breaks flexible block placement in Tweakeroo 0.13.1 in singleplayer 1.18.2

n-zer opened this issue ยท 2 comments

commented

When Litematica 0.11.2 and Tweakeroo 0.13.1 are both loaded (with MaLiLib 0.12.1) flexible block placement will always place ghost blocks in singleplayer. The issue is still present if carpet extras is used with accurate block placement enabled.

Flexible block placement appears to work when playing on a server.

Edit: Issue is not present if Litematica 0.11.1 is used instead.

commented

This is caused by the "fallout" of vanilla adding a new check to the item use packet handling in 1.18.2.

The direct consequence of that added heck is that it breaks the "accurate block placement protocol" that Carpet mod introduced a few years back as a way for Carpet Client from the client side to communicate the requested custom block rotation to the Carpet mod on the server side, as it's encoded in the block hit position x coordinate value, and that 1.18.2 check now restricts the values to being within 0.0 and 1.001 or whatever the exact upper limit was set as.

So with that check added, if any client-side mod now requests any custom block rotations or properties via that "accurate block placement protocol", it will cause a "vanilla" server to reject that item use packet and print a warning in the server console. And then the "placed" block will remain a client-side ghost block since they didn't even make the server re-sync the clicked position in this case.

So now to make the protocol work again for these mods, the server-side code needs to have that added check "removed"/bypassed. But the way the code works in that part is a bit awkward, and the easiest Mixin to bypass it is a @Redirect, which can only be done once per targeted instruction. Which means that only one mod can do it at a time, the others trying to do it will fail (and even crash the game if it's not marked as non-required, which is what happens with CarpetExtra 1.4.69 and Litematica 0.11.2, since I forgot to make it non-required in the CarpetExtra PR which adds the bypass).

In the current mod versions the bypass being enabled is tied to the "feature that needs it" in the client mods. Which means that Litematica 0.11.2 is now the one applying the bypass Mixin, but that bypass is only active if Easy Place is enabled.

This is not great, and I'll need to release new mod versions where the bypass is controlled by a separate option, and it's just always enabled by default. There is realistically no point ever disabling it, as it didn't even exist ever before 1.18.2 and it's probably just means as some kind of exploit prevention(?) So it should just be always bypassed regardless of which features are enabled in the mods, so that it's not dependent on a given feature from another mod being enabled.

commented

I just uploaded Litematica 0.11.3 and Tweakeroo 0.13.3, which separate that fix/bypass to a new option that is not tied to any actual feature being enabled in the mods.