Class SectionManager
java.lang.Object
fr.prodrivers.bukkit.commons.sections.SectionManager
Prodrivers Commons Section Manager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenter(org.bukkit.entity.Player player) Make a player enter his current section's preferred next sectionstatic voidMake a player enter a section by section name.static voidMake a player enter a section by section name.static voidMake a player enter a section by section name.static IProdriversSectiongetCurrentSection(org.bukkit.entity.Player player) Get a player's current section instancestatic voidregister(IProdriversSection section) Register a new section instance against the Prodrivers Commons infrastructure
-
Constructor Details
-
SectionManager
public SectionManager()
-
-
Method Details
-
enter
public static void enter(org.bukkit.entity.Player player) throws NoCurrentSectionException, NoNextSectionException, IllegalSectionLeavingException, IllegalSectionEnteringException Make a player enter his current section's preferred next section- Parameters:
player- Player to be moved- Throws:
NoCurrentSectionException- The player does not have a current sectionNoNextSectionException- The player's current section does not have a next sectionIllegalSectionLeavingException- The current section forbids the player to go to the preferred next sectionIllegalSectionEnteringException- The player should not enter the preferred next section
-
enter
public static void enter(org.bukkit.entity.Player player, String sectionName) throws InvalidSectionException, IllegalSectionLeavingException, IllegalSectionEnteringException, NotPartyOwnerException Make a player enter a section by section name. If the current section force a specific target section, this method will fail gracefully.- Parameters:
player- Player to be movedsectionName- Section name to go to- Throws:
InvalidSectionException- Invalid section name providedIllegalSectionLeavingException- The current section forbids the player to go to the desired sectionIllegalSectionEnteringException- The player should not enter the desired sectionNotPartyOwnerException- The player is in a party and is trying to enter a section not authorized as a non-party owner
-
enter
public static void enter(org.bukkit.entity.Player player, String sectionName, String subSection) throws InvalidSectionException, IllegalSectionLeavingException, IllegalSectionEnteringException, NotPartyOwnerException Make a player enter a section by section name. If the current section force a specific target section, this method will fail gracefully.- Parameters:
player- Player to be movedsectionName- Section name to go tosubSection- Sub-section to go to- Throws:
InvalidSectionException- Invalid section name providedIllegalSectionLeavingException- The current section forbids the player to go to the desired sectionIllegalSectionEnteringException- The player should not enter the desired sectionNotPartyOwnerException- The player is in a party and is trying to enter a section not authorized as a non-party owner
-
enter
public static void enter(org.bukkit.entity.Player player, String sectionName, String subSection, boolean force) throws InvalidSectionException, IllegalSectionLeavingException, IllegalSectionEnteringException, NotPartyOwnerException Make a player enter a section by section name.- Parameters:
player- Player to be movedsectionName- Section name to go tosubSection- Sub-section to go toforce- Force the player to go to the target section, even if his current section prefers another. He will be successively transferred to intermediate preferred sections to avoid any problems.- Throws:
InvalidSectionException- Invalid section name providedIllegalSectionLeavingException- The current section forbids the player to go to the desired sectionIllegalSectionEnteringException- The player should not enter the desired sectionNotPartyOwnerException- The player is in a party and is trying to enter a section not authorized as a non-party owner
-
register
Register a new section instance against the Prodrivers Commons infrastructure- Parameters:
section- Prodrivers Commons-compatible section to register- Throws:
NullPointerException- Provided section is null
-
getCurrentSection
Get a player's current section instance- Parameters:
player- Player to consider- Returns:
- Player's section instance if possible or null
-