Conversation
Previously, it would query the FS multiple times per file on cache hit. File#length() returns 0 when it doesn't exist, so we can take advantage of that to query the FS once.
|
You should be able use maven local by adding it to the projects repos ans updating the version. https://github.com/MinecraftForge/MinecraftForge-Experimental/blob/c70e737b1ba2ccc4ed9995470dede042b7cda087/build.gradle#L60 uses the same backend code. |
Or impossible if you don't have perms. |
|
I don't want to publish it to Forge's maven repo every time I want to test a change locally. |
|
No, what i am saying is that it SHOULD work using maven local... |

The javadocs for File#length() state that it returns 0 if the file does not exist, so the exists() check is redundant. The length was also being queried from the filesystem twice instead of stored in a local variable.
This PR fixes those things which theoretically improves performance. I've not tested this yet as FG7's fgtools appears to be hardcoded to download from the Forge maven with no means of overriding it to use mavenLocal(), which makes it a bit tedious.