Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
purejosh opened this issue Sep 24, 2023 · 4 comments
Open
3 tasks done
Labels
bug Something isn't working more info needed This issue or pull request needs more information

Comments

@purejosh
Copy link
Contributor

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 purejosh added the bug Something isn't working label Sep 24, 2023
@purejosh
Copy link
Contributor Author

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

@Goldorion
Copy link
Owner

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 Goldorion added the more info needed This issue or pull request needs more information label Feb 11, 2024
@purejosh
Copy link
Contributor Author

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.

@Goldorion
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working more info needed This issue or pull request needs more information
Projects
None yet
Development

No branches or pull requests

2 participants