-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Actually pass mob to pathfinding methods #1745
base: 1.21.x
Are you sure you want to change the base?
Conversation
The current code would only pass `null` to `getAdjacentBlockPathType` and `getBlockPathType`. This PR fixes it by introducing overloads with the mob and storing the mob in the `PathfindingContext`
Last commit published: 50f5f2adcc263d79a97b28f33d65151a2cb14bb9. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #1745' // https://github.com/neoforged/NeoForge/pull/1745
url 'https://prmaven.neoforged.net/NeoForge/pr1745'
content {
includeModule('net.neoforged', 'neoforge')
includeModule('net.neoforged', 'testframework')
}
}
} MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr1745
cd NeoForge-pr1745
curl -L https://prmaven.neoforged.net/NeoForge/pr1745/net/neoforged/neoforge/21.4.35-beta-pr-1745-gh-791/mdk-pr1745.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip To test a production environment, you can download the installer from here. |
While this solution seems obvious and perfectly fine at the surface, I don't think it works as expected in practice when the |
I think we only have two options. We can either remove the extension methods as being unusable (considering they always receive a null mob) or we could change the path cache to also be entity-type scoped, though I'm not sure what the best way to do it in a memory and CPU efficient is (we could have an array of path type arrays and then use entity type int ids? It would be fast, but that's not memory efficient). Even if we go for the latter, we would need to mention that the extension methods should ideally not use entity data and where possible only entity types as the cache would be shared between them. |
The extension method would still be required even if the mob parameter stays dead or is removed since there is otherwise no way to assign a path type to custom blocks.
This is also an idea I had, the major downside of it (apart from memory cost, which isn't huge) is that path type results which should aren't mob type sensitive would not be shared anymore by different entity types. The only way around that which I can come up with would be to add a |
The current code would only pass
null
togetAdjacentBlockPathType
andgetBlockPathType
. This PR fixes it by introducing overloads with the mob and storing the mob in thePathfindingContext
.Fixes #791