Pehkui

Pehkui

35M Downloads

[Dev Question] Properly resetting size in 1.18.2

zabi94 opened this issue ยท 1 comments

commented

Minecraft version(s)

1.18.2

Minecraft version details

No response

Mod loader

Fabric

Mod loader version

0.13.3

Fabric API version

0.48.0+1.18.2

In what environment did the problem occur?

Other (specify in "What went wrong?" section)

What went wrong? (Crash logs don't go here)

Environment: single player dev instance.
I'm trying to reset the player size once a potion effect wears off. In previous versions of the mod I simply used

if (!entity.world.isClient) {	
	ScaleData data = ModSizeModifiers.GROWING.getScaleData(entity);
	data.resetScale(true);
	ScaleTypesAdapter.BASE.getScaleData(entity).markForSync(true);
	data.markForSync(true);
}

but now that I'm updating to 1.18.2 it has some issues: whenever I shrink back down through this piece of code, player collisions are still calculated as if I'm big. The player starts to glitch as if there was a desynced block in the way everytime I approach a block.
Sneaking once fixes the issue.

Is there something I'm doing wrong or is it on Pehkui's side?

Full list of installed mods

modmenu 3.1.0
clothconfig 6.2.57
rei 8.0.442
trinkets 3.3.0
inventorio 1.6.2

fabric api, the mod I'm developing itself (extraalchemy)

Did the problem cause the game to crash?

No.

Full crash report contents (if you experienced a crash)

No response

commented

Collision desyncs should now be resolved with Pehkui 3.3.0.