Create

Create

86M Downloads

TinyRedstone circuit collision problem when on a contraption

evg-zhabotinsky opened this issue ยท 4 comments

commented

Describe the Bug

See dannydjdk/Tiny-Redstone#95

In short, TinyRedstone circuit block needs its block entity to compute collision shape, but either it can't get that or a cached "default" shape for the blockstate is used.

This results in circuits having wrong collision when on moving contraptions, which is especially relevant when using them for decorative microblocks. Currently that "placeholder" collision is just the circuit panel, if present, otherwise an almost solid block. (Before the fixes it was empty, resulting in contraptions not picking up circuits.)

Visual rendering is fine, only collision has problems. Create version is any, from oldest on 1.16 to latest on 1.18.1.

Danny thinks that it can't be fixed on TinyRedstone side, and I don't have enough experience debugging Java or modding MC to really tell, so posting it here for thoughts and suggestions and maybe a fix on Create side.

Reproduction Steps

  1. Get TinyRedstone: either this build (circuits not picked up by contraptions) or build the latest dev ("placeholder" collision on contraptions; brebuilt normal and deobfuscated jars available). Latest TinyRedstone dev has Create in its gradle runClient task, so can use that too.
  2. Build a circuit on a contraption with lots of "tiny solid blocks" to stand on. Or use my testing save.
  3. Observe that you can stand on "tiny solid blocks" when the contraption is reverted to blocks, but not when it is assembled and possibly moving.

Expected Result

Would be nice to keep the proper circuit collision on moving contraptions.

Screenshots and Videos

Screens from my test save with latest TinyRedstone dev:
2022 02 02-10:15:47 302-w
2022 02 02-10:16:15 969-w

Crash Report or Log

No response

Operating System

Manjaro

Mod Version

0.4.0c

Minecraft Version

1.18.1

Forge Version

39.0.46

Other Mods

Tiny-Redstone

Additional Context

No response

commented

P.S. The bug report form didn't let me chose "Mod Version" = "0.4.0d", it wasn't on the list. Neither was "latest git build" there.

commented

The solution for this may be a simple one. When calling the getCollisionShape on a blockstate without including a CollisionContext, Minecraft just gives you the cached collision shape for the block state, not the specific block. So, Create contraptions do not getting dynamic collision shapes. If Create were to call state.getCollisionShape(world, pos, context) where context is a non-empty CollisionContext, the collision shape would be correct for Tiny Redstone and any other mods that have blocks with dynamic collision shapes.

commented

This issue has been marked as stale because it has been inactive for 3 weeks. It will be closed if it remains inactive for another 3 weeks.

commented

This issue has been closed since it has been inactive for 3 weeks since it was marked as stale.