For plugin authors
How another server plugin builds against PhysicsApi.
The Java API is for server plugins; server owners do not need it. Compile against the jar with compileOnly, add co.nomadlabs:NomadPhysics to Dependencies in your manifest, and install Nomad Physics alongside your plugin. Bundling a second copy of the physics classes can give your plugin a separate API holder.
PhysicsApi.get()returns null before setup and after shutdown.spawnBodyreturns null when the model is unknown, the destination section is unloaded, or the world has reached its body cap. Query the cap withbodyCap()rather than hard-coding it.- Simulation calls must run on the owning world's thread, for example inside
world.execute(...). Contact, impact and adoption callbacks already run there. - Beyond bodies and impulses there are contact and impact listeners, hinge, slider and ball joints,
adoptandreleasefor existing entities,spawnBlockBody, andregisterMachinefor content-pack items. - To make your own entities work with the guns, implement
AdoptableOwnerand register it from your plugin'sstart(). AdoptOptionscan set friction and restitution; the original five-argument constructor still works.