Added commandsender casting

This commit is contained in:
sekwah41 2018-02-01 21:56:38 +00:00 committed by Sekwah
parent bd497a5e7f
commit df9fdcc0f5

View File

@ -3,6 +3,7 @@ package com.sekwah.advancedportals.coreconnector.container;
import com.sekwah.advancedportals.core.data.PlayerLocation;
import com.sekwah.advancedportals.core.util.Lang;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class CommandSenderContainer {
@ -24,6 +25,9 @@ public class CommandSenderContainer {
* @return null if there isnt a player e.g. the console
*/
public PlayerContainer getPlayerContainer() {
if (sender instanceof Player) {
return new PlayerContainer((Player) sender);
}
return null;
}