Accelerated Recoiling
Accelerated Recoiling is an entity collision logic optimization plugin designed to significantly reduce the collision calculation overhead in entity-dense areas. By leveraging the Foreign Function & Memory (FFM) API (available in Java 21+), it offloads entity AABB collision detection to the GPU, moving the computational pressure away from the main thread.
This plugin is currently experimental and still in the testing phase. Unexpected behavior or errors may occur. Please make a backup of your saves before using it, and proceed with caution.
Requirements
- Java 21 or higher: The FFM API is an official feature in Java 21. **You must use Java 21+ to launch your server.
- 64-bit Operating System: The native library (
.dll/.so) requires a 64-bit environment. - Windows Platform Microsoft Visual C++ Redistributable: If startup fails, please install this runtime first.
- Linux Platform: If startup fails, please install the OpenCL runtime first. * For Debian/Ubuntu systems, you can typically install it via
sudo apt install ocl-icd-libopencl1. * For other distributions, please use your package manager to install the corresponding OpenCL runtime. - OpenCL: You need a compatible graphics card or a driver that can run OpenCL properly.
Installation
When the mod is launched for the first time, it will automatically extract the acceleratedRecoilingLib.dll (or .so) file and create an acceleratedRecoiling.json configuration file in the server root directory.
You can find the acceleratedRecoiling.json file in the server root directory (at the same level as the plugins folder).
Server Crashed !
If the server can not start normally…
Try to add --enable-preview to JVM start arguments** , or use Java 22+ start your server.
If this doesn't work, Please update this plugin and Delete file .minecraft/acceleratedRecoilingLib.dll and restart your server. (.minecraft/ Or your server root directory)
Default Configuration:
{
"enableEntityCollision": true,
"enableEntityGetterOptimization": true,
"gridSize": 8,
"maxCollision": 32,
"gpuIndex": 0,
"useCPU": false
}
enableEntityCollision: Whether to enable optimization (can be toggled in-game with
/acceleratedrecoiling)enableEntityGetterOptimization: Whether to enable EnttiyGetter optimization (can be toggled in-game with
/acceleratedrecoiling)gridSize: The size of the world grid division
maxCollision: The maximum number of entities one entity can collide with (limited by the OpenCL output buffer)
gpuIndex: The index of the GPU to use
useCPU: Whether to use the CPU