Package fr.phylisiumstudio.soraxPhysic
Class PhysicsManager
java.lang.Object
fr.phylisiumstudio.soraxPhysic.PhysicsManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all the physics objectscreateBox
(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float mass, float xScale, float yScale, float zScale) Create a boxvoid
createSphere
(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float mass, float radius) Create a sphereGet all the worlds being simulatedgetWorldPhysics
(UUID uniqueId) Get the physics object for the given worldboolean
isWorldSimulated
(UUID worldId) Check if a world is being simulatedvoid
Pause the physics simulation for all worldsvoid
registerWorld
(WorldPhysics world) Register a world with the physics enginevoid
Resume the physics simulation for all worldsvoid
stop()
Stop the physics enginevoid
unregisterWorld
(WorldPhysics world) Unregister a world from the physics engine
-
Field Details
-
lock
-
-
Constructor Details
-
PhysicsManager
public PhysicsManager()Create a new physics manager
-
-
Method Details
-
registerWorld
Register a world with the physics engine- Parameters:
world
- The world to register
-
unregisterWorld
Unregister a world from the physics engine- Parameters:
world
- The world to unregister
-
createBox
public RigidBlock createBox(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float mass, float xScale, float yScale, float zScale) Create a box- Parameters:
location
- The location of the boxdata
- The block datamass
- The mass of the boxxScale
- The x scale of the boxyScale
- The y scale of the boxzScale
- The z scale of the box- Returns:
- The rigid block
-
createSphere
public void createSphere(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float mass, float radius) Create a sphere- Parameters:
location
- The location of the spheredata
- The block datamass
- The mass of the sphereradius
- The radius of the sphere
-
getWorldPhysics
Get the physics object for the given world- Parameters:
uniqueId
- The unique id of the world- Returns:
- The physics object or null if not found
-
clear
public void clear()Clear all the physics objects -
stop
public void stop()Stop the physics engine -
pauseAllWorlds
public void pauseAllWorlds()Pause the physics simulation for all worlds -
resumeAllWorlds
public void resumeAllWorlds()Resume the physics simulation for all worlds -
getAllWorlds
Get all the worlds being simulated- Returns:
- The list of worlds
-
isWorldSimulated
Check if a world is being simulated- Parameters:
worldId
- The unique id of the world- Returns:
- True if the world is being simulated
-