1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
package gtPlusPlus.core.commands; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; public class CommandUtils { public static EntityPlayer getPlayer(final ICommandSender icommandsender){ EntityPlayer player; if(icommandsender instanceof EntityPlayer){ player = (EntityPlayer)icommandsender; return player; } else { return null; } } }