Furniture Expanded [FORGE/FABRIC]

Furniture Expanded [FORGE/FABRIC]

619k Downloads

Crash log

lostopkk opened this issue ยท 3 comments

commented
commented

Hm... weird. That should not be happening.
Can you test this one? Just unzip and replace your old one.
FEFabric-UNZIP THIS.zip

commented

Greetings! This bug was also reported to me as it occurred in combination with my mod, DynamicCrosshair: Crendgrim/DynamicCrosshairCompat#5
For context, I create a fake item placement context to see if the held item can be placed as a block in the looked at place. Investigating the crash led me to a way to replicate this crash with only your mod (and fabric-api) installed:

Hold an item of type "toilet paper roll" in your hand. Try to place it against the floor or ceiling.

This crash happens because the safeguard here is not complete:

if (!(nearest == Direction.DOWN || nearest == Direction.UP)) {

You make sure to only rotate when you are in a horizontal direction; but still erroneously return with Up/Down as the "facing" value if the item is being placed against a floor / ceiling. As far as I can tell, the vanilla way here would be to return "null" if the faced block face is Up or Down.

commented

I didn't even noticed that, thanks for pointing it out. Turns out that the problem was pretty much what you said.
I ended up using context.getPlayerLookDirection when I was porting to fabric, which returns all possible direction values. Using context.getPlayerFacing, which just return the horizontal values, fixed the problem.

Direction nearest = context.getPlayerLookDirection();

return this.getDefaultState().with(face, context.getPlayerLookDirection().getOpposite()).with(height, _height).with(side, _side);

I will be uploading the fixed version soon.