Fabric-Generator-MCreator icon indicating copy to clipboard operation
Fabric-Generator-MCreator copied to clipboard

[Bug] Block face entity is looking at with raytrace distance - Unusual/unpredictable behavior

Open purejosh opened this issue 1 year ago • 4 comments

Issue description

Hey Gold. I'm working on a hammer, and in order to achieve the breaking style I want, I'm using the following procedure: image HammerNotWorking.zip

The issue is, it appears that maybe the raycast method is going through the blocks, instead of colliding into them? Some angles work, others don't, but this procedure isn't reliable on Fabric. I converted the workspace to Forge, and it operates perfectly.

Note that this is only configured to work on up and down block faces. My goal is to have the blocks break, dependent on which block face the player is targeting at the break time. The player angle will be irrelevant, only the block face that's being targeted will be considered for calculating which other blocks it should break.

Here's a video of it working in Forge, and a video of it failing in Fabric:

https://github.com/Goldorion/Fabric-Generator-MCreator/assets/70633949/3d08e26f-f69a-4916-ae49-add4f2e7a84c https://github.com/Goldorion/Fabric-Generator-MCreator/assets/70633949/62a28de2-840a-4849-bd6b-695acbb8dd49

How to reproduce this issue?

Use Block face entity is looking at with raytrace distance code, to determine which neighbor blocks to break. Observe that the block face calculation doesn't work often, due to an unknown reason.

Operating system

Windows

Details

Mcreator 2023.3 Fabric Generator 1.9.9

Example workspace

HammerWorkspace.zip

Logs

No response

Issue tracker rule checks (please read carefully)

purejosh avatar Sep 24 '23 15:09 purejosh

Whoever can fix this, I will buy you so much coffee/tea. 🙏

purejosh avatar Feb 11 '24 17:02 purejosh

I'm trying to fix the problem with the Block face ray trace block and I checked the code of both the Fabric generator and the Forge generator. I copied the Forge's code to the Fabric Generator and the only changes are spaces... they are literally the same thing :/ I could confirm the problem when e.g. looking/mining in diagonal, but I honestly have no idea why this happens (except if Forge fixed it)

This is what happens when copying the Forge code to Fabric: image

Goldorion avatar Feb 11 '24 22:02 Goldorion

The issue with copying the Forge code is that it simply doesn't work as intended in Fabric. I've talked a highly skilled dev about how they're doing it, I could meet with you sometime on Discord and show you what I know of that meeting. Maybe with your java knowledge and my research, we could fix this.

purejosh avatar Mar 16 '24 14:03 purejosh

If you want to help with the issue, I'm opened for sure

Goldorion avatar Mar 16 '24 14:03 Goldorion