Class PhysicsManager

java.lang.Object
fr.phylisiumstudio.soraxPhysic.PhysicsManager

public class PhysicsManager extends Object
  • Field Details

    • lock

      public static final Object lock
  • Constructor Details

    • PhysicsManager

      public PhysicsManager()
      Create a new physics manager
  • Method Details

    • registerWorld

      public void registerWorld(WorldPhysics world)
      Register a world with the physics engine
      Parameters:
      world - The world to register
    • unregisterWorld

      public void unregisterWorld(WorldPhysics world)
      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 box
      data - The block data
      mass - The mass of the box
      xScale - The x scale of the box
      yScale - The y scale of the box
      zScale - 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 sphere
      data - The block data
      mass - The mass of the sphere
      radius - The radius of the sphere
    • getWorldPhysics

      public WorldPhysics getWorldPhysics(UUID uniqueId)
      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

      public List<WorldPhysics> getAllWorlds()
      Get all the worlds being simulated
      Returns:
      The list of worlds
    • isWorldSimulated

      public boolean isWorldSimulated(UUID worldId)
      Check if a world is being simulated
      Parameters:
      worldId - The unique id of the world
      Returns:
      True if the world is being simulated