Class PlayerFactorySpigot
java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.core.implementations.PlayerFactorySpigot
- All Implemented Interfaces:
IPlayerFactory
Represents an implementation of
IPlayerFactory for the Spigot platform.-
Constructor Summary
ConstructorsConstructorDescriptionPlayerFactorySpigot(SpigotServer spigotServer, DatabaseManager databaseManager, ILocalizer localizer, ITextFactory textFactory) -
Method Summary
Modifier and TypeMethodDescriptionCreates a newIPlayer.create(PlayerData playerData) Creates a newIPlayer.static org.bukkit.command.CommandSenderunwrapCommandSender(ICommandSender commandSender) Unwraps aICommandSenderinto a BukkitCommandSender.static org.bukkit.OfflinePlayerunwrapOfflinePlayer(IPlayer player) Tries to get an offline Bukkit player represented by anIPlayer.static @Nullable org.bukkit.entity.PlayerunwrapPlayer(IPlayer player) Tries to get an online Bukkit player represented by anIPlayer.wrapCommandSender(org.bukkit.command.CommandSender commandSender) Wraps a BukkitCommandSenderin anICommandSender.@Nullable WrappedPlayerwrapPlayer(IPlayer player) Gets theWrappedPlayerinstance for the givenIPlayer.wrapPlayer(org.bukkit.entity.Player player) Creates a newWrappedPlayerinstance that wraps a BukkitPlayer.wrapPlayer(org.bukkit.OfflinePlayer player) Wraps an offline Bukkit player in an IPlayer.
-
Constructor Details
-
PlayerFactorySpigot
@Inject public PlayerFactorySpigot(SpigotServer spigotServer, DatabaseManager databaseManager, ILocalizer localizer, ITextFactory textFactory)
-
-
Method Details
-
unwrapPlayer
-
unwrapOfflinePlayer
-
unwrapCommandSender
Unwraps aICommandSenderinto a BukkitCommandSender.- Parameters:
commandSender- The command sender.- Returns:
- The unwrapped bukkit command sender.
-
wrapPlayer
Gets theWrappedPlayerinstance for the givenIPlayer.- Parameters:
player- The player.- Returns:
- The
WrappedPlayerinstance, or null if no online player was found.
-
wrapPlayer
Creates a newWrappedPlayerinstance that wraps a BukkitPlayer.- Parameters:
player- The Bukkit player.- Returns:
- The new
WrappedPlayerinstance.
-
wrapPlayer
Wraps an offline Bukkit player in an IPlayer.- Parameters:
player- The Bukkit player.- Returns:
- The IPlayer.
-
wrapCommandSender
Wraps a BukkitCommandSenderin anICommandSender.- Parameters:
commandSender- The Bukkit command sender.- Returns:
- The wrapped command sender.
-
create
Description copied from interface:IPlayerFactoryCreates a newIPlayer.- Specified by:
createin interfaceIPlayerFactory- Parameters:
playerData- ThePlayerDataof the player.- Returns:
- A new
IPlayerobject.
-
create
Description copied from interface:IPlayerFactoryCreates a newIPlayer.- Specified by:
createin interfaceIPlayerFactory- Parameters:
uuid- TheUUIDof the player.- Returns:
- A new
IPlayerobject.
-